1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00
kyverno/charts/kyverno/templates/policies/default/restrict-apparmor-profiles.yaml
Raj Babu Das bb9e73a316 Adding policies(default, restricted) to kyverno helm charts
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
2021-01-24 05:09:47 +05:30

31 lines
No EOL
1.1 KiB
YAML

{{- if eq .Values.policyType "default" }}
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: restrict-apparmor-profiles
annotations:
policies.kyverno.io/title: Restrict AppArmor
policies.kyverno.io/category: Pod Security Standards (Default)
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.
spec:
validationFailureAction: audit
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 -}}