ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
1 changed files with 145336 additions and 0 deletions
79
vendor/platform/kyverno/policies/restrict-pod-host-access.yaml
vendored
Normal file
79
vendor/platform/kyverno/policies/restrict-pod-host-access.yaml
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: restrict-pod-host-access
|
||||
annotations:
|
||||
policies.kyverno.io/title: Restrict host namespaces and hostPath (audit)
|
||||
policies.kyverno.io/category: Pod Security
|
||||
policies.kyverno.io/severity: medium
|
||||
policies.kyverno.io/description: >-
|
||||
Audit Pod Security restricted host access (hostNetwork, hostPID, hostIPC,
|
||||
hostPath). Complements deny-privileged; named exceptions for host agents.
|
||||
spec:
|
||||
validationFailureAction: Audit
|
||||
background: true
|
||||
rules:
|
||||
- name: deny-host-namespaces
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
exclude:
|
||||
any:
|
||||
- resources:
|
||||
namespaces:
|
||||
- kube-system
|
||||
- kube-public
|
||||
- kube-node-lease
|
||||
- flux-system
|
||||
- flux-canary
|
||||
- kyverno
|
||||
- cert-manager
|
||||
- cilium-secrets
|
||||
- olm
|
||||
- operators
|
||||
- longhorn
|
||||
- openebs
|
||||
- intel-system
|
||||
- nfd
|
||||
validate:
|
||||
message: >-
|
||||
Pods must not set hostNetwork, hostPID, or hostIPC (PSS restricted).
|
||||
pattern:
|
||||
spec:
|
||||
=(hostNetwork): "false"
|
||||
=(hostPID): "false"
|
||||
=(hostIPC): "false"
|
||||
- name: deny-hostpath-volumes
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
exclude:
|
||||
any:
|
||||
- resources:
|
||||
namespaces:
|
||||
- kube-system
|
||||
- kube-public
|
||||
- kube-node-lease
|
||||
- flux-system
|
||||
- flux-canary
|
||||
- kyverno
|
||||
- cert-manager
|
||||
- cilium-secrets
|
||||
- olm
|
||||
- operators
|
||||
- longhorn
|
||||
- openebs
|
||||
- intel-system
|
||||
- nfd
|
||||
validate:
|
||||
message: >-
|
||||
Pods must not use hostPath volumes (PSS restricted). Prefer emptyDir,
|
||||
PVC, or projected volumes.
|
||||
pattern:
|
||||
spec:
|
||||
=(volumes):
|
||||
- X(hostPath): "null"
|
||||
Loading…
Reference in a new issue