Skip to content

Instantly share code, notes, and snippets.

@ashutosh-narkar
Created July 23, 2021 17:40
Show Gist options
  • Save ashutosh-narkar/d6c5dc890c01cd981d42b6511044bebb to your computer and use it in GitHub Desktop.
Save ashutosh-narkar/d6c5dc890c01cd981d42b6511044bebb to your computer and use it in GitHub Desktop.
package kubernetes.validating.deny_host_namespaces
deny[msg] {
input.request.kind.kind == "Pod"
input.request.object.spec.hostNetwork == true
msg := "Pod cannot be created with hostNetwork enabled."
}
deny[msg] {
input.request.kind.kind == "Pod"
input.request.object.spec.hostPID == true
msg := "Pod cannot be created with hostPID enabled."
}
deny[msg] {
input.request.kind.kind == "Pod"
input.request.object.spec.hostIPC == true
msg := "Pod cannot be created with hostIPC enabled."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment