Workloads with a container running in privileged mode
What does ZopNight detect here?
ZopNight raises a critical finding for any EKS, GKE or AKS Deployment, StatefulSet or DaemonSet in which a container or init container sets `securityContext.privileged: true`. The Kubernetes API describes processes in privileged containers as essentially equivalent to root on the host, and even the Baseline Pod Security Standard forbids the setting.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-1726 · RC-1826 · RC-1926 · RC-1727 · RC-1827 · RC-1927 · RC-1728 · RC-1828 · RC-1928 |
| Category | security |
| Severity | critical |
| Metric | none — pure configuration read |
| Threshold | securityContext.privileged true on any container |
| Source | ZopNight |
| Permissions used | list deployments.apps · list statefulsets.apps · list daemonsets.apps |
Where it applies
Privileged mode switches off container isolation
The Pod API reference
defines privileged in one line: processes in privileged containers are essentially equivalent to
root on the host. The field defaults to false. The
Pod Security Standards
say privileged pods disable most security mechanisms, and list the setting under the Baseline
profile, the minimum policy meant to block known privilege escalations. Only the fully permissive
Privileged profile allows it.
Whoever compromises a privileged container has, for most purposes, compromised the node and every other pod scheduled there, because the usual container boundaries no longer hold.
Listing privileged containers
kubectl get deployments,statefulsets,daemonsets -A -o json | jq -r ' .items[] | .kind as $k | .metadata as $m | (.spec.template.spec.containers + (.spec.template.spec.initContainers // []))[] | select(.securityContext.privileged == true) | "\($k) \($m.namespace)/\($m.name) \(.name)"'Any explicit true is enough
ZopNight checks the security settings recorded for every container and init container in
Deployments, StatefulSets and DaemonSets. A container counts only when privileged is explicitly
true; an unset field is treated as false, matching the Kubernetes default. The finding names each
privileged container in the workload and is rated critical.
No namespace exception in the rule
Unlike the host-network check, the rule itself excludes no namespaces. ZopNight does not collect
workloads in kube-system, kube-public or kube-node-lease (or GKE’s own system namespaces),
so system components there never appear; privileged agents installed in other namespaces do. Review those and accept the ones you rely on deliberately.
A workload with no containers recorded, or with no privileged container, is silent. Ephemeral
containers are not evaluated. Related findings are
Container running as root
and Container with host network.
Critical exposure, no saving
The finding carries no cost estimate. What is at stake is the node: a privileged container is one exploit away from full control of the machine it runs on.
Removing privileged mode
- Find out why it was set. Often the container needs one specific kernel capability, not all of them.
- Remove
securityContext.privileged: true. - Grant only the required capabilities with
securityContext.capabilities.add, for exampleNET_ADMIN, and keep the rest dropped. - Enforce at least Baseline on application namespaces with the
pod-security.kubernetes.io/enforce: baselinelabel, starting inwarnmode to see what would break.