Skip to content

Commit d6a109b

Browse files
author
Pierluigi Lenoci
committed
Added Pod Security Policy to the chart
1 parent 7f21cd3 commit d6a109b

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
@@ -78,6 +78,7 @@ The following table lists the configurable parameters of the csi-secrets-store-p
7878
| `livenessProbe.port` | Liveness probe port | `9808` |
7979
| `livenessProbe.logLevel` | Liveness probe container logging verbosity level | `2` |
8080
| `rbac.install` | Install default rbac roles and bindings | true |
81+
| `rbac.pspEnabled` | If `true`, create and use a restricted pod security policy for Secrets Store CSI Driver pod(s) | `false` |
8182
| `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 |
8283
| `minimumProviderVersions` | [**DEPRECATED**] A comma delimited list of key-value pairs of minimum provider versions with driver | `""` |
8384
| `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
@@ -133,6 +133,7 @@ livenessProbe:
133133
## Install Default RBAC roles and bindings
134134
rbac:
135135
install: true
136+
pspEnabled: false
136137

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

0 commit comments

Comments
 (0)