Skip to content

Commit

Permalink
Merge pull request #743 from jcmoraisjr/jm-ssl-verify
Browse files Browse the repository at this point in the history
Improve crt validation with ssl_c_verify
  • Loading branch information
jcmoraisjr authored Feb 27, 2021
2 parents 2c21ccc + a8c679d commit a655064
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 4 additions & 8 deletions pkg/haproxy/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1256,15 +1256,13 @@ func TestInstanceFrontingProxy(t *testing.T) {
acl tls-has-crt ssl_c_used
acl tls-need-crt ssl_fc_sni -i -m str -f /etc/haproxy/maps/_front_tls_needcrt__exact.list
acl tls-host-need-crt var(req.host) -i -m str -f /etc/haproxy/maps/_front_tls_needcrt__exact.list
acl tls-has-invalid-crt ssl_c_ca_err gt 0
acl tls-has-invalid-crt ssl_c_err gt 0
acl tls-has-invalid-crt ssl_c_verify gt 0
acl tls-check-crt ssl_fc_sni -i -m str -f /etc/haproxy/maps/_front_tls_auth__exact.list`
aclFrontRegex = `
acl tls-has-crt ssl_c_used
acl tls-need-crt ssl_fc_sni -i -m reg -f /etc/haproxy/maps/_front_tls_needcrt__regex.list
acl tls-host-need-crt var(req.host) -i -m reg -f /etc/haproxy/maps/_front_tls_needcrt__regex.list
acl tls-has-invalid-crt ssl_c_ca_err gt 0
acl tls-has-invalid-crt ssl_c_err gt 0
acl tls-has-invalid-crt ssl_c_verify gt 0
acl tls-check-crt ssl_fc_sni -i -m reg -f /etc/haproxy/maps/_front_tls_auth__regex.list`
aclBackWithSockID = `
acl fronting-proxy so_id 11
Expand Down Expand Up @@ -2065,8 +2063,7 @@ frontend _front_https
acl tls-need-crt ssl_fc_sni -i -m reg -f /etc/haproxy/maps/_front_tls_needcrt__regex.list
acl tls-host-need-crt var(req.host) -i -m str -f /etc/haproxy/maps/_front_tls_needcrt__exact.list
acl tls-host-need-crt var(req.host) -i -m reg -f /etc/haproxy/maps/_front_tls_needcrt__regex.list
acl tls-has-invalid-crt ssl_c_ca_err gt 0
acl tls-has-invalid-crt ssl_c_err gt 0
acl tls-has-invalid-crt ssl_c_verify gt 0
acl tls-check-crt ssl_fc_sni -i -m str -f /etc/haproxy/maps/_front_tls_auth__exact.list
acl tls-check-crt ssl_fc_sni -i -m reg -f /etc/haproxy/maps/_front_tls_auth__regex.list
http-request set-var(req.snibase) ssl_fc_sni,lower,concat(,req.path)
Expand Down Expand Up @@ -3156,8 +3153,7 @@ frontend _front_https
http-request redirect location %[var(req.rootredir)] if { path / } { var(req.rootredir) -m found }
<<https-headers>>
acl tls-has-crt ssl_c_used
acl tls-has-invalid-crt ssl_c_ca_err gt 0
acl tls-has-invalid-crt ssl_c_err gt 0
acl tls-has-invalid-crt ssl_c_verify gt 0
acl tls-check-crt ssl_fc_sni -i -m reg -f /etc/haproxy/maps/_front_tls_auth__regex.list
http-request set-var(req.snibase) ssl_fc_sni,lower,concat(,req.path)
http-request set-var(req.snibackend) var(req.snibase),map_reg(/etc/haproxy/maps/_front_https_sni__regex.map)
Expand Down
3 changes: 1 addition & 2 deletions rootfs/etc/templates/haproxy/haproxy.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,7 @@ frontend _front_https
{{- range $match := $fmaps.TLSNeedCrtList.MatchFiles }}
acl tls-host-need-crt var(req.host) -i -m {{ $match.Method }} -f {{ $match.Filename }}
{{- end }}
acl tls-has-invalid-crt ssl_c_ca_err gt 0
acl tls-has-invalid-crt ssl_c_err gt 0
acl tls-has-invalid-crt ssl_c_verify gt 0
{{- range $match := $fmaps.TLSAuthList.MatchFiles }}
acl tls-check-crt ssl_fc_sni -i -m {{ $match.Method }} -f {{ $match.Filename }}
{{- end }}
Expand Down

0 comments on commit a655064

Please sign in to comment.