Skip to content

Commit a538c79

Browse files
committed
haproxy-config.template: Allow empty ciphers
Allow the empty value for TLS ciphers (TLSv1.2 and earlier) and cipher suites (TLSv1.3), and use the empty value instead of setting a default value. Specifying the empty value means that the corresponding TLS version cannot be used. This commit fixes bug OCPBUGS-58040. https://issues.redhat.com/browse/OCPBUGS-58040 * haproxy-config.template: Allow the empty value for ROUTER_CIPHERS and ROUTER_CIPHERSUITES. Rather than using a default value, pass an empty value through to HAProxy (which in turn passes it through to OpenSSL).
1 parent 88f5fad commit a538c79

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

images/router/haproxy/conf/haproxy-config.template

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/}}
66
{{- define "conf/haproxy.config" }}
77
{{- $workingDir := .WorkingDir }}
8-
{{- $routerCiphers := env "ROUTER_CIPHERS" "intermediate" }}
8+
{{- $routerCiphers := env "ROUTER_CIPHERS" }}
99
{{- $routerCiphersuites := env "ROUTER_CIPHERSUITES" }}
1010
{{- $defaultDestinationCA := .DefaultDestinationCA }}
1111
{{- $dynamicConfigManager := .DynamicConfigManager }}
@@ -90,9 +90,9 @@ global
9090
ssl-default-bind-options ssl-min-ver {{ env "SSL_MIN_VERSION" "TLSv1.2" }}
9191
{{- if ne (env "SSL_MAX_VERSION" "") "" }} ssl-max-ver {{env "SSL_MAX_VERSION" }}{{ end }}
9292

93-
# The default cipher suite can be selected from the three sets recommended by https://wiki.mozilla.org/Security/Server_Side_TLS,
94-
# or the user can provide one using the ROUTER_CIPHERS environment variable.
95-
# By default when a cipher set is not provided, intermediate is used.
93+
# The default cipher suite can be selected from the three sets recommended by https://wiki.mozilla.org/Security/Server_Side_TLS,
94+
# or the user can provide one using the ROUTER_CIPHERS environment variable.
95+
# ROUTER_CIPHERS may be empty, in which case TLSv1.2 and earlier are not allowed.
9696
{{- if eq $routerCiphers "modern" }}
9797
# Modern cipher suite (no legacy browser support) from https://wiki.mozilla.org/Security/Server_Side_TLS
9898
tune.ssl.default-dh-param 2048
@@ -106,19 +106,20 @@ global
106106
tune.ssl.default-dh-param 1024
107107
ssl-default-bind-ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP
108108
{{- else }}
109-
# user provided list of ciphers (Colon separated list as seen above)
110-
# the env default is not used here since we can't get here with empty ROUTER_CIPHERS
109+
# User-provided list of ciphers (colon-separated list as seen above).
111110
tune.ssl.default-dh-param 2048
112-
ssl-default-bind-ciphers {{ env "ROUTER_CIPHERS" "ECDHE-ECDSA-CHACHA20-POLY1305" }}
111+
ssl-default-bind-ciphers "{{ $routerCiphers }}"
113112
{{- end }}
114113
{{/*
115114
The ssl-default-bind-ciphers option above configures ciphers for TLSv1.0,
116115
TLSv1.1, and TLSv1.2; for TLSv1.3, cipher suites are configured using the
117116
ssl-default-bind-ciphersuites option below.
118117
*/}}
119-
{{- with $routerCiphersuites }}
120-
ssl-default-bind-ciphersuites {{ $routerCiphersuites }}
121-
{{- end }}
118+
# The TLSv1.3 cipher suites are configured separately
119+
# using the ROUTER_CIPHERSUITES environment variable.
120+
# This list may be empty, in which case TLSv1.3 is not allowed.
121+
ssl-default-bind-ciphersuites "{{ $routerCiphersuites }}"
122+
122123
{{- with $captureCookie := .CaptureHTTPCookie }}
123124
{{- if (gt $captureCookie.MaxLength 63) }}
124125
tune.http.cookielen {{ $captureCookie.MaxLength }}

0 commit comments

Comments
 (0)