Kubernetes check

Container runs in privileged mode

K8S-SEC-001HighSecurity

Trigger condition

A regular, init, or ephemeral container's securityContext.privileged is set to true.

Evidence

Identifies the container, its type (container, init container, or ephemeral container), and its image, and states that securityContext.privileged is set to true.

Impact

A privileged container has nearly unrestricted access to the host, including all host devices and kernel capabilities, and -- when it shares the host's namespaces -- the ability to affect other workloads or the node itself. This removes most of the isolation a container would otherwise provide.

Recommendation

Remove privileged: true, or set it to false, in the owning workload's Pod template or the Pod's source manifest. Kubernetes does not permit changing or removing an ephemeral container once added to a Pod, so a privileged ephemeral container cannot be fixed or deleted in place -- clear it only by replacing the affected Pod. Never delete the Pod directly, which bypasses any PodDisruptionBudget: use the Eviction API (which respects an applicable PodDisruptionBudget), or trigger a Deployment rollout governed by the Deployment's own rollout settings; a standalone Pod must be manually recreated. Check available capacity and any PodDisruptionBudget before replacing it -- this is not guaranteed to be safe. If the finding is on a Pod whose Deployment template does not show the same container as privileged, check the Deployment's rollout status and for an admission-time mutation before assuming the Pod itself is the problem.

Important limitations

This check evaluates only securityContext.privileged. It does not detect equivalent or partial host access achieved through other means, such as hostPID, hostNetwork, hostIPC, added Linux capabilities (e.g. SYS_ADMIN), hostPath volume mounts, or allowPrivilegeEscalation -- none of which are evaluated here.

← Back to the check catalogue