1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-13 15:57:31 +00:00
kyverno/charts/kyverno-policies/templates/default/restrict-apparmor-profiles.yaml
Bricktop b53ec25ca5
Make whitespace consistent in various helm charts (#2619)
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
2021-10-28 23:11:30 -07:00

37 lines
1.4 KiB
YAML

{{- $name := "restrict-apparmor-profiles" }}
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: {{ $name }}
annotations:
policies.kyverno.io/title: Restrict AppArmor
policies.kyverno.io/category: Pod Security Standards (Default)
{{- if .Values.podSecuritySeverity }}
policies.kyverno.io/severity: {{ .Values.podSecuritySeverity | quote }}
{{- end }}
policies.kyverno.io/description: >-
On supported hosts, the 'runtime/default' AppArmor profile is applied by default.
The default policy should prevent overriding or disabling the policy, or restrict
overrides to an allowed set of profiles.
labels: {{ include "kyverno-policies.labels" . | nindent 4 }}
app: kyverno
spec:
validationFailureAction: {{ .Values.validationFailureAction }}
background: true
rules:
- name: app-armor
match:
resources:
kinds:
- Pod
validate:
message: >-
Specifying other AppArmor profiles is disallowed. The annotation
container.apparmor.security.beta.kubernetes.io must not be defined,
or must not be set to anything other than `runtime/default`.
pattern:
metadata:
=(annotations):
=(container.apparmor.security.beta.kubernetes.io/*): "runtime/default"
{{- end -}}