Files
litmus-hub/security/kyverno-policies/allow-host-namespaces-for-litmus-experiments-which-uses-runtime-api.yaml
Shubham Chaudhary 14c472265f chore(kyverno): Adding kyverno pod security policies for litmus pods (#504)
* 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>
2021-10-13 16:00:11 +05:30

34 lines
1.1 KiB
YAML

apiVersion: kyverno.io/v1
kind: Policy
metadata:
name: allow-host-namespaces
annotations:
policies.kyverno.io/category: Pod Security Standards
policies.kyverno.io/severity: medium
policies.kyverno.io/subject: Pod
policies.kyverno.io/description: >-
Host namespaces (Process ID namespace, Inter-Process Communication namespace, and
network namespace) allow access to shared information and can be used to elevate
privileges. Pods should allowed access to host namespaces.
spec:
validationFailureAction: audit
background: true
rules:
- name: host-namespaces
match:
resources:
kinds:
- Pod
selector:
matchLabels:
# applicable for experiments which usage container runtime apis
app.kubernetes.io/runtime-api-usage: "true"
validate:
message: >-
The spec.hostNetwork should be false, spec.hostIPC should be false, and spec.hostPID should be true.
pattern:
spec:
=(hostPID): "true"
=(hostIPC): "false"
=(hostNetwork): "false"