mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-13 15:57:31 +00:00
* Allow some helm policies to be excluded Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu> * Make Helm security policies opt-in when podSecurityStandard=custom Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
34 lines
No EOL
1.1 KiB
YAML
34 lines
No EOL
1.1 KiB
YAML
{{- $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 -}} |