[ROSAENG-963] fix: Prevent customer CREATE of ServiceAccounts in managed namespaces#543
[ROSAENG-963] fix: Prevent customer CREATE of ServiceAccounts in managed namespaces#543xiaoyu74 wants to merge 1 commit into
Conversation
WalkthroughThis PR extends the managed cluster service account validation webhook to intercept and enforce restrictions on both CREATE and DELETE operations, rather than DELETE-only. The implementation updates webhook rules, adds authorization checks for CREATE requests, modifies object decoding logic, includes test coverage, and updates deployment manifests and comprehensive webhook documentation. ChangesService Account Webhook CREATE Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xiaoyu74 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@xiaoyu74: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
/hold - Doing some validation in staging clusters. |
|
/unhold |
Background
DELETEoperations for protected managed namespaces.defaultto exceptionNamespaces so customer-managed ServiceAccounts there remain creatable and deletable. This change preserves that existing behavior.What
Other highlights for reviewers
Validation in Staging
Test env
with this PR
E2E Test
htpasswdIDP to simulate a normal user as customeropenshift-ingress-operatornamespaceValidation on ROSA HCP
make packageand includes both CREATE and DELETE operations for sre-serviceaccount-validation.