Skip to content

Commit 73097e3

Browse files
committed
[SPARK-57942] Replace wildcard RBAC verbs with explicit verb list in Helm chart
### What changes were proposed in this pull request? This PR aims to replace the wildcard `verbs: ['*']` in the Helm chart RBAC rules (`operator-rbac.yaml` and `workload-rbac.yaml`) with the explicit verb list `get, list, watch, create, update, patch, delete`. ### Why are the changes needed? This addresses CIS Kubernetes Benchmark 5.1.3 (minimize wildcard use in Roles and ClusterRoles). The operator uses informers (`get`/`list`/`watch`), server-side apply (`create`/`patch`), status updates and sentinel replacement (`update`), and resource cleanup (`delete`). Unused verbs such as `deletecollection` are no longer granted. ### Does this PR introduce _any_ user-facing change? Yes. The generated (Cluster)Roles enumerate verbs explicitly instead of `*`; permissions such as `deletecollection` are no longer granted. No operator behavior change is expected. ### How was this patch tested? Pass the CIs. Also manually verified with `helm lint --strict` and `helm template` (default values and all conditional branches). ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Fable 5 Closes #744 from dongjoon-hyun/SPARK-57942. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 parent d7151c0 commit 73097e3

2 files changed

Lines changed: 70 additions & 10 deletions

File tree

build-tools/helm/spark-kubernetes-operator/templates/operator-rbac.yaml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,87 @@ rules:
2727
- persistentvolumeclaims
2828
- events
2929
verbs:
30-
- '*'
30+
- get
31+
- list
32+
- watch
33+
- create
34+
- update
35+
- patch
36+
- delete
3137
- apiGroups:
3238
- "apps"
3339
resources:
3440
- statefulsets
3541
verbs:
36-
- '*'
42+
- get
43+
- list
44+
- watch
45+
- create
46+
- update
47+
- patch
48+
- delete
3749
- apiGroups:
3850
- "autoscaling"
3951
resources:
4052
- horizontalpodautoscalers
4153
verbs:
42-
- '*'
54+
- get
55+
- list
56+
- watch
57+
- create
58+
- update
59+
- patch
60+
- delete
4361
- apiGroups:
4462
- "spark.apache.org"
4563
resources:
4664
- '*'
4765
verbs:
48-
- '*'
66+
- get
67+
- list
68+
- watch
69+
- create
70+
- update
71+
- patch
72+
- delete
4973
- apiGroups:
5074
- "networking.k8s.io"
5175
resources:
5276
- ingresses
5377
- networkpolicies
5478
verbs:
55-
- '*'
79+
- get
80+
- list
81+
- watch
82+
- create
83+
- update
84+
- patch
85+
- delete
5686
- apiGroups:
5787
- "policy"
5888
resources:
5989
- poddisruptionbudgets
6090
verbs:
61-
- '*'
91+
- get
92+
- list
93+
- watch
94+
- create
95+
- update
96+
- patch
97+
- delete
6298
{{- if gt (int .Values.operatorDeployment.replicas) 1 }}
6399
- apiGroups:
64100
- "coordination.k8s.io"
65101
resources:
66102
- leases
67103
verbs:
68-
- '*'
104+
- get
105+
- list
106+
- watch
107+
- create
108+
- update
109+
- patch
110+
- delete
69111
{{- end }}
70112
{{- end }}
71113

@@ -131,7 +173,13 @@ rules:
131173
resources:
132174
- configmaps
133175
verbs:
134-
- '*'
176+
- get
177+
- list
178+
- watch
179+
- create
180+
- update
181+
- patch
182+
- delete
135183
---
136184
apiVersion: rbac.authorization.k8s.io/v1
137185
kind: RoleBinding

build-tools/helm/spark-kubernetes-operator/templates/workload-rbac.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,25 @@ rules:
2626
- configmaps
2727
- persistentvolumeclaims
2828
verbs:
29-
- '*'
29+
- get
30+
- list
31+
- watch
32+
- create
33+
- update
34+
- patch
35+
- delete
3036
- apiGroups:
3137
- "apps"
3238
resources:
3339
- statefulsets
3440
verbs:
35-
- '*'
41+
- get
42+
- list
43+
- watch
44+
- create
45+
- update
46+
- patch
47+
- delete
3648
{{- end }}
3749

3850
{{/*

0 commit comments

Comments
 (0)