OCPBUGS-115749: Tighten operator RBAC to least privilege #1639
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 279 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1639"
general
weight: 0.35
jmencak
Remove over-broad rules from the operator ClusterRole that are not exercised by the code, moving namespace-scoped permissions to namespaced Roles:
- move daemonset and events access to a namespaced Role in openshift-cluster-node-tuning-operator
- move leases to the same namespaced Role, dropping the unused "patch" verb. The client-go lease lock only creates/gets/updates.
- drop the configmaps rule entirely. The MachineConfig ConfigMaps are managed through the management cluster identity in HyperShift, and the metrics client CA bundle is read from kube-system through its own read-only Role.
- add a read-only Role/RoleBinding in kube-system for the metrics client CA bundle
- add a Role/RoleBinding in the "default" namespace granting only create/patch on events as events for cluster-scoped objects are recorded in "default" namespace
- restrict securitycontextconstraints "use" to "restricted-v3", the SCC of the operator pod itself. The tuned DaemonSet pods remain "privileged" via the tuned ServiceAccount.
- narrow performance.openshift.io to performanceprofiles (+status/finalizers)
- drop the unused operators.coreos.com rule -- leftover from the PAO OLM-based deployment
Delete the unused clients.Core clientset, a leftover of the ConfigMap-based leader election that the controller-runtime lease lock replaced; its stale comment is what justified keeping the configmaps grant.
Add an e2e "security" suite (wired into the test-e2e target) that verifies the tightening.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
- Restricted SCC usage to
restricted-v3and narrowed permissions for performance resources and cluster-wide operations.- Added namespace-specific permissions for daemonset, event, leader-election, and metrics configuration tasks, including read-only access to metrics configuration.
- Added checks that verify unauthorized cross-namespace access and privileged actions are denied.
- Added end-to-end RBAC security coverage for the operator.
- Included the security suite in the end-to-end test target.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->