Skip to content

Commit

Permalink
Restrict default RBAC for ConfigMaps in Helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Henschel <[email protected]>
  • Loading branch information
jacksgt authored and eshepelyuk committed Jun 2, 2022
1 parent 7b16cd9 commit 9ed50ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion charts/opa-kube-mgmt/templates/rbac-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ metadata:
component: mgmt
name: {{ template "opa.mgmtfullname" . }}
rules:
# Inject user-provided RBAC rules
{{- with .Values.rbac.extraRules }}
{{ . | toYaml | nindent 2 }}
{{- end }}

# Allow kube-mgmt to have "get", "list" and "watch" actions over ConfigMaps at a cluster level
# to allow loading policies from any namespace.
# Additionally, allow "patch" and "update" actionson ConfigMaps so kube-mgmt can
# annotate the ConfigMaps to indicate if they were loaded successfully or not.
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["*"]
verbs: ["get", "list", "watch", "update", "patch"]

- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "watch"]
Expand Down

0 comments on commit 9ed50ba

Please sign in to comment.