Add new oidc subtype for Kubernetes joining#57538
Merged
timothyb89 merged 15 commits intomasterfrom Aug 7, 2025
Merged
Conversation
This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly.
Contributor
|
Amplify deployment status
|
strideynet
reviewed
Aug 6, 2025
strideynet
approved these changes
Aug 6, 2025
ptgott
approved these changes
Aug 6, 2025
Contributor
|
@timothyb89 See the table below for backport results.
|
timothyb89
added a commit
that referenced
this pull request
Aug 7, 2025
* MWI: Add `oidc` subtype for Kubernetes joining This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly. * Validate OIDC subtype properly * Initialize OIDC validator at startup * Fix OIDC claims implementation * Force use of cluster name as audience * Remove authorized party workaround * Reintroduce kubernetes claims check * Remove unused constant * Update generated operator resources * Update generated TF docs * Add validator tests * Improve proto docs, enforce HTTP issuers, and add insecure override * Update autogenerated docs
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 8, 2025
* MWI: Add `oidc` subtype for Kubernetes joining This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly. * Validate OIDC subtype properly * Initialize OIDC validator at startup * Fix OIDC claims implementation * Force use of cluster name as audience * Remove authorized party workaround * Reintroduce kubernetes claims check * Remove unused constant * Update generated operator resources * Update generated TF docs * Add validator tests * Improve proto docs, enforce HTTP issuers, and add insecure override * Update autogenerated docs
timothyb89
added a commit
that referenced
this pull request
Aug 12, 2025
* MWI: Add `oidc` subtype for Kubernetes joining This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly. * Validate OIDC subtype properly * Initialize OIDC validator at startup * Fix OIDC claims implementation * Force use of cluster name as audience * Remove authorized party workaround * Reintroduce kubernetes claims check * Remove unused constant * Update generated operator resources * Update generated TF docs * Add validator tests * Improve proto docs, enforce HTTP issuers, and add insecure override * Update autogenerated docs
This was referenced Aug 12, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Aug 22, 2025
* [v18] Add new `oidc` subtype for Kubernetes joining (#57538) (#57683) * MWI: Add `oidc` subtype for Kubernetes joining This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly. * Validate OIDC subtype properly * Initialize OIDC validator at startup * Fix OIDC claims implementation * Force use of cluster name as audience * Remove authorized party workaround * Reintroduce kubernetes claims check * Remove unused constant * Update generated operator resources * Update generated TF docs * Add validator tests * Improve proto docs, enforce HTTP issuers, and add insecure override * Update autogenerated docs * Partially backport OIDC changes to fix build, include #57789 This partially backports various dependencies of the original change. Note that this is not a clean backport, and minor code and organizational changes were made to facilitate this backport, including copying some OIDC code directly into the token validator. Additionally, caching support from #57789 was integrated directly. It inherently depends on the same OIDC code that required modification, so it has been pulled in directly. * Remove caching support from the backport I've abandoned the caching approach in #57789, so this PR will proceed without caching, as in branch/v18.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a new
oidcsubtype for the Kubernetes join method. This differs fromstatic_jwksin that it fetches the/.well-known/openid-configurationendpoint at the issuer and subsequently fetches the JWKS keys from the configured URL. This works around a common issue withstatic_jwkson providers like EKS that rotate keys frequently, since we'll fetch the key set as needed.Note that caching (#49213) was deferred for now but as it reuses our existing OIDC machinery, it should be trivial to swap in a caching HTTP client in a follow-up PR.
changelog: Add new
oidcjoining mode for Kubernetes delegated joining to support providers that can be configured to provide public OIDC endpoints, like EKS, AKS, and GKE.Fixes #39170
To use, you'll need a Kubernetes cluster that issues OIDC tokens from an issuer with a public OpenID-compatible endpoint, like Amazon EKS. To check and resolve the right issuer value, run this command:
This attempts to resolve the issuer from your local machine; providers like EKS will return an OIDC config pointing to internal URLs when used on an internal network. If your provider's OIDC endpoint isn't available, the
curlcall will fail, in which case this method won't work.Once you've determined the issuer, create a join token:
You'll need to configure your Kubernetes pod to project a token with the Teleport cluster name as the configured audience, in this case we'll assume
example.teleport.sh.To project an additional token, add this to your pod spec:
When joining a client (Teleport agent,
tbot, etc) make sureKUBERNETES_TOKEN_PATHis set to the token in the projected mount path, e.g./var/run/secrets/teleport-token/token.