Guide · Agent skill
How to use the Kubernetes RBAC Privilege Escalation Audit skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains how to install and use the auditing-kubernetes-rbac-privilege-escalation agent skill, which lets an AI agent review a Kubernetes cluster's access rules for accounts that could escalate their privileges. It is written for readers who have never used an agent skill before. By the end you will know what the skill does, how to add it to your agent, how to ask for an audit in plain language, and what you need in place before running it against a cluster.
Quick start
- 1Download and unzip the skill. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder. Alternatively, upload the ZIP under Settings, Capabilities, Skills in the Claude apps.
- 2Prepare kubectl access. Configure kubectl against the cluster you are authorized to assess, using credentials with read access to RBAC objects.
- 3Install the audit tools. Install the krew plugins who-can, access-matrix and rbac-lookup, and download the rbac-police binary from GitHub releases. Make sure jq and Python 3 are available.
- 4Ask for the review. Describe the scope in plain language, such as reviewing escalation paths in a named cluster or checking one service account.
- 5Read the findings. Review the prioritized report, which lists dangerous permissions by subject and suggests least-privilege fixes.
- 6Validate fixes. After changes are made, ask the agent to rerun the audit and confirm the escalation paths are closed.
What does this skill make the agent do?
The skill finds over-permissive Role and ClusterRole rules and the service-account token abuse paths they create in a Kubernetes cluster. It runs kubectl auth can-i, rbac-police, kubectl-who-can and rakkess, and traces which subjects could escalate toward cluster-admin.
The skill focuses on specific dangerous permissions. These include escalate on roles, bind on clusterroles, impersonate, create or patch on pods (which can lead to a privileged, host-mounting pod), read access to secrets, minting tokens for serviceaccounts/token, and wildcard verbs and resources.
- Inventory Role, ClusterRole, RoleBinding and ClusterRoleBinding objects
- List effective permissions per subject with kubectl auth can-i --as
- Find subjects that hold admin-equivalent primitives
- Trace pods that mount tokens to over-privileged service accounts
- Produce a prioritized findings report with least-privilege remediation
Install the skill
Download the ZIP for this skill from the page you are reading. Unzip it so the skill folder sits in one of these locations: ~/.claude/skills/ for all your projects, or .claude/skills/ inside a single project folder.
If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the ZIP there.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into .claude/skills/ in your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Set up the tools and requirements
The skill needs kubectl configured against the target cluster, with read access to RBAC objects. It also needs the krew plugins who-can and access-matrix (rakkess), rbac-lookup, the rbac-police binary from GitHub releases, jq for JSON filtering, and Python 3 to run scripts/agent.py. You also need cluster credentials or impersonation rights for the audit identity.
The source gives these install commands for the tools. Run them only against a cluster you are authorized to assess.
- kubectl with read access to RBAC objects
- krew plugins: who-can, access-matrix, rbac-lookup
- rbac-police binary, downloaded from GitHub releases
- jq and Python 3
- Credentials or impersonation rights for the audit identity
kubectl krew install who-canAsk for an audit in plain language
Once the skill is installed, describe what you want in ordinary words. The skill is meant to trigger on requests about who can escalate privileges in a cluster, hunting exploitable RoleBindings during an authorized review, or checking least privilege after an RBAC change.
Give the agent the context it needs: which cluster, whether the review is authorized, and what you are worried about. Ask for a findings report so you get a prioritized list with fixes.
- Review who can escalate privileges in this cluster and report the escalation paths.
- Check whether the dev:builder service account can create pods or read secrets.
- Validate least privilege after yesterday's Helm rollout and list any drift.
- Show which subjects can impersonate users or mint service account tokens.
- Trace which pods mount tokens for over-privileged service accounts.
Check one service account by hand
You can run the same checks yourself. Impersonation with --as requires that your audit identity has impersonate rights. The first command lists every permission a service account holds. The second checks a single dangerous action.
kubectl auth can-i --list --as=system:serviceaccount:default:defaultSafety notes: scripts, network and live clusters
This skill runs scripts and uses the network. It downloads rbac-police from GitHub releases and calls kubectl against the cluster. The skill's own legal notice says enumerating and exercising RBAC permissions affects a live cluster's access posture. Only test clusters you own or are explicitly authorized in writing to assess.
The skill also describes a lab demonstration of one escalation path. Run any such demonstration only in a lab cluster, never in production. Review the scripts and commands before the agent runs them.
- Use only clusters you own or have written authorization to assess
- Run the escalation demonstration only in a lab
- Review scripts/agent.py and downloaded binaries before running them
- Use a least-privileged audit identity where possible
What people use it for
- Pre-release check that no service account gained create pods or secrets access during a Helm change
- Penetration test of a cluster you are authorized to assess, mapping which subjects can reach cluster-admin
- Incident response: learning what a compromised pod's service-account token can reach
- Periodic review of wildcard verbs and resources in ClusterRoles
Frequently asked questions
Is the Kubernetes RBAC Privilege Escalation Audit skill free?
The skill is published under the Apache-2.0 licence, as stated on this page. Check the licence file in the source repository for the full terms. The tools it uses, such as kubectl and rbac-police, are installed separately.
What do I need before I can use this skill?
You need kubectl configured against the target cluster with read access to RBAC objects, the krew plugins who-can, access-matrix and rbac-lookup, the rbac-police binary, jq, Python 3, and credentials or impersonation rights for the audit identity. Without cluster access the skill cannot produce useful results.
Where do I install an agent skill?
Unzip the skill into ~/.claude/skills/ for personal use or into .claude/skills/ in a project. In the Claude apps, you can upload the ZIP under Settings, Capabilities, Skills.
Is this the right skill to fix RBAC permissions?
No. This skill finds over-permissive roles and escalation paths. The skill itself says designing and applying hardened RBAC belongs to a different skill, implementing-rbac-hardening-for-kubernetes.
Can the skill exploit my cluster?
The skill can demonstrate one escalation path in a lab. Its legal notice says enumerating and exercising RBAC affects a live cluster's access posture, so use it only on clusters you own or are authorized in writing to assess.
What if the agent cannot list permissions for a service account?
Impersonation with --as needs impersonate rights for your audit identity. Check that your kubectl context has read access to RBAC objects and that the identity can impersonate the subject you want to check.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a platform or security engineer running an authorized Kubernetes security review, penetration test, or check for RBAC drift before a release. Pick a different tool if you need to design or apply hardened RBAC rules, or if you do not have kubectl access and written authorization for the cluster.
Download the skill