Skip to content

Commit c0326ad

Browse files
authored
Merge pull request #491 from mhmdmhfd/feat/cis-for-initcontainers
feat: adding cis policy for kc initContainers and excluding kc pg_clu…
2 parents c04b17a + 9c6f626 commit c0326ad

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

roles/keycloak/templates/values/00-main.j2

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,24 @@ initContainers:
314314
image: docker.io/curlimages/curl:8.11.1
315315
{% endif %}
316316
imagePullPolicy: IfNotPresent
317+
securityContext:
318+
allowPrivilegeEscalation: false
319+
capabilities:
320+
drop:
321+
- ALL
322+
privileged: false
323+
readOnlyRootFilesystem: true
324+
runAsGroup: 1001
325+
runAsNonRoot: true
326+
runAsUser: 1001
327+
seLinuxOptions: {}
328+
seccompProfile:
329+
type: RuntimeDefault
317330
command:
318331
- sh
319332
args:
320333
- -c
321-
- curl -k -L -f -S -o /emptydir/app-providers-dir/keycloak-theme-dsfr.jar {{ dsc.keycloak.pluginDownloadUrl }}
334+
- mkdir -p /empty-dir/app-providers-dir && curl -k -L -f -S -o /emptydir/app-providers-dir/keycloak-theme-dsfr.jar {{ dsc.keycloak.pluginDownloadUrl }}
322335
volumeMounts:
323336
- name: empty-dir
324337
mountPath: /emptydir

roles/kyverno/templates/cis.yml.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,16 @@ spec:
515515
- Pod
516516
namespaces:
517517
- "{{ dsc.awx.namespace }}"
518+
exclude:
519+
all:
520+
- resources:
521+
kinds:
522+
- Job
523+
- Pod
524+
namespaces:
525+
- "dso-*"
526+
names:
527+
- "pg-cluster-*"
518528
mutate:
519529
patchStrategicMerge:
520530
spec:

0 commit comments

Comments
 (0)