Lion Cipher Lab

Audit Kubernetes RBAC for risky permissions with rbac-tool

Why it matters

Almost every real Kubernetes breach that starts with a single compromised container ends the same way: the attacker looks at what the pod's ServiceAccount is allowed to do, and walks it. Role-Based Access Control (RBAC) is the mechanism that is supposed to stop that walk — it decides which identities may perform which actions on which resources — and in a cluster of any age it accumulates cruft. Someone grants a controller cluster-wide access to secrets 'just to get it working'; a Helm chart ships a ClusterRole with a wildcard because the author did not want a support ticket; a ServiceAccount…

What you'll learn

Steps in this lab

  1. RBAC in one paragraph, and why the VERB is where the danger lives
  2. Stand up a throwaway cluster with kind — your machine only
  3. Apply the over-permissive RBAC on purpose — the thing you will audit
  4. Install rbac-tool (krew plugin OR standalone binary)
  5. BEFORE: find the risky permissions — who-can, policy-rules, analysis
  6. Why each of those verbs is genuinely dangerous
  7. Remediate: scope it down, drop the wildcard, remove the escape verbs
  8. AFTER: re-run the same audit and prove the fix
  9. Do it better — and the honest limits of RBAC auditing

Open the full interactive lab →