Skip to content

Commit 9673abd

Browse files
authored
Merge pull request #478 from pierluigilenoci/podsecuritypolicy
Added Pod Security Policy to the chart
2 parents 0eb91af + d6a109b commit 9673abd

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

manifest_staging/charts/secrets-store-csi-driver/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The following table lists the configurable parameters of the csi-secrets-store-p
8080
| `livenessProbe.port` | Liveness probe port | `9808` |
8181
| `livenessProbe.logLevel` | Liveness probe container logging verbosity level | `2` |
8282
| `rbac.install` | Install default rbac roles and bindings | true |
83+
| `rbac.pspEnabled` | If `true`, create and use a restricted pod security policy for Secrets Store CSI Driver pod(s) | `false` |
8384
| `syncSecret.enabled` | Enable rbac roles and bindings required for syncing to Kubernetes native secrets (the default will change to false after v0.0.14) | true |
8485
| `minimumProviderVersions` | [**DEPRECATED**] A comma delimited list of key-value pairs of minimum provider versions with driver | `""` |
8586
| `enableSecretRotation` | Enable secret rotation feature [alpha] | `false` |

manifest_staging/charts/secrets-store-csi-driver/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ labels:
3333
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
3434
{{- end -}}
3535

36+
{{- define "sscd-psp.fullname" -}}
37+
{{- printf "%s-psp" (include "sscd.name" .) -}}
38+
{{- end }}
39+
3640
{{/*
3741
Return the appropriate apiVersion for CSIDriver.
3842
*/}}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.rbac.pspEnabled }}
2+
apiVersion: policy/v1beta1
3+
kind: PodSecurityPolicy
4+
metadata:
5+
name: {{ template "sscd-psp.fullname" . }}
6+
{{ include "sscd.labels" . | indent 2 }}
7+
spec:
8+
seLinux:
9+
rule: RunAsAny
10+
privileged: true
11+
volumes:
12+
- hostPath
13+
- secret
14+
hostNetwork: false
15+
hostPorts:
16+
- min: 0
17+
max: 65535
18+
fsGroup:
19+
ranges:
20+
- max: 65535
21+
min: 1
22+
rule: MustRunAs
23+
runAsUser:
24+
rule: RunAsAny
25+
supplementalGroups:
26+
ranges:
27+
- max: 65535
28+
min: 1
29+
rule: MustRunAs
30+
{{- end }}

manifest_staging/charts/secrets-store-csi-driver/templates/role.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,14 @@ rules:
5050
- get
5151
- patch
5252
- update
53+
{{- if .Values.rbac.pspEnabled }}
54+
- apiGroups:
55+
- policy
56+
resources:
57+
- podsecuritypolicies
58+
verbs:
59+
- use
60+
resourceNames:
61+
- {{ template "sscd-psp.fullname" . }}
62+
{{- end }}
5363
{{ end }}

manifest_staging/charts/secrets-store-csi-driver/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ livenessProbe:
156156
## Install Default RBAC roles and bindings
157157
rbac:
158158
install: true
159+
pspEnabled: false
159160

160161
## Install RBAC roles and bindings required for K8S Secrets syncing. Change this
161162
## to false after v0.0.14

0 commit comments

Comments
 (0)