* chore(kyverno): Adding security policies Signed-off-by: shubham chaudhary <shubham@chaosnative.com> * chore(kyverno): updating policies Signed-off-by: shubham chaudhary <shubham@chaosnative.com> * chore(kyverno): updating policies Signed-off-by: shubham chaudhary <shubham@chaosnative.com> * chore(kyverno): changed the file names Signed-off-by: shubham chaudhary <shubham@chaosnative.com>
31 lines
989 B
YAML
31 lines
989 B
YAML
apiVersion: kyverno.io/v1
|
|
kind: Policy
|
|
metadata:
|
|
name: allow-privileged-containers
|
|
annotations:
|
|
policies.kyverno.io/category: Pod Security Standards
|
|
policies.kyverno.io/severity: medium
|
|
policies.kyverno.io/subject: Pod
|
|
policies.kyverno.io/description: >-
|
|
Privileged policies only allow the litmus containers to use privileged mode.
|
|
spec:
|
|
validationFailureAction: audit
|
|
background: true
|
|
rules:
|
|
- name: priviledged-containers
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
selector:
|
|
matchLabels:
|
|
# applicable for experiments which usage container runtime apis
|
|
app.kubernetes.io/runtime-api-usage: "true"
|
|
validate:
|
|
message: >-
|
|
It should be run in privileged mode. It can be defined at spec.containers[*].securityContext.privileged.
|
|
pattern:
|
|
spec:
|
|
containers:
|
|
- =(securityContext):
|
|
=(privileged): true |