Allow directly-configured Kubernetes issuers to use in-cluster auth path#2356
Merged
Merged
Conversation
Gate the in-cluster CA + bearer-token attachment in httpClientForIssuer on the issuer being directly listed in OIDCIssuers, in addition to the existing match against k8sIssuerURL. Clusters whose --service-account-issuer is not literally https://kubernetes.default.svc (e.g. K3s, which uses https://kubernetes.default.svc.cluster.local) can again use the in-cluster auth path when their issuer URL is explicitly listed in OIDCIssuers. The SSRF/token-leak protection from sigstore#2354 is preserved: MetaIssuer wildcard matches against attacker-controlled hosts still do not receive the bearer token, because the new gate trusts only directly-listed OIDCIssuers entries (and the default k8sIssuerURL itself). Fixes sigstore#2355. Signed-off-by: Kevin Monroe <kevin.monroe@chainguard.dev>
Hayden-IO
approved these changes
May 29, 2026
Contributor
|
Thanks! I'll cut a new release shortly. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2356 +/- ##
===========================================
- Coverage 57.93% 45.24% -12.70%
===========================================
Files 50 72 +22
Lines 3119 4721 +1602
===========================================
+ Hits 1807 2136 +329
- Misses 1154 2345 +1191
- Partials 158 240 +82 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Restore the in-cluster CA + projected service-account bearer-token auth path for directly configured Kubernetes issuers whose issuer URL is not literally
https://kubernetes.default.svc, while preserving the v1.8.6 SSRF / token-leak protections added in 378c654.This fixes the regression reported in #2355 for deployments such as K3s, where the service-account issuer may be
https://kubernetes.default.svc.cluster.localand is explicitly listed in OIDCIssuers.The existing
TestGetVerifier_MetaIssuerK8sTokenNotLeakedcontinues to pass, and a newTestGetVerifier_DirectConfiguredK8sIssuerGetsTokencovers the K3s case.Closes #2355
Release Note
https://kubernetes.default.svc.cluster.local) no longer received the in-cluster CA and service-account bearer token during OIDC discovery.Documentation
NONE