{{- $name := "require-default-proc-mount" }} {{- if eq (include "kyverno.podSecurityDefault" (merge (dict "name" $name) .)) "true" }} apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: {{ $name }} annotations: policies.kyverno.io/category: Pod Security Standards (Default) policies.kyverno.io/description: >- The default /proc masks are set up to reduce attack surface and should be required. spec: validationFailureAction: {{ .Values.validationFailureAction }} background: true rules: - name: check-proc-mount match: resources: kinds: - Pod validate: message: >- Changing the proc mount from the default is not allowed. The fields spec.containers[*].securityContext.procMount and spec.initContainers[*].securityContext.procMount must not be changed from `Default`. pattern: spec: =(initContainers): - =(securityContext): =(procMount): "Default" containers: - =(securityContext): =(procMount): "Default" {{- end -}}