Skip to content

Commit b344384

Browse files
committed
Haproxy: fix duplicate ssl cert config
1 parent 561999f commit b344384

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

roles/haproxy/templates/haproxy_frontend.cfg.j2

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ frontend stats
1212
# -------------------------------------------------------------------
1313
frontend internet_ip
1414

15-
bind {{ haproxy_sni_ip.ipv4 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl crt /etc/haproxy/certs/ no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
16-
bind {{ haproxy_sni_ip.ipv6 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl crt /etc/haproxy/certs/ no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
15+
bind {{ haproxy_sni_ip.ipv4 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
16+
bind {{ haproxy_sni_ip.ipv6 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
1717
bind {{ haproxy_sni_ip.ipv4 }}:80 transparent
1818
bind {{ haproxy_sni_ip.ipv6 }}:80 transparent
1919
# Logging is done in the local_ip backend, otherwise all requests are logged twice
@@ -30,7 +30,7 @@ frontend internet_ip
3030
http-request redirect scheme https code 301 if !{ ssl_fc }
3131
# Log the user agent in the httplogs
3232
capture request header User-agent len 256
33-
# Put the useragent header in a variable, shared between request and response.
33+
# Put the useragent header in a variable, shared between request and response.
3434
http-request set-var(txn.useragent) req.fhdr(User-Agent)
3535
# The ACL below makes sure only supported http methods are allowed
3636
acl valid_method method {{ haproxy_supported_http_methods }}
@@ -51,7 +51,7 @@ frontend internet_ip
5151
http-response replace-header Set-Cookie (?i)(^(?!.*samesite).*$) \1;\ SameSite=None if !no_same_site_uas
5252
# Remove an already present SameSite cookie attribute for unsupported browsers
5353
http-response replace-value Set-Cookie (^.*)(?i);\ *SameSite=(Lax|Strict|None)(.*$) \1\3 if no_same_site_uas
54-
# Log whether the no_same_site_uas ACL has been hit
54+
# Log whether the no_same_site_uas ACL has been hit
5555
http-request set-header samesitesupport samesite_notsupported if no_same_site_uas
5656
http-request set-header samesitesupport samesite_supported if !no_same_site_uas
5757
# We need a dummy backend in order to be able to rewrite the loadbalancer cookies
@@ -66,7 +66,7 @@ frontend local_ip
6666
acl valid_vhost hdr(host) -f /etc/haproxy/acls/validvhostsunrestricted.acl
6767
acl staging req.cook(staging) -m str true
6868
acl staging src -f /etc/haproxy/acls/stagingips.acl
69-
acl stagingvhost hdr(host) -i -M -f /etc/haproxy/maps/backendsstaging.map
69+
acl stagingvhost hdr(host) -i -M -f /etc/haproxy/maps/backendsstaging.map
7070
use_backend %[req.hdr(host),lower,map(/etc/haproxy/maps/backendsstaging.map)] if stagingvhost staging
7171
use_backend %[req.hdr(host),lower,map(/etc/haproxy/maps/backends.map)]
7272
option httplog
@@ -82,7 +82,7 @@ frontend local_ip
8282
http-request capture sc_http_req_rate(0) len 4
8383
# Create an ACL when the request rate exceeds {{ haproxy_max_request_rate }} per 10s
8484
acl exceeds_max_request_rate_per_ip sc_http_req_rate(0) gt {{ haproxy_max_request_rate }}
85-
# Measure and log the request rate per path and ip
85+
# Measure and log the request rate per path and ip
8686
http-request track-sc1 base32+src table st_httpreqs_per_ip_and_path
8787
http-request capture sc_http_req_rate(1) len 4
8888
# Some paths allow for a higher ratelimit. These are in a seperate mapfile
@@ -96,7 +96,7 @@ frontend local_ip
9696
http-request deny if ! valid_vhost
9797
# Deny the request when the request rate exceeds {{ haproxy_max_request_rate }} per 10s
9898
http-request deny deny_status 429 if exceeds_max_request_rate_per_ip !allowlist
99-
# Deny the request when the request rate per host header url path and src ip exceeds {{ haproxy_max_request_rate_ip_path }} per 1 m
99+
# Deny the request when the request rate per host header url path and src ip exceeds {{ haproxy_max_request_rate_ip_path }} per 1 m
100100
http-request deny deny_status 429 if exceeds_max_request_rate_per_ip_and_path !allowlist
101101
# Create some http redirects
102102
{% if haproxy_securitytxt_target_url is defined %}
@@ -111,8 +111,8 @@ frontend local_ip
111111
## -------------------------------------------------------------------
112112
frontend internet_restricted_ip
113113

114-
bind {{ haproxy_sni_ip_restricted.ipv4 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl crt /etc/haproxy/certs/ no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
115-
bind {{ haproxy_sni_ip_restricted.ipv6 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst ssl crt /etc/haproxy/certs/ no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
114+
bind {{ haproxy_sni_ip_restricted.ipv4 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
115+
bind {{ haproxy_sni_ip_restricted.ipv6 }}:443 ssl crt-list /etc/haproxy/maps/certlist.lst no-sslv3 no-tlsv10 no-tlsv11 alpn h2,http/1.1 transparent
116116
bind {{ haproxy_sni_ip_restricted.ipv4 }}:80 transparent
117117
bind {{ haproxy_sni_ip_restricted.ipv6 }}:80 transparent
118118
# Logging is done in the local_ip_restriced backend, otherwise all requests are logged twice
@@ -128,8 +128,8 @@ frontend internet_restricted_ip
128128
# We redirect all port 80 to port 443
129129
http-request redirect scheme https code 301 if !{ ssl_fc }
130130
# Log the user agent in the httplogs
131-
capture request header User-agent len 256
132-
# Put the useragent header in a variable, shared between request and response.
131+
capture request header User-agent len 256
132+
# Put the useragent header in a variable, shared between request and response.
133133
http-request set-var(txn.useragent) req.fhdr(User-Agent)
134134
# The ACL below makes sure only supported http methods are allowed
135135
acl valid_method method {{ haproxy_supported_http_methods }}
@@ -155,12 +155,12 @@ frontend internet_restricted_ip
155155
# frontend restricted ip addresses localhost
156156
# traffic coming back from the dummy backend ends up here
157157
# -------------------------------------------------------------------
158-
frontend localhost_restricted
158+
frontend localhost_restricted
159159
bind 127.0.0.1:82 accept-proxy
160160
acl valid_vhost hdr(host) -f /etc/haproxy/acls/validvhostsrestricted.acl
161161
acl staging req.cook(staging) -m str true
162162
acl staging src -f /etc/haproxy/acls/stagingips.acl
163-
acl stagingvhost hdr(host) -i -M -f /etc/haproxy/maps/backendsstaging.map
163+
acl stagingvhost hdr(host) -i -M -f /etc/haproxy/maps/backendsstaging.map
164164
use_backend %[req.hdr(host),lower,map(/etc/haproxy/maps/backendsstaging.map)] if stagingvhost staging
165165
use_backend %[req.hdr(host),lower,map(/etc/haproxy/maps/backends.map)]
166166
option httplog
@@ -177,7 +177,7 @@ frontend localhost_restricted
177177
# Create an ACL when the request rate exceeds {{ haproxy_max_request_rate }} per 10s
178178
acl exceeds_max_request_rate_per_ip sc_http_req_rate(0) gt {{ haproxy_max_request_rate }}
179179
http-request deny deny_status 429 if exceeds_max_request_rate_per_ip !allowlist
180-
# Measure and log the request rate per path and ip
180+
# Measure and log the request rate per path and ip
181181
http-request track-sc1 base32+src table st_httpreqs_per_ip_and_path
182182
http-request capture sc_http_req_rate(1) len 4
183183
# Some paths allow for a higher ratelimit. These are in a seperate mapfile
@@ -191,7 +191,7 @@ frontend localhost_restricted
191191
http-request deny if ! valid_vhost
192192
# Deny the request when the request rate exceeds {{ haproxy_max_request_rate }} per 10s
193193
http-request deny deny_status 429 if exceeds_max_request_rate_per_ip !allowlist
194-
# Deny the request when the request rate per host header url path and src ip exceeds {{ haproxy_max_request_rate_ip_path }} per 1 m
194+
# Deny the request when the request rate per host header url path and src ip exceeds {{ haproxy_max_request_rate_ip_path }} per 1 m
195195
http-request deny deny_status 429 if exceeds_max_request_rate_per_ip_and_path !allowlist
196196
# Create some http redirects
197197
{% if haproxy_securitytxt_target_url is defined %}

0 commit comments

Comments
 (0)