Skip to main content
security · kubernetes

Workloads with a container running in privileged mode

resource types
3
rule IDs covered
9
severity
critical

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

How ZopNight evaluates Workloads with a container running in privileged mode.
Field Value
Rule IDsRC-1726 · RC-1826 · RC-1926 · RC-1727 · RC-1827 · RC-1927 · RC-1728 · RC-1828 · RC-1928
Categorysecurity
Severitycritical
Metricnone — pure configuration read
ThresholdsecurityContext.privileged true on any container
SourceZopNight
Permissions usedlist deployments.apps · list statefulsets.apps · list daemonsets.apps

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

Terminal window
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

  1. Find out why it was set. Often the container needs one specific kernel capability, not all of them.
  2. Remove securityContext.privileged: true.
  3. Grant only the required capabilities with securityContext.capabilities.add, for example NET_ADMIN, and keep the rest dropped.
  4. Enforce at least Baseline on application namespaces with the pod-security.kubernetes.io/enforce: baseline label, starting in warn mode to see what would break.

See it fire on your bill.

Connect an account read-only. The first findings land in minutes.

472 rule families across 353 resource types on 22 platforms. Every threshold, metric, and IAM action is documented on these pages before you grant anything.

472 rule families documented
353 resource types covered
read-only default access level
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001· 20–60% off the bill, first month· 4 platforms · 1 console·