Course contentsShow
← Cloud and Infrastructure
Lesson 1394 of 2,98928. Kubernetes SecurityFree lesson

Privileged Containers

Understand when and why privileged mode is needed, and the security risks it introduces to the cluster.

Privileged Containers

What you'll learn: When privileged containers are necessary and the major security risks they introduce to your Kubernetes cluster.

What Is a Privileged Container?

A privileged container runs with nearly all the capabilities of the host machine—essentially running as root on the underlying node. When you set privileged: true in the container's security context, you're removing most of the isolation that containers normally provide.

Think of it like this: a normal container is a guest staying in a hotel room with locked doors and limited access. A privileged container is like giving that guest a master key and unrestricted access to every room, the maintenance areas, and the building's infrastructure.

When Privileged Mode Is Needed

Certain workloads require direct access to host devices or low-level system operations:

  • Container runtimes (like Docker-in-Docker)
  • Network plugins that configure host networking
  • Storage drivers that need direct disk access
  • Monitoring agents that inspect kernel-level metrics
  • Device management for GPUs or specialized hardware

These use cases typically involve system administration tasks that normal containers cannot perform.

Security Risks

Privileged containers bypass most security boundaries:

  1. Full host access: Can read/write any file on the node
  2. Kernel manipulation: Can load kernel modules or change system settings
  3. Break container isolation: Can access other containers' data
  4. Node compromise: A breach in a privileged container = full node control
  5. Cluster-wide impact: Attackers could pivot to other nodes

This essentially negates the security benefits you've carefully built with non-root users, read-only filesystems, and privilege escalation controls.

Key Takeaway: Privileged containers grant nearly unrestricted host access and should only be used for infrastructure-level workloads that absolutely require it—never for regular application containers, as they represent a critical security risk to your entire cluster.