Add Kyverno admission policies and CIS mappings
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 3m11s
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 3m11s
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: disallow-host-network
|
||||
annotations:
|
||||
policies.kyverno.io/title: Disallow host network and host PID
|
||||
policies.kyverno.io/category: Pod Security Standards
|
||||
policies.kyverno.io/severity: high
|
||||
# CIS 5.2.3: minimize hostPID; CIS 5.2.5: minimize hostNetwork.
|
||||
policies.kyverno.io/cis-control: "5.2.3, 5.2.5"
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: false
|
||||
failurePolicy: Fail
|
||||
rules:
|
||||
- name: no-host-network-or-pid
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
namespaceSelector:
|
||||
matchLabels:
|
||||
security-baseline/open: "true"
|
||||
validate:
|
||||
message: hostNetwork, hostPID, and hostIPC must be false or omitted.
|
||||
pattern:
|
||||
spec:
|
||||
=(hostNetwork): false
|
||||
=(hostPID): false
|
||||
=(hostIPC): false
|
||||
|
||||
Reference in New Issue
Block a user