add kyverno policies
Signed-off-by: gwg313 <gwg313@pm.me>
This commit is contained in:
parent
4be877e419
commit
baa0216960
35 changed files with 843 additions and 39 deletions
|
|
@ -0,0 +1,35 @@
|
|||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: disallow-host-namespace
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: true
|
||||
|
||||
rules:
|
||||
- name: no-host-namespaces
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
- Deployment
|
||||
- StatefulSet
|
||||
- DaemonSet
|
||||
|
||||
validate:
|
||||
message: "Host networking, PID, and IPC are not allowed."
|
||||
deny:
|
||||
conditions:
|
||||
any:
|
||||
- key: "{{ request.object.spec.hostNetwork || false }}"
|
||||
operator: Equals
|
||||
value: true
|
||||
|
||||
- key: "{{ request.object.spec.hostPID || false }}"
|
||||
operator: Equals
|
||||
value: true
|
||||
|
||||
- key: "{{ request.object.spec.hostIPC || false }}"
|
||||
operator: Equals
|
||||
value: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue