Interview Prep/DevSecOps/Kubernetes Security

Why are `privileged`, `hostPath`, `hostPID` and `hostNetwork` dangerous?

IntermediateConceptKubernetes Security
Answer

Each removes part of the isolation between container and node:

  • privileged: true: all capabilities, all devices, no seccomp/AppArmor. Mounting the host disk is one command.
  • hostPath: a mount of /, /var/run/containerd/containerd.sock or /var/lib/kubelet gives node root or access to every pod's tokens.
  • hostPID: see and signal every process on the node, read their environment via /proc.
  • hostNetwork: bypass NetworkPolicy, bind node ports, reach services that trust localhost.

Baseline PSS blocks all four; exceptions belong in dedicated, tightly controlled namespaces.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security