From bb2e2e37dcc186840c215cb19409908b9cc4fefe Mon Sep 17 00:00:00 2001 From: hardwarefresser Date: Tue, 16 Jul 2024 14:27:06 +0200 Subject: [PATCH] Implement configmap target check Only include permissions to configmaps if target includes configmap. This reduces permissions. --- charts/sbom-operator/templates/clusterrole.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/sbom-operator/templates/clusterrole.yaml b/charts/sbom-operator/templates/clusterrole.yaml index 9759986..a570606 100644 --- a/charts/sbom-operator/templates/clusterrole.yaml +++ b/charts/sbom-operator/templates/clusterrole.yaml @@ -18,6 +18,7 @@ rules: - secrets verbs: - get +{{- if and .Values.args (hasKey .Values.args "targets") .Values.args.targets (contains "configmap" .Values.args.targets) }} - apiGroups: - "" resources: @@ -27,6 +28,7 @@ rules: - create - list - delete +{{- end }} - apiGroups: - "" resources: