-
Notifications
You must be signed in to change notification settings - Fork 1.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
Use a more conservative set of CipherSuites #1540
Conversation
I can make the CipherSuites configurable if that is preferred. I held off since y'all preferred avoiding configuration for the TLS protocol version. |
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.
Thank you 🎉 👏
I think not duplicating the internal code is the right call for now.
I wonder if there's anything re-usable, like, the internal code turned into a package, out there. But that shouldn't block this. 😃
The default cipher suites used by Go include a number of ciphers that have known weaknesses. In addition to leaving users open to these weaknesses, the inclusion of these weaker ciphers causes problems with various automated scanning tools. This PR disables the CBC-mode, RC4, and 3DES ciphers included in the Go standard library by passing an explicit cipher suite list. The ciphers included here are more line with those recommended by Mozilla for "Intermediate" compatibility. [0] *Performance Implications* The Go standard library does capability-based cipher ordering, preferring AES ciphers if the underlying hardware has AES specific instructions. [1] Since all of the relevant code is internal modules, to do the same thing ourselves would require duplicating that code. Here, I've placed AES based ciphers first. *Compatibility Implications* This does reduce the number of clients who will be able to communicate with dex. [0] https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=intermediate&hsts=false&ocsp=false [1] https://github.com/golang/go/blob/a8c2e5c6adc0d8f9b976a55bf4e22fcf5770ea55/src/crypto/tls/common.go#L1091 Signed-off-by: Steven Danna <[email protected]>
76013ce
to
46f48b3
Compare
@bonifaido @JoelSpeed: Since @stevendanna and I are coworkers, could one of you please review this, too? 😉 |
Happy with the suggested improvements, only thing I'd potentially do is add this as a configuration option. Making this stricter will likely block some people from upgrading their Dex in the future, if it is possible to allow them to go back to the old ciphers then we wouldn't block them. Though the current suggestion should be the default if we go for that riute What do others think? |
In theory, you have a point -- I don't know about the concrete fallout there, though; are there really such clients? In deployment schemes that would be affected? (Since this only applies to direct connections to dex, and not those reverse proxied by nginx, haproxy etc.) I'm having a difficult time reasoning about this, and I'm also lacking evidence for my sceptical stance 😉 |
I also think that - since the GRPC interface is updated only - that making this configurable is not mandatory. |
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'm having a difficult time reasoning about this, and I'm also lacking evidence for my sceptical stance 😉
I also have no evidence, just suspicion. Let's merge this as is but, I withhold my "I told you so" rights for a future issue that references this change 😉
I believe this modifies the HTTPS listener as well, no? Happy to put together a PR to make this configurable if that changes y'alls mind. |
I think you're right
Let's wait until someone complains |
The default cipher suites used by Go include a number of ciphers that
have known weaknesses. In addition to leaving users open to these
weaknesses, the inclusion of these weaker ciphers causes problems with
various automated scanning tools.
This PR disables the CBC-mode, RC4, and 3DES ciphers included in the
Go standard library by passing an explicit cipher suite list.
The ciphers included here are more line with those recommended by
Mozilla for "Intermediate" compatibility. [0]
Performance Implications
The Go standard library does capability-based cipher ordering,
preferring AES ciphers if the underlying hardware has AES specific
instructions. [1] Since all of the relevant code is internal modules,
to do the same thing ourselves would require duplicating that
code. Here, I've placed AES based ciphers first.
Compatibility Implications
This does reduce the number of clients who will be able to communicate
with dex.
[0] https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=intermediate&hsts=false&ocsp=false
[1] https://github.com/golang/go/blob/a8c2e5c6adc0d8f9b976a55bf4e22fcf5770ea55/src/crypto/tls/common.go#L1091
Signed-off-by: Steven Danna [email protected]