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

Skip to content

Bump minimum TLS protocol to TLSv1.2#1392

Merged
srenatus merged 1 commit into
dexidp:masterfrom
stevendanna:tls-configuration
Jan 29, 2019
Merged

Bump minimum TLS protocol to TLSv1.2#1392
srenatus merged 1 commit into
dexidp:masterfrom
stevendanna:tls-configuration

Conversation

@stevendanna
Copy link
Copy Markdown
Contributor

Some environments are subject to strict rules about the permitted TLS
protocol verion and available ciphers. This change makes the former
configurable for both HTTPS and gRPC.

The gRPC protocol rejects anything under TLSv1.2; however, it is still
useful to configure the tls protocol version explicitly because many
automated scanners do not recognize gRPC.

Signed-off-by: Steven Danna [email protected]

Comment thread cmd/dex/serve.go Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appeared to be the case in the existing code so I've kept it in place; however, I wasn't sure whether it was intentional or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Interesting. Might be a useful follow-up PR to move that out of this if branch. Unless someone remembers the rationale for this...

@ericchiang
Copy link
Copy Markdown
Contributor

Instead of making this configurable, I'm fine enforcing TLS 1.2 and up

@stevendanna
Copy link
Copy Markdown
Contributor Author

Instead of making this configurable, I'm fine enforcing TLS 1.2 and up

That would also meet my personal needs. Happy to modify this PR to do that if y'all are OK with the reduced client compatibility.

@ericchiang
Copy link
Copy Markdown
Contributor

https://www.zdnet.com/article/chrome-edge-ie-firefox-and-safari-to-disable-tls-1-0-and-tls-1-1-in-2020/

TLS 1.0 and 1.1 are being phased out. I don't feel that dex needs to support them, particularly for any protocol like gRPC. Backend LDAP servers might be the one exception here, since some of that tech tends to be older.

Let's enforce TLS 1.2 for now.

@stevendanna stevendanna changed the title Make minimum TLS protocol version configurable Bump minimum TLS protocol to TLSv1.2 Jan 26, 2019
@stevendanna
Copy link
Copy Markdown
Contributor Author

👍 I've pushed a commit that bumps the minimum to TLSv1.2 and removes the configurability.

@ericchiang
Copy link
Copy Markdown
Contributor

There's a pretty big diff here. I'd only expect the tls.Config to change.

@stevendanna
Copy link
Copy Markdown
Contributor Author

There's a pretty big diff here. I'd only expect the tls.Config to change.

Most of the changes are moving code around such that I could make sure we are using the tls.Config without too much duplication across different code branches. In the old code, when not using a ClientCA we didn't generate our own tls.Config.

https://github.com/dexidp/dex/blob/master/cmd/dex/serve.go#L147

The majority of the diff is a result of changing it so that we are using a tls.Config in that case.

If you'd prefer, I can make the diff smaller, the result will just be an opportunity for the tls.Config to drift between those two branches.

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. 🎈 (🔔 we're coworkers)

Comment thread cmd/dex/serve.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a decent streamlining of the TLS config to me. Instead of using credentials.NewServerTLSFromFile for one path (without the client CA cert) and credentials.NewTLS for the other (where we do have the client CA cert), we now only do the latter; and handle the client CA as part of what's passed to NewTLS. 👍

Comment thread cmd/dex/serve.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Interesting. Might be a useful follow-up PR to move that out of this if branch. Unless someone remembers the rationale for this...

…ites

Some environments are subject to strict rules about the permitted TLS
protocol verion and available ciphers. Setting TLSv1.2 as the minimum
version ensures we do not use weaker protocols. We've opted against
making this configurable given the age of TLSv1.2 and the increasing
push to deprecate TLSv1.1 and older.

The PreferServerCipherSuites setting is also commonly flagged by SSL
quality scanning tools. Since Go provides a relatively modern set of
default ciphers by default, defaulting this to true is unlikely to
make much practical difference.

Signed-off-by: Steven Danna <[email protected]>
@srenatus
Copy link
Copy Markdown
Contributor

Thank you! I'll merge this. A potential follow-up would be to have gRPC and HTTPS share a *tls.Config -- at least in our deployment, external (HTTP) clients talk to a reverse proxy anyways, which allows connection with no client cert; but internal comms (including the proxy -> dex) need mutual TLS. With that change, we could enforce that only authenticated clients (i.e., the proxy) talk to dex's HTTPS endpoint. But anyways, that's just a potential follow-up. 😄

@srenatus srenatus merged commit 81f1558 into dexidp:master Jan 29, 2019
mmrath pushed a commit to mmrath/dex that referenced this pull request Sep 2, 2019
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.

3 participants