add securityContext for PSS compliance
This commit is contained in:
+11
-1
@@ -14,7 +14,17 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: probe-exec
|
app: probe-exec
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
containers:
|
containers:
|
||||||
- name: probe-exec
|
- name: probe-exec
|
||||||
image: busybox:1.36
|
image: busybox:1.36
|
||||||
command: ["sh","-c","echo 'PROBE-START'; env | sort | sed 's/=.*/=REDACTED/'; echo '--- secret mount test'; ls -la /mnt/secrets-store/db 2>&1 | head -20; sleep 3000"]
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
command: ["sh","-c","echo 'PROBE-POD-RUNNING in ns'; hostname; cat /var/run/secrets/kubernetes.io/serviceaccount/namespace; echo; sleep 3000"]
|
||||||
|
|||||||
+11
-1
@@ -8,11 +8,21 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: probe-db
|
app: probe-db
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
containers:
|
containers:
|
||||||
- name: probe-db
|
- name: probe-db
|
||||||
image: postgres:18-alpine
|
image: postgres:18-alpine
|
||||||
command: ["sh","-c","PGPASSWORD=\"$DB_PASSWORD\" psql -h databases-cluster-rw.database.svc.cluster.local -U \"$DB_USER\" -d \"$DB_NAME\" -c 'select current_user, current_database();' > /proc/1/fd/1 2>&1; sleep 3600"]
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
capabilities:
|
||||||
|
drop: ["ALL"]
|
||||||
|
command: ["sh","-c","echo 'DB-JOB-START'; PGPASSWORD=\"$DB_PASSWORD\" psql -h databases-cluster-rw.database.svc.cluster.local -U \"$DB_USER\" -d \"$DB_NAME\" -c 'select current_user, current_database();' 2>&1; sleep 3600"]
|
||||||
env:
|
env:
|
||||||
- name: DB_HOST
|
- name: DB_HOST
|
||||||
value: databases-cluster-rw.database.svc.cluster.local
|
value: databases-cluster-rw.database.svc.cluster.local
|
||||||
|
|||||||
Reference in New Issue
Block a user