Interview Prep/Kubernetes/Security, RBAC and policy

You find that `kubectl exec` is used in production by many people. How do you control it?

AdvancedScenarioSecurity, RBAC and policy
Answer

Situation read → Auditors flagged uncontrolled shell access to production pods.

What I'd do →

  1. Restrict pods/exec and pods/attach in RBAC
  2. Offer break-glass roles with approval and time limit
  3. Enable audit policy at RequestResponse level for exec
  4. Use ephemeral debug containers (kubectl debug) under controlled roles
  5. Alert on exec events in prod namespaces

Why → Exec bypasses application controls and leaves little trace without audit logs.

Interview tip → Say exec in prod should be exceptional and logged.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy