Interview Prep/DevSecOps/Kubernetes Security

An attacker could create pods in one namespace. List the paths they would use to escalate, and how you block each.

AdvancedScenarioKubernetes Security
Answer

Situation read → "Create pods" is more powerful than it sounds.

What I'd do →

  1. Mount any Secret or service account in that namespace via the pod spec: limit what lives there and use separate namespaces for sensitive workloads.
  2. Run privileged or with hostPath/hostPID to escape to the node: PSA restricted blocks it.
  3. Schedule onto control plane or sensitive nodes with tolerations: policy engine restricting tolerations and nodeSelectors.
  4. Steal node credentials from IMDS: IMDSv2 hop limit 1 and egress deny.
  5. Reach other services: default-deny NetworkPolicies.

Why → Each control closes one escalation path; together they contain the attacker in one namespace.

Interview tip → Saying "create pod is effectively read all secrets in the namespace" shows depth.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security