Created
January 31, 2024 22:26
-
-
Save identw/988ffea7a0efd627da9ccb79ab46a742 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kyverno.io/v1 | |
kind: ClusterPolicy | |
metadata: | |
name: disallow-host-namespaces | |
spec: | |
background: true | |
failurePolicy: Fail | |
rules: | |
- match: | |
any: | |
- resources: | |
kinds: | |
- Pod | |
name: host-namespaces | |
validate: | |
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: | |
=(hostIPC): "false" | |
=(hostPID): "false" | |
validationFailureAction: Enforce |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment