mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com> Co-authored-by: Jim Bugwadia <jim@nirmata.com>
23 lines
609 B
YAML
23 lines
609 B
YAML
apiVersion: kyverno.io/v2beta1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: disallow-host-namespaces
|
|
spec:
|
|
background: false
|
|
rules:
|
|
- name: host-namespaces
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
validate:
|
|
failureAction: Enforce
|
|
message: >-
|
|
Sharing the host namespaces is disallowed. The fields spec.hostNetwork,
|
|
spec.hostIPC, and spec.hostPID must be unset or set to `false`.
|
|
pattern:
|
|
spec:
|
|
=(hostPID): "false"
|
|
=(hostIPC): "false"
|
|
=(hostNetwork): "false"
|