-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
Add Config::tls_server_name
and validate when using rustls
#1104
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
kazk
reviewed
Dec 14, 2022
kazk
approved these changes
Dec 14, 2022
Signed-off-by: clux <sszynrae@gmail.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1104 +/- ##
==========================================
- Coverage 72.50% 72.50% -0.01%
==========================================
Files 65 65
Lines 4845 4848 +3
==========================================
+ Hits 3513 3515 +2
- Misses 1332 1333 +1
|
kazk
approved these changes
Dec 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changelog-change
changelog change category for prs
config
Kube config related
rustls
rustls-tls related
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Functionally equivalent to #1054 which it replaces due to lack of DCO. Main differences:
tls_server_name
inside theConfigExt
(left toConfig
to set)Exposes
Config::tls_server_name
optionGets it primarily from
Kubeconfig
when it exists and it's picked up by theConfigExt
method (only rustls does this).In theory this can also be done for openssl, but with
hyper-openssl
is significantly more involved than rustls.(AFAICT; You can
configure
theSslConnector
, which lets you set thedomain
usinginto_ssl
, but don't seem to have the same equivalent for theSslConnectorBuilder
where we only have an some possible callbacks). This was ultimately not needed for to validate it with rustls where the problem is actually pressing.Changes
Config::incluster
behaviour for rustlsStops using the deprecated
_dns
variant and instead uses_env
like openssl. This works once we start setting the server name (and we default to thekubernetes.default.svc
url). Upstream PR #1054 has the explaination for why this is less strict than the current behaviour and should be better. Users have already reported the original PR fixing certain teleport cases on discord. Tested this with a couple of clusters myself using rustls and it seems to work.Feature-based opt-in
The opt-in mechanism is done when only the
rustls-tls
feature is set. If/whenrustls
it gains the ability to validate IPs then we can remove the hack and haveConfig::incluster
be the same across stacks. If bothopenssl
andrustls
are enabled then the hack is not added due to how we currently pick openssl as the tls stack in theClient
.