Skip to content

Commit fb28936

Browse files
perdasilvaPer G. da Silvaclaude
authored
Replace cluster-admin with least-privilege RBAC for BoxcutterRuntime (#2514)
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. Co-authored-by: Per G. da Silva <pegoncal@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 130c987 commit fb28936

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

helm/olmv1/templates/rbac/clusterrole-operator-controller-manager-role.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,37 @@ rules:
7272
verbs:
7373
- use
7474
{{- end }}
75+
{{- if has "BoxcutterRuntime" .Values.options.operatorController.features.enabled }}
76+
- apiGroups:
77+
- "*"
78+
resources:
79+
- "*"
80+
verbs:
81+
- list
82+
- watch
83+
- apiGroups:
84+
- olm.operatorframework.io
85+
resources:
86+
- clusterextensionrevisions
87+
verbs:
88+
- create
89+
- get
90+
- list
91+
- patch
92+
- update
93+
- watch
94+
- apiGroups:
95+
- olm.operatorframework.io
96+
resources:
97+
- clusterextensionrevisions/status
98+
verbs:
99+
- patch
100+
- update
101+
- apiGroups:
102+
- olm.operatorframework.io
103+
resources:
104+
- clusterextensionrevisions/finalizers
105+
verbs:
106+
- update
107+
{{- end }}
75108
{{- end }}

helm/olmv1/templates/rbac/clusterrolebinding-operator-controller-manager-rolebinding.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ metadata:
1616
roleRef:
1717
apiGroup: rbac.authorization.k8s.io
1818
kind: ClusterRole
19-
{{- if has "BoxcutterRuntime" .Values.options.operatorController.features.enabled }}
20-
name: cluster-admin
21-
{{- else }}
2219
name: operator-controller-manager-role
23-
{{- end }}
2420
subjects:
2521
- kind: ServiceAccount
2622
name: operator-controller-controller-manager

manifests/experimental-e2e.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,37 @@ rules:
18241824
verbs:
18251825
- list
18261826
- watch
1827+
- apiGroups:
1828+
- "*"
1829+
resources:
1830+
- "*"
1831+
verbs:
1832+
- list
1833+
- watch
1834+
- apiGroups:
1835+
- olm.operatorframework.io
1836+
resources:
1837+
- clusterextensionrevisions
1838+
verbs:
1839+
- create
1840+
- get
1841+
- list
1842+
- patch
1843+
- update
1844+
- watch
1845+
- apiGroups:
1846+
- olm.operatorframework.io
1847+
resources:
1848+
- clusterextensionrevisions/status
1849+
verbs:
1850+
- patch
1851+
- update
1852+
- apiGroups:
1853+
- olm.operatorframework.io
1854+
resources:
1855+
- clusterextensionrevisions/finalizers
1856+
verbs:
1857+
- update
18271858
---
18281859
# Source: olmv1/templates/rbac/clusterrolebinding-catalogd-manager-rolebinding.yml
18291860
apiVersion: rbac.authorization.k8s.io/v1
@@ -1895,7 +1926,7 @@ metadata:
18951926
roleRef:
18961927
apiGroup: rbac.authorization.k8s.io
18971928
kind: ClusterRole
1898-
name: cluster-admin
1929+
name: operator-controller-manager-role
18991930
subjects:
19001931
- kind: ServiceAccount
19011932
name: operator-controller-controller-manager

manifests/experimental.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,37 @@ rules:
17851785
verbs:
17861786
- list
17871787
- watch
1788+
- apiGroups:
1789+
- "*"
1790+
resources:
1791+
- "*"
1792+
verbs:
1793+
- list
1794+
- watch
1795+
- apiGroups:
1796+
- olm.operatorframework.io
1797+
resources:
1798+
- clusterextensionrevisions
1799+
verbs:
1800+
- create
1801+
- get
1802+
- list
1803+
- patch
1804+
- update
1805+
- watch
1806+
- apiGroups:
1807+
- olm.operatorframework.io
1808+
resources:
1809+
- clusterextensionrevisions/status
1810+
verbs:
1811+
- patch
1812+
- update
1813+
- apiGroups:
1814+
- olm.operatorframework.io
1815+
resources:
1816+
- clusterextensionrevisions/finalizers
1817+
verbs:
1818+
- update
17881819
---
17891820
# Source: olmv1/templates/rbac/clusterrolebinding-catalogd-manager-rolebinding.yml
17901821
apiVersion: rbac.authorization.k8s.io/v1
@@ -1856,7 +1887,7 @@ metadata:
18561887
roleRef:
18571888
apiGroup: rbac.authorization.k8s.io
18581889
kind: ClusterRole
1859-
name: cluster-admin
1890+
name: operator-controller-manager-role
18601891
subjects:
18611892
- kind: ServiceAccount
18621893
name: operator-controller-controller-manager

0 commit comments

Comments
 (0)