Skip to content

Commit 3fc7e9a

Browse files
committed
fix: update SSL variable naming (BREAKING)
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
1 parent 4a9387f commit 3fc7e9a

File tree

7 files changed

+32
-28
lines changed

7 files changed

+32
-28
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ docker run -p 8080:8080 -ti -e BLOCKING_PARANOIA=4 -v rules:/opt/owasp-crs/rules
139139

140140
ModSecurity is an open source, cross platform Web Application Firewall (WAF) engine for Apache, IIS and Nginx. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis.
141141

142+
## SSL files naming breaking change
143+
144+
`SSL` related variables have been renamed to highlight they are a path to a file, so docker doesn't complain about sensitive usage in the case of variables ending in `_KEY`.
145+
142146
### Nginx based images breaking change
143147

144148
| ⚠️ WARNING |
@@ -166,16 +170,16 @@ These variables are common to image variants and will set defaults based on the
166170
| METRICS_ALLOW_FROM | A single range of IP addresses that can access the metrics | `127.0.0.0/255.0.0.0 ::1/128` | `127.0.0.0/24` |
167171
| METRICS_DENY_FROM | A range of IP addresses that cannot access the metrics | `All` | `all` |
168172
| METRICSLOG | Location of metrics log file | `/dev/null` | - |
169-
| PROXY_SSL_CERT | A string indicating the path to the PEM-encoded X.509 certificate data file or token identifier of the proxied server | `/usr/local/apache2/conf/proxy.crt` | `/etc/nginx/conf/proxy.crt` |
170-
| PROXY_SSL_CERT_KEY | A string indicating the path to the PEM-encoded private key file of the proxied server | `/usr/local/apache2/conf/proxy.key` | `/etc/nginx/conf/proxy.key` |
173+
| PROXY_SSL_CERT_FILE | A string indicating the path to the PEM-encoded X.509 certificate data file or token identifier of the proxied server | `/usr/local/apache2/conf/proxy.crt` | `/etc/nginx/conf/proxy.crt` |
174+
| PROXY_SSL_CERT_KEY_FILE | A string indicating the path to the PEM-encoded private key file of the proxied server | `/usr/local/apache2/conf/proxy.key` | `/etc/nginx/conf/proxy.key` |
171175
| PROXY_SSL_CIPHERS| A string indicating the cipher suite to connect to the backend via TLS | `"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"` | - |
172176
| PROXY_SSL_PROTOCOLS | TLS protocols to enable for the connection to the backend | `"all -SSLv3 -TLSv1 -TLSv1.1"` | `TLSv1.2 TLSv1.3` |
173177
| PROXY_SSL | SSL Proxy Engine Operation Switch | `off` | - |
174178
| PROXY_SSL_VERIFY | A string value indicating the type of proxy server Certificate verification | `none` | `off` |
175179
| PROXY_TIMEOUT | Number of seconds for proxied requests to time out | `60` | `60s` |
176180
| SERVER_NAME | The server name | `localhost` | - |
177-
| SSL_CERT | A string indicating the path to the PEM-encoded X.509 certificate data file or token identifier of the proxied server | `/usr/local/apache2/conf/server.crt` | `/etc/nginx/conf/server.crt` |
178-
| SSL_CERT_KEY | A string indicating the path to the PEM-encoded private key file of the proxied server | `/usr/local/apache2/conf/server.key` | `/etc/nginx/conf/server.key` |
181+
| SSL_CERT_FILE | A string indicating the path to the PEM-encoded X.509 certificate data file or token identifier of the proxied server | `/usr/local/apache2/conf/server.crt` | `/etc/nginx/conf/server.crt` |
182+
| SSL_CERT_KEY_FILE | A string indicating the path to the PEM-encoded private key file of the proxied server | `/usr/local/apache2/conf/server.key` | `/etc/nginx/conf/server.key` |
179183
| SSL_CIPHERS| A string indicating the cipher suite for incoming TLS connections | `"ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"` | - |
180184
| SSL_OCSP_STAPLING | Enable / disable OCSP stapling | `On` | `on` |
181185
| SSL_PROTOCOLS | TLS protocols to enable for the connection to the backend | `"all -SSLv3 -TLSv1 -TLSv1.1"` | `TLSv1.2 TLSv1.3` |
@@ -195,7 +199,7 @@ These variables are common to image variants and will set defaults based on the
195199
| PORT | An int value indicating the port where the webserver is listening to | `8080` | - |
196200
| PROXY_ERROR_OVERRIDE | A string indicating that errors from the backend services should be overridden by this proxy server (see [ProxyErrorOverride](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxyerroroverride) directive). (Allowed values: `on`, `off`. Default: `on`) |
197201
| PROXY_PRESERVE_HOST | A string indicating the use of incoming Host HTTP request header for proxy request (Default: `on`) |
198-
| PROXY_SSL_CA_CERT | A string indicating the path to the PEM-encoded list of accepted CA certificates for the proxied server (Default: `/etc/ssl/certs/ca-certificates.ca`) |
202+
| PROXY_SSL_CA_CERT_FILE | A string indicating the path to the PEM-encoded list of accepted CA certificates for the proxied server (Default: `/etc/ssl/certs/ca-certificates.crt`) |
199203
| PROXY_SSL_CHECK_PEER_NAME | A string indicating if the host name checking for remote server certificates is to be enabled (Default: `on`) |
200204
| REMOTEIP_INT_PROXY | A string indicating the client intranet IP addresses trusted to present the RemoteIPHeader value (Default: `10.1.0.0/16`) |
201205
| REQ_HEADER_FORWARDED_PROTO | A string indicating the transfer protocol of the initial request (Default: `https`) |

apache/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ ENV \
121121
PORT=8080 \
122122
PROXY_ERROR_OVERRIDE=on \
123123
PROXY_PRESERVE_HOST=on \
124-
PROXY_SSL_CA_CERT=/etc/ssl/certs/ca-certificates.crt \
125-
PROXY_SSL_CERT_KEY=/usr/local/apache2/conf/proxy.key \
126-
PROXY_SSL_CERT=/usr/local/apache2/conf/proxy.crt \
124+
PROXY_SSL_CA_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
125+
PROXY_SSL_CERT_KEY_FILE=/usr/local/apache2/conf/proxy.key \
126+
PROXY_SSL_CERT_FILE=/usr/local/apache2/conf/proxy.crt \
127127
PROXY_SSL_CHECK_PEER_NAME=off \
128128
PROXY_SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
129129
PROXY_SSL=off \
@@ -136,8 +136,8 @@ ENV \
136136
SERVER_NAME=localhost \
137137
SERVER_SIGNATURE=Off \
138138
SERVER_TOKENS=Full \
139-
SSL_CERT_KEY=/usr/local/apache2/conf/server.key \
140-
SSL_CERT=/usr/local/apache2/conf/server.crt \
139+
SSL_CERT_KEY_FILE=/usr/local/apache2/conf/server.key \
140+
SSL_CERT_FILE=/usr/local/apache2/conf/server.crt \
141141
SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
142142
SSL_ENGINE=on \
143143
SSL_HONOR_CIPHER_ORDER=off \

apache/Dockerfile-alpine

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ ENV \
131131
PORT=8080 \
132132
PROXY_ERROR_OVERRIDE=on \
133133
PROXY_PRESERVE_HOST=on \
134-
PROXY_SSL_CA_CERT=/etc/ssl/certs/ca-certificates.crt \
135-
PROXY_SSL_CERT_KEY=/usr/local/apache2/conf/proxy.key \
136-
PROXY_SSL_CERT=/usr/local/apache2/conf/proxy.crt \
134+
PROXY_SSL_CA_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
135+
PROXY_SSL_CERT_KEY_FILE=/usr/local/apache2/conf/proxy.key \
136+
PROXY_SSL_CERT_FILE=/usr/local/apache2/conf/proxy.crt \
137137
PROXY_SSL_CHECK_PEER_NAME=off \
138138
PROXY_SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
139139
PROXY_SSL=off \
@@ -146,8 +146,8 @@ ENV \
146146
SERVER_NAME=localhost \
147147
SERVER_SIGNATURE=Off \
148148
SERVER_TOKENS=Full \
149-
SSL_CERT_KEY=/usr/local/apache2/conf/server.key \
150-
SSL_CERT=/usr/local/apache2/conf/server.crt \
149+
SSL_CERT_KEY_FILE=/usr/local/apache2/conf/server.key \
150+
SSL_CERT_FILE=/usr/local/apache2/conf/server.crt \
151151
SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
152152
SSL_ENGINE=on \
153153
SSL_HONOR_CIPHER_ORDER=off \

apache/conf/extra/httpd-vhosts.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ServerAdmin ${SERVER_ADMIN}
2727
SSLProxyEngine ${PROXY_SSL}
2828
SSLProxyVerify ${PROXY_SSL_VERIFY}
2929
SSLProxyCheckPeerName ${PROXY_SSL_CHECK_PEER_NAME}
30-
SSLProxyCACertificateFile ${PROXY_SSL_CA_CERT}
30+
SSLProxyCACertificateFile ${PROXY_SSL_CA_CERT_FILE}
3131

3232
UseCanonicalName on
3333

@@ -44,6 +44,6 @@ UseCanonicalName on
4444
Protocols ${H2_PROTOCOLS}
4545
H2Direct ${H2_DIRECT}
4646
SSLEngine ${SSL_ENGINE}
47-
SSLCertificateFile ${SSL_CERT}
48-
SSLCertificateKeyFile ${SSL_CERT_KEY}
47+
SSLCertificateFile ${SSL_CERT_FILE}
48+
SSLCertificateKeyFile ${SSL_CERT_KEY_FILE}
4949
</VirtualHost>

nginx/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ ENV \
181181
NGINX_ALWAYS_TLS_REDIRECT=off \
182182
NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx \
183183
PORT=8080 \
184-
PROXY_SSL_CERT=/etc/nginx/conf/proxy.crt \
185-
PROXY_SSL_CERT_KEY=/etc/nginx/conf/proxy.key \
184+
PROXY_SSL_CERT_FILE=/etc/nginx/conf/proxy.crt \
185+
PROXY_SSL_CERT_KEY_FILE=/etc/nginx/conf/proxy.key \
186186
PROXY_SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
187187
PROXY_SSL=off \
188188
PROXY_SSL_PROTOCOLS="TLSv1.2 TLSv1.3" \
@@ -197,8 +197,8 @@ ENV \
197197
SERVER_NAME=localhost \
198198
SERVER_TOKENS=off \
199199
SET_REAL_IP_FROM="127.0.0.1" \
200-
SSL_CERT=/etc/nginx/conf/server.crt \
201-
SSL_CERT_KEY=/etc/nginx/conf/server.key \
200+
SSL_CERT_FILE=/etc/nginx/conf/server.crt \
201+
SSL_CERT_KEY_FILE=/etc/nginx/conf/server.key \
202202
SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
203203
SSL_DH_BITS=2048 \
204204
SSL_OCSP_STAPLING=on \

nginx/Dockerfile-alpine

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ ENV \
182182
NGINX_ALWAYS_TLS_REDIRECT=off \
183183
NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx \
184184
PORT=8080 \
185-
PROXY_SSL_CERT=/etc/nginx/conf/proxy.crt \
186-
PROXY_SSL_CERT_KEY=/etc/nginx/conf/proxy.key \
185+
PROXY_SSL_CERT_FILE=/etc/nginx/conf/proxy.crt \
186+
PROXY_SSL_CERT_KEY_FILE=/etc/nginx/conf/proxy.key \
187187
PROXY_SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
188188
PROXY_SSL=off \
189189
PROXY_SSL_PROTOCOLS="TLSv1.2 TLSv1.3" \
@@ -198,8 +198,8 @@ ENV \
198198
SERVER_NAME=localhost \
199199
SERVER_TOKENS=off \
200200
SET_REAL_IP_FROM="127.0.0.1" \
201-
SSL_CERT=/etc/nginx/conf/server.crt \
202-
SSL_CERT_KEY=/etc/nginx/conf/server.key \
201+
SSL_CERT_FILE=/etc/nginx/conf/server.crt \
202+
SSL_CERT_KEY_FILE=/etc/nginx/conf/server.key \
203203
SSL_CIPHERS="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384" \
204204
SSL_DH_BITS=2048 \
205205
SSL_OCSP_STAPLING=on \

nginx/templates/conf.d/default.conf.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ server {
3838

3939
server_name ${SERVER_NAME};
4040

41-
ssl_certificate ${SSL_CERT};
42-
ssl_certificate_key ${SSL_CERT_KEY};
41+
ssl_certificate ${SSL_CERT_FILE};
42+
ssl_certificate_key ${SSL_CERT_KEY_FILE};
4343
ssl_session_timeout 1d;
4444
ssl_session_cache shared:MozSSL:10m;
4545
ssl_session_tickets off;

0 commit comments

Comments
 (0)