Skip to content
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

feat: add TLS versions configuration #3303

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

tuminoid
Copy link
Contributor

Overview

Add configuration options for TLSMinVersion and TLSMaxVersion.

This enables configuring specific TLS versions to accept. That allows use-cases such as setting TLS 1.3 as minimum version (disables TLS 1.2), or enforcing TLS 1.2 only (disables TLS 1.3) for easier debugging of secure connections.

Default functionality of Go TLS is to allow TLS 1.2 and TLS 1.3 and have client and server negotiate. (Except in Dex 2.37.0 where TLS 1.0 to TLS 1.3 were always enabled).

serve.go doesn't have any unit tests, so didn't add any. Unit tests are added for config.go.

Special notes for your reviewer

This can be tested with sslyze for example:

  1. Generate certs cd examples/k8s; ./gencert.sh
  2. cp config.dev.yaml config.yaml
  3. Add following under web:
  https: 127.0.0.1:5554
  tlsCert: examples/k8s/ssl/cert.pem
  tlsKey: examples/k8s/ssl/key.pem
  tlsMinVersion: 1.3
  tlsMaxVersion: 1.3
  1. Run dex
gh pr checkout <PR number>
rm -f bin/dex; make; bin/dex serve config.yaml
  1. pip3 install sslyze (use virtualenv etc as needed)
  2. sslyze 127.0.0.1:5554 or use openssl if you like
  3. Check the report and see TLS 1.3 is the only one enabled, TLS 1.2 is refused

Add configuration options for TLSMinVersion and TLSMaxVersion.
This enables setting TLS 1.3 as minimum version for example for both
GRPC and Web, or enforcing TLS 1.2 only for easier debugging of
secure connections.

Signed-off-by: Tuomo Tanskanen <[email protected]>
@tuminoid
Copy link
Contributor Author

@nabokihms @sagikazarmark PTAL. It would be awesome to get this into 2.38.0.

@sagikazarmark sagikazarmark merged commit 9451d87 into dexidp:master Jan 25, 2024
9 of 10 checks passed
@tuminoid tuminoid deleted the tuomo/add-tls-version-config branch January 25, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants