Interview Prep/DevSecOps/Kubernetes Security Posture

What do Kubernetes user namespaces (`hostUsers: false`) give you?

AdvancedProductionKubernetes Security Posture
Answer

With user namespaces, root (UID 0) inside the container maps to an unprivileged, high UID on the host. If a container escape happens, the attacker lands as a nobody user on the node instead of root. Several past container breakout CVEs would have been blocked by it.

spec:
  hostUsers: false
  containers:
  - name: app
    image: registry.example.com/app@sha256:...

The feature has been maturing through recent releases and needs a recent kernel, container runtime and filesystem idmap support. We enable it first for workloads that must run as root inside the container, where the benefit is largest.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security Posture