Kubesplaining

Kubesplaining is an open-source Kubernetes security assessment CLI that reads a live cluster or a captured snapshot and tells you exactly how an attacker can move through it. Unlike scanners that stop at "this resource is misconfigured," it builds a multi-hop RBAC privilege-escalation graph from every non-system subject to nine sinks (among them cluster-admin, system:masters, node-escape, and kube-system-secrets) and renders each chain with the actual verbs, evidence, and remediation. Outputs are risk-prioritized HTML, JSON, CSV, and SARIF reports for human review, GitHub code scanning, or CI delta gates.

The Attack paths tab of the HTML report. Each box is an identity and each arrow is one hop. The columns show how many hops an identity is from the target. Here, 23 paths end at cluster-admin, and the longest has three hops.
Install
Pick whichever fits your workflow.
From a fresh clone (easiest, no install needed):
git clone https://github.com/0hardik1/kubesplaining
cd kubesplaining
make scan
make scan builds the binary (Hermit auto-downloads the pinned Go toolchain) and runs it against your current kubectl context in one step.
See Installation below for krew, go install, pre-built binaries, and checksums.
vs the alternatives
Most scanners overlap on "is this pod privileged?" The differentiator is whether they show you the chain from a non-admin subject to cluster takeover, and whether they ship an actionable fix.
| Capability | kubesplaining | kubescape | trivy | polaris |
|---|
| Multi-hop RBAC privesc graph | Yes (BFS over RBAC + pod state to 9 sinks, full hop chain) | No (per-binding flags only) | No | No |
| Per-finding remediation (patch / Kyverno / Gatekeeper) | Yes (prose per rule; kubectl patch + policy YAML with --remediation-patches) | Partial (control description) | Partial (text only) | Partial (text only) |
| Snapshot diff for CI delta gates | Yes (scan --baseline old.json, fail only on new findings) | No | No | No |
Inspired by Kinnaird McQuade at BeyondTrust Phantom Labs and his Cloudsplaining, which does the same job for AWS IAM. Kubesplaining reads a live cluster or a previously captured snapshot, analyzes it against a library of techniques, and produces a prioritized list of findings: explanation, not just detection.
Why kubesplaining
Most Kubernetes scanners stop at "this resource is misconfigured." Kubesplaining answers a different question: how would an attacker actually move through your cluster? Given the RBAC bindings and pods you already have, it walks the escalation graph from every non-system subject and tells you which can reach cluster-admin, host root, or kube-system secrets, with the full hop chain attached.
It focuses on the ground attackers actually exploit: