Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use a more conservative set of CipherSuites#1540

Merged
JoelSpeed merged 1 commit into
dexidp:masterfrom
stevendanna:ssd/cipher-suites
Sep 2, 2019
Merged

Use a more conservative set of CipherSuites#1540
JoelSpeed merged 1 commit into
dexidp:masterfrom
stevendanna:ssd/cipher-suites

Conversation

@stevendanna
Copy link
Copy Markdown
Contributor

@stevendanna stevendanna commented Aug 31, 2019

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]

@stevendanna
Copy link
Copy Markdown
Contributor Author

I can make the CipherSuites configurable if that is preferred. I held off since y'all preferred avoiding configuration for the TLS protocol version.

Copy link
Copy Markdown
Contributor

@srenatus srenatus left a 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]>
@srenatus
Copy link
Copy Markdown
Contributor

@bonifaido @JoelSpeed: Since @stevendanna and I are coworkers, could one of you please review this, too? 😉

@JoelSpeed
Copy link
Copy Markdown
Contributor

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?

@srenatus
Copy link
Copy Markdown
Contributor

srenatus commented Sep 1, 2019

Making this stricter will likely block some people from upgrading their Dex in the future

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 😉

@bonifaido
Copy link
Copy Markdown
Member

I also think that - since the GRPC interface is updated only - that making this configurable is not mandatory.

Copy link
Copy Markdown
Contributor

@JoelSpeed JoelSpeed left a 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 😉

@JoelSpeed JoelSpeed merged commit 179cce3 into dexidp:master Sep 2, 2019
@stevendanna
Copy link
Copy Markdown
Contributor Author

I also think that - since the GRPC interface is updated only - that making this configurable is not mandatory.

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.

@JoelSpeed
Copy link
Copy Markdown
Contributor

I believe this modifies the HTTPS listener as well, no?

I think you're right

Happy to put together a PR to make this configurable if that changes y'alls mind.

Let's wait until someone complains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants