securityContext

The part of a Kubernetes pod or container spec that sets security options such as user, capabilities, seccomp and read-only root filesystem.

In more detail

Settings on a container override the same settings on the pod. Pod Security Standards are checked against these fields.

Examples

kubectl get pod hardened-web -o yaml | grep runAsNonRoot
"securityContext": {"runAsNonRoot": true, "seccompProfile": {"type": "RuntimeDefault"}}
"capabilities": {"drop": ["ALL"], "add": ["NET_BIND_SERVICE"]}

Related terms

Taught in

References

Certification courses