Skip to content

Commit

Permalink
fix: Replace wildcards in RBAC objects with explicit resources and verbs
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
  • Loading branch information
legal90 committed Sep 3, 2024
1 parent 3ab87fb commit 28c6889
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
39 changes: 32 additions & 7 deletions keda/templates/manager/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ rules:
resources:
- events
verbs:
- '*'
- create
- patch
{{- if not .Values.permissions.operator.restrict.secret }}
- apiGroups:
- ""
resources:
resources:
- secrets
verbs:
- list
Expand Down Expand Up @@ -66,7 +67,7 @@ rules:
- {{ .kind | quote }}
verbs:
- get
{{- end }}
{{- end }}
{{- end }}
- apiGroups:
- apps
Expand All @@ -93,13 +94,25 @@ rules:
resources:
- horizontalpodautoscalers
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- eventing.keda.sh
resources:
Expand All @@ -108,7 +121,13 @@ rules:
- clustercloudeventsources
- clustercloudeventsources/status
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- keda.sh
resources:
Expand All @@ -121,7 +140,13 @@ rules:
- triggerauthentications
- triggerauthentications/status
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
{{- if .Values.rbac.aggregateToDefaultRoles }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
16 changes: 14 additions & 2 deletions keda/templates/manager/minimal-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ rules:
resources:
- leases
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
{{- if and .Values.certificates.autoGenerated (not .Values.certificates.certManager.enabled) }}
- apiGroups:
- ""
Expand Down Expand Up @@ -79,7 +85,13 @@ rules:
- clustertriggerauthentications
- clustertriggerauthentications/status
verbs:
- '*'
- create
- delete
- get
- list
- patch
- update
- watch
{{- if and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }}
- apiGroups:
- admissionregistration.k8s.io
Expand Down
4 changes: 2 additions & 2 deletions keda/templates/metrics-server/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rules:
- apiGroups:
- external.metrics.k8s.io
resources:
- '*'
- 'externalmetrics'
verbs:
- '*'
- 'get'
{{- end -}}

0 comments on commit 28c6889

Please sign in to comment.