Interview Prep/Kubernetes/Security, RBAC and policy

Why is running containers as root a problem?

BeginnerScenarioSecurity, RBAC and policy
Answer

Situation read → A scan flags many containers running as UID 0.

What I'd do →

  1. Root in the container is root on the shared kernel if an escape occurs
  2. Set runAsNonRoot and build images with a non-root USER
  3. Fix file ownership with fsGroup
  4. Verify with kubectl exec -- id
  5. Enforce with PSA

Why → Least privilege reduces the effect of a container escape.

Interview tip → Mention user namespaces as an extra layer.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy