Skip to content

🐛 Replace cluster-admin with least-privilege RBAC for BoxcutterRuntime#2514

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
perdasilva:rejigger-perms
Feb 18, 2026
Merged

🐛 Replace cluster-admin with least-privilege RBAC for BoxcutterRuntime#2514
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
perdasilva:rejigger-perms

Conversation

@perdasilva
Copy link
Contributor

The operator-controller service account was bound to the cluster-admin ClusterRole when the BoxcutterRuntime feature gate was enabled. Replace this with explicit, scoped RBAC rules in the operator-controller-manager-role ClusterRole:

  • list+watch on all API groups and resources (/), required for the boxcutter runtime to set up informers for arbitrary resource types defined in ClusterExtensionRevision phases
  • Full CRUD (create, get, list, patch, update, watch) on clusterextensionrevisions
  • patch+update on clusterextensionrevisions/status
  • update on clusterextensionrevisions/finalizers

The ClusterRoleBinding now always references operator-controller-manager-role regardless of whether BoxcutterRuntime is enabled, removing the conditional cluster-admin binding. Static manifests (experimental.yaml and experimental-e2e.yaml) are updated to match.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

The operator-controller service account was bound to the cluster-admin
ClusterRole when the BoxcutterRuntime feature gate was enabled. Replace
this with explicit, scoped RBAC rules in the operator-controller-manager-role
ClusterRole:

- list+watch on all API groups and resources (*/*), required for the
  boxcutter runtime to set up informers for arbitrary resource types
  defined in ClusterExtensionRevision phases
- Full CRUD (create, get, list, patch, update, watch) on
  clusterextensionrevisions
- patch+update on clusterextensionrevisions/status
- update on clusterextensionrevisions/finalizers

The ClusterRoleBinding now always references operator-controller-manager-role
regardless of whether BoxcutterRuntime is enabled, removing the conditional
cluster-admin binding. Static manifests (experimental.yaml and
experimental-e2e.yaml) are updated to match.

Signed-off-by: Per G. da Silva <pegoncal@redhat.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 18, 2026 15:41
@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 778644c
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6995ddae97ba410008b087a5
😎 Deploy Preview https://deploy-preview-2514--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the cluster-admin ClusterRole binding with least-privilege RBAC permissions for the operator-controller when the BoxcutterRuntime feature gate is enabled, improving security by limiting permissions to only what is necessary.

Changes:

  • Added explicit RBAC rules for list/watch on all resources, full CRUD on clusterextensionrevisions, and update permissions on status/finalizers subresources
  • Removed conditional cluster-admin binding in favor of always using operator-controller-manager-role
  • Updated static manifests (experimental.yaml and experimental-e2e.yaml) to reflect the new RBAC configuration

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
manifests/experimental.yaml Added new RBAC rules and changed ClusterRoleBinding from cluster-admin to operator-controller-manager-role
manifests/experimental-e2e.yaml Applied same RBAC changes as experimental.yaml for e2e testing environment
helm/olmv1/templates/rbac/clusterrolebinding-operator-controller-manager-rolebinding.yml Removed conditional logic that bound cluster-admin when BoxcutterRuntime was enabled
helm/olmv1/templates/rbac/clusterrole-operator-controller-manager-role.yml Added BoxcutterRuntime-specific RBAC rules when feature gate is enabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.15%. Comparing base (130c987) to head (778644c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2514      +/-   ##
==========================================
- Coverage   73.21%   73.15%   -0.06%     
==========================================
  Files         102      102              
  Lines        8505     8505              
==========================================
- Hits         6227     6222       -5     
- Misses       1802     1805       +3     
- Partials      476      478       +2     
Flag Coverage Δ
e2e 45.86% <ø> (-0.06%) ⬇️
experimental-e2e 53.27% <ø> (-0.13%) ⬇️
unit 57.89% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@camilamacedo86 camilamacedo86 changed the title 🐛 Replace cluster-admin with least-privilege RBAC for BoxcutterRuntime 🐛 Replace cluster-admin with least-privilege RBAC for BoxcutterRuntime Feb 18, 2026
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 18, 2026
@camilamacedo86
Copy link
Contributor

/lgtm cancel

for another person be able to do that

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2026
Copy link
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, rashmigottipati

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@grokspawn
Copy link
Contributor

/override upgrade-ex2ex-e2e
we expect this to fail, as we're making changes to how privileges are granted

@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

@grokspawn: Overrode contexts on behalf of grokspawn: upgrade-ex2ex-e2e

Details

In response to this:

/override upgrade-ex2ex-e2e
we expect this to fail, as we're making changes to how privileges are granted

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.

@grokspawn grokspawn closed this Feb 18, 2026
@grokspawn grokspawn reopened this Feb 18, 2026
@grokspawn
Copy link
Contributor

/override project

@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

@grokspawn: /override requires failed status contexts, check run or a prowjob name to operate on.
The following unknown contexts/checkruns were given:

  • project

Only the following failed contexts/checkruns were expected:

  • Agent
  • Autovalidate
  • CodeQL analysis
  • Upload results
  • Verify PR title
  • codecov/project
  • crd-diff
  • e2e
  • experimental-e2e
  • extension-developer-e2e
  • go-apidiff
  • go-verdiff
  • goreleaser
  • lint
  • netlify/olmv1/deploy-preview
  • st2ex-e2e
  • tide
  • unit-test-basic
  • upgrade-st2st-e2e
  • verify

If you are trying to override a checkrun that has a space in it, you must put a double quote on the context.

Details

In response to this:

/override project

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.

@grokspawn
Copy link
Contributor

/override codecov/project

@openshift-ci
Copy link

openshift-ci bot commented Feb 18, 2026

@grokspawn: Overrode contexts on behalf of grokspawn: codecov/project

Details

In response to this:

/override codecov/project

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.

@tmshort
Copy link
Contributor

tmshort commented Feb 18, 2026

Note the failure is in the upgrade experimental-to-experimental...

The ClusterRoleBinding "operator-controller-manager-admin-rolebinding" is invalid: roleRef: Invalid value: {"APIGroup":"rbac.authorization.k8s.io","Kind":"ClusterRole","Name":"operator-controller-manager-role"}: cannot change roleRef

This should be ok, as it shouldn't impact existing installs.

@openshift-merge-bot openshift-merge-bot bot merged commit fb28936 into operator-framework:main Feb 18, 2026
56 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments