Adds a policy to block pods where the securityContext will allow a container/pod to run as the root user. An example of a valid securityContext is:
securityContext:
runAsUser: 1234
---
securityContext:
runAsNonRoot: true # assumes that the image has an appropriate `USER` directive
It can be set at the pod level or at the container level. If set at the container level and not at the pod level, it must be set for all containers (including init containers).
Adds a policy to block pods where the
securityContext
will allow a container/pod to run as the root user. An example of a valid securityContext is:It can be set at the pod level or at the container level. If set at the container level and not at the pod level, it must be set for all containers (including init containers).