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.sockor/var/lib/kubeletgives 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.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerWhat happens to a request between `kubectl apply` and etcd from a security point of view?IntermediateExplain Role, ClusterRole, RoleBinding and ClusterRoleBinding.BeginnerHow do you check what a user or service account is allowed to do?BeginnerWhich RBAC permissions are effectively cluster-admin in disguise?AdvancedHow do service account tokens work now, and what is `automountServiceAccountToken`?Intermediate