[ROSAENG-61300] Tighten certman-operator RBAC to least privilege - #505
[ROSAENG-61300] Tighten certman-operator RBAC to least privilege#505charlesgong wants to merge 2 commits into
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe two ChangesRBAC permission scope
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to The PR narrows certman-operator permissions from cluster-wide wildcards to the documented access needed for secrets and configmaps. No actionable merge-blocking risk remains, so it is merge-ready after normal checks and review. 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ 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: charlesgong 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #505 +/- ##
=======================================
Coverage 57.14% 57.14%
=======================================
Files 29 29
Lines 2170 2170
=======================================
Hits 1240 1240
Misses 812 812
Partials 118 118 🚀 New features to boost your workflow:
|
…maps Drop cluster-wide wildcard verbs on pods/services/endpoints/pvcs/events and apps/* entirely — zero controller usage confirmed by code audit. Replace secrets wildcard with get/create/update (controller only does targeted Get for credentials and Create/Update for TLS cert secrets, never List or Delete). Replace configmaps wildcard with get-only (one specific configmap is read, never written). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sync boilerplate-generated Dockerfile base image update to unblock CI. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
52d8896 to
0487786
Compare
|
/retest |
|
@charlesgong: 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. |
This PR removes cluster-wide wildcard RBAC permissions on core Kubernetes resources from the certman-operator ClusterRole.
What type of PR is this?
bug
What this PR does / why we need it?
Both
deploy/role.yamlanddeploy_pko/ClusterRole-certman-operator.yamlgranted cluster-wide wildcard/full-CRUD access to secrets, configmaps, pods, services, endpoints, PVCs, events, and apps/* resources. A code audit confirmed the controller only needs:secrets: get/create/update (credential reads + TLS cert writes)configmaps: get (one operator configmap + aws-account-operator configmap)A compromised operator pod or projected SA token previously had cluster-wide secret read/write/delete, exposing every Hive-managed cluster kubeconfig and cloud credential on the hub.
Which Jira/Github issue(s) this PR fixes?
Fixes https://issues.redhat.com/browse/ROSAENG-61300
Special notes for your reviewer:
The verb reduction on secrets (
delete,list,patch,watchremoved) is safe — the controller never calls List or Delete on secrets, only targeted Gets and Create/Update for TLS cert secrets. Grepped across all ofpkg/andcontrollers/to confirm.Pre-checks (if applicable):
Summary by CodeRabbit