-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not serve certificate content for Non-SSL routes #14621
Conversation
@rajatchopra @knobunc First part, haproxy-template.conf change. PTAL |
@knobunc @rajatchopra @JacobTanenbaum Added command option PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it looks great. Thanks.
@@ -204,7 +204,7 @@ backend be_sni | |||
|
|||
frontend fe_sni | |||
# terminate ssl on edge | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 {{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 {{ if matchPattern "true|TRUE" (env "ROUTER_STRICT_SNI" "") -}} strict-sni {{ end }}{{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks right to me, but I'd like to see some whitespace so I can follow what we are doing a little more clearly:
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3
{{- if matchPattern "true|TRUE" (env "ROUTER_STRICT_SNI" "") }} strict-sni {{ end }}
{{- if gt (len .DefaultCertificate) 0 }} crt {{.DefaultCertificate}} {{ else }} crt /var/lib/haproxy/conf/default_pub_keys.pem {{ end }}
{{- ""}} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy
@openshift/networking PTAL |
@knobunc PTAL |
@@ -44,6 +44,8 @@ os::cmd::expect_failure_and_text 'oadm router --dry-run --host-network=false --h | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --max-connections=14583 -o yaml' '14583' | |||
# ciphers | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --ciphers=modern -o yaml' 'modern' | |||
# strict-sni | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --strict-sni -o yaml' 'ROUTER_STRICT_SNI' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check sufficient? You always set the variable, but to true or false as appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should check the value
@@ -204,7 +204,10 @@ backend be_sni | |||
|
|||
frontend fe_sni | |||
# terminate ssl on edge | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 {{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 | |||
{{- if matchPattern "true|TRUE" (env "ROUTER_STRICT_SNI" "") }} strict-sni {{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this end up putting 'strict-sni' on the same line as 'bind 127.0.0.1'? (Assuming {{-' only removes leading spaces)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -204,7 +204,10 @@ backend be_sni | |||
|
|||
frontend fe_sni | |||
# terminate ssl on edge | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 {{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy | |||
bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 | |||
{{- if matchPattern "true|TRUE" (env "ROUTER_STRICT_SNI" "") }} strict-sni {{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this collapse on the previous line? not sure how the white-space collapse works.
All else looks good.
[test] |
@pecameron Can you split this change into 2 commits. One commit for the actual change and another commit for the auto generated stuff that way it will be cleaner. |
@pravisankar is that safe? Won't one commit fail tests because the autogen stuff isn't current? Thus it will break bisect? Or are you asking that we do it for the PR only and then squash before it is merged? |
By default, when a host does not resolve to a route in a HTTPS or tls sni request, the default cert is returned to the caller as part of the 503 response. This exposes the default cert and may pose security concerns. Haproxy strict-sni option to bind suppresses use of the default cert. This adds a new environment variable to the router deployment controller, ROUTER_STRICT_SNI, to control bind processing. When set to "true" or "TRUE", "strict-sni" is added to the bind. Default is "false". oc adm router --strict-sni sets ROUTER_STRICT_SNI="true" bug 1369865 https://bugzilla.redhat.com/show_bug.cgi?id=1369865
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we setting this on the cli and with an environment variable?
@@ -44,6 +44,8 @@ os::cmd::expect_failure_and_text 'oadm router --dry-run --host-network=false --h | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --max-connections=14583 -o yaml' '14583' | |||
# ciphers | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --ciphers=modern -o yaml' 'modern' | |||
# strict-sni | |||
os::cmd::expect_success_and_text 'oadm router --dry-run --host-network=false --host-ports=false --strict-sni -o yaml' 'ROUTER_STRICT_SNI' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should check the value
On Wed, Jun 14, 2017 at 12:08 PM, Ben Bennett ***@***.***> wrote:
@pravisankar <https://github.com/pravisankar> is that safe? Won't one
commit fail tests because the autogen stuff isn't current? Thus it will
break bisect? Or are you asking that we do it for the PR only and then
squash before it is merged?
No, it won't break. Test/Merge is performed on the entire changes rebased
on master. This was suggested on my PR long time back and I have seen
others following this convention (just grep for 'generated' in 'git log'
output).
… —
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14621 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABM0hi5NHy090OC9koQanBbPfbTgjJj_ks5sEC-rgaJpZM4N49tj>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[merge][severity: blocker] |
Evaluated for origin test up to e8638ae |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2240/) (Base Commit: 0be6aee) |
Yes it does put strict-sni on the bind line (I verified this)
…On 06/14/2017 02:53 PM, Ravi Sankar Penta wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In images/router/haproxy/conf/haproxy-config.template
<#14621 (comment)>:
> @@ -204,7 +204,10 @@ backend be_sni
frontend fe_sni
# terminate ssl on edge
- bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3 {{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy
+ bind 127.0.0.1:{{env "ROUTER_SERVICE_SNI_PORT" "10444"}} ssl no-sslv3
+ {{- if matchPattern "true|TRUE" (env "ROUTER_STRICT_SNI" "") }} strict-sni {{ end }}
Will this end up putting 'strict-sni' on the same line as 'bind
127.0.0.1'? (Assuming {{-' only removes leading spaces)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14621 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANUgeru4Av6pcb7GkeCejd7DVYmB5mhqks5sECwMgaJpZM4N49tj>.
|
Evaluated for origin merge up to e8638ae |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1017/) (Base Commit: 6d961d6) (PR Branch Commit: e8638ae) (Extended Tests: blocker) (Image: devenv-rhel7_6366) |
Openshift 3.6 By default, when a host does not resolve to a route in a HTTPS or tls sni request, the default cert is returned to the caller as part of the 503 response. This exposes the default cert and may pose security concerns. Haproxy strict-sni option to bind suppresses use of the default cert. This adds a new environment variable to the router deployment controller, ROUTER_STRICT_SNI, to control bind processing. When set to "true" or "TRUE", "strict-sni" is added to the bind. Default is "false". oc adm router --strict-sni sets ROUTER_STRICT_SNI="true" origin PR 14621 openshift/origin#14621 bug 1369865 https://bugzilla.redhat.com/show_bug.cgi?id=1369865
By default, when a host does not resolve to a route in a HTTPS or tls
sni request, the default cert is returned to the caller as part of the
503 response. This exposes the default cert and may pose security
concerns. Haproxy strict-sni option to bind suppresses use of the
default cert.
This adds a new environment variable to the router deployment controller,
ROUTER_STRICT_SNI, to control bind processing. When set to "true" or
"TRUE", "strict-sni" is added to the bind. Default is "false".
oc adm router --strict-sni sets ROUTER_STRICT_SNI="true"
bug 1369865
https://bugzilla.redhat.com/show_bug.cgi?id=1369865