Pods running as privileged or root
A pod with privileged: true, hostPID/hostNetwork, or running as UID 0 has far more power than an application needs — and is a common container-escape path to the underlying node.
Why it matters
If an attacker gets code execution in a privileged pod, escaping to the host (and then the whole node's workloads) is often straightforward.
Most applications don't need any of these capabilities; they're usually left on by default or copied from an example.
How to check for it
- kubectl get pods -A -o json | jq '.items[] | select(.spec.containers[].securityContext.privileged==true) | .metadata.name'.
- Check for runAsNonRoot, dropped capabilities, and whether the namespace enforces a Pod Security Standard.
How to fix it
- Set securityContext: runAsNonRoot, readOnlyRootFilesystem, drop ALL capabilities, and remove privileged/hostPID/hostNetwork unless truly required.
- Enforce the 'restricted' Pod Security Standard (or an admission policy like Kyverno/OPA) at the namespace level.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.
FAQ
- What is the Pod Security Standard 'restricted' level?
- A built-in policy that blocks privilege escalation, host namespaces, and running as root — the recommended baseline for application namespaces.