-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Fix overlapping client CA and requestheader CA validation with proper certificate checking #131411
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
base: master
Are you sure you want to change the base?
Fix overlapping client CA and requestheader CA validation with proper certificate checking #131411
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Apr 23 01:34:47 UTC 2025. |
Hi @ballista01. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/sig security |
/remove-sig api-machinery |
/ok-to-test |
#119267 (comment) |
/triage accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one suggestion on the error message, and squash to a single commit, then lgtm
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ballista01 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e38e237
to
84488c9
Compare
/retest |
@@ -55,8 +56,12 @@ import ( | ||
) | ||
|
||
func TestAuthenticationValidate(t *testing.T) { | ||
testDataDir := filepath.Join("testdata") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this variable and use "testdata" directly below. Linting is complaining about this bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
… certificate checking fix error message fix lint
84488c9
to
03357ed
Compare
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR introduces a validation check at server startup for the Kubernetes API server configuration. It ensures that when
--client-ca-file
and--requestheader-client-ca-file
refer to CA bundles that share any certificate, and--requestheader-allowed-names
is not set, then the API server will abort startup with an error.This closes a privilege escalation risk where any client with a certificate issued by the shared CA can spoof identities via the request header authentication approach, based on Kubernetes Security Audit Finding NCC-E003660-F9W.
Which issue(s) this PR fixes:
Fixes #119267
Special notes for your reviewer:
client-go/util/cert.CertsFromFile()
andx509.Certificate.Equal()
.staging/src/k8s.io/kube-aggregator/pkg/apiserver/testdata
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: