mukul975/anthropic-cybersecurity-skills/auditing-kubernetes-cluster-rbac
Claude Code and agent skill by mukul975/anthropic-cybersecurity-skills
- community
Checking that the SKILL.md file is still in the repository.
'Auditing Kubernetes cluster RBAC configurations to identify overly permissive
Install
npx vskill@latest install mukul975/anthropic-cybersecurity-skills/auditing-kubernetes-cluster-rbacSKILL.md
The same SKILL.md was published earlier as mukul975/anthropic-cybersecurity-skills/auditing-kubernetes-cluster-rbac.
Auditing Kubernetes Cluster RBAC
When to Use
- When performing security assessments of Kubernetes clusters (EKS, GKE, AKS, or self-managed)
- When validating that RBAC policies enforce least privilege for users and service accounts
- When investigating potential lateral movement or privilege escalation within a Kubernetes cluster
- When compliance audits require documentation of access controls and permissions
- When onboarding new teams to a shared cluster and defining appropriate RBAC policies
Do not use for network policy auditing (use Cilium or Calico network policy tools), for container image scanning (use Trivy or Grype), or for runtime security monitoring (use Falco or Sysdig Secure).
Prerequisites
- kubectl configured with cluster-admin or equivalent read permissions to the target cluster
- rbac-tool installed (
kubectl krew install rbac-toolor binary from GitHub) - KubiScan installed (
pip install kubiscan) - Kubeaudit installed (
brew install kubeauditor from GitHub releases) - Access to the cluster's audit logs for correlating RBAC findings with actual API access
Workflow
Step 1: Enumerate ClusterRoles and Roles with Dangerous Permissions
Identify roles with wildcard permissions, secret access, pod exec, or escalation capabilities.
Step 2: Audit ClusterRoleBindings and RoleBindings
Review bindings to identify who has elevated access and detect overly broad group assignments.
Step 3: Scan with rbac-tool for Comprehensive Analysis
Use rbac-tool for automated RBAC analysis including who-can queries and policy generation.
Step 4: Run KubiScan for Risky Permissions Detection
Use KubiScan to automatically identify risky service accounts, pods, and RBAC configurations.
Step 5: Audit Service Account Token Mounting and Usage
Check for unnecessary service account token mounts that could enable lateral movement from compromised pods.
Step 6: Run Kubeaudit for RBAC and Security Policy Validation
Execute Kubeaudit for comprehensive security checks including RBAC-related findings.
Key Concepts
| Term | Definition | |
|---|---|---|
| RBAC | Role-Based Access Control in Kubernetes, a method for regulating access to cluster resources based on the roles of individual users or service accounts | |
| ClusterRole | Cluster-wide role definition that specifies permissions (verbs on resources) applicable across all namespaces | |
| ClusterRoleBinding | Associates a ClusterRole with subjects (users, groups, service accounts) at the cluster scope | |
| Service Account | Identity associated with pods for authenticating to the Kubernetes API server, automatically mounted unless disabled | |
| automountServiceAccountToken | Pod spec field controlling whether the service account token is automatically mounted into the pod filesystem | |
| Privilege Escalation | RBAC verbs (bind, escalate, impersonate) that allow a user to grant themselves or others elevated permissions |
Tools & Systems
- kubectl: Primary CLI for querying Kubernetes RBAC resources (roles, bindings, service accounts)
- rbac-tool: kubectl plugin for RBAC analysis including who-can queries, visualization, and policy generation
- KubiScan: Python tool for scanning Kubernetes RBAC for risky permissions and privilege escalation paths
- Kubeaudit: Security auditing tool that checks pods and workloads for security anti-patterns including RBAC issues
- rakkess: kubectl plugin showing access matrix for the current user across all resource types
Common Scenarios
Scenario: Auditing an EKS Cluster Shared by Multiple Development Teams
Context: A shared EKS cluster serves four development teams. RBAC was configured during initial setup but has not been reviewed in 12 months. Teams report being able to access other teams' namespaces.
Approach:
- List all ClusterRoleBindings to identify bindings granting broad access to authenticated users
- Run
kubectl rbac-tool who-can get secretsto find subjects that can read secrets across namespaces - Discover that a ClusterRoleBinding grants
edittosystem:authenticated, giving all users write access cluster-wide - Run KubiScan to identify service accounts with risky permissions and pods running with elevated service accounts
- Replace the ClusterRoleBinding with namespace-scoped RoleBindings for each team
- Disable automountServiceAccountToken for workloads that do not need API access
- Create a NetworkPolicy to isolate namespace traffic between teams
Pitfalls: Removing ClusterRoleBindings can break CI/CD pipelines and operators that rely on cluster-wide access. Always audit which workloads use the bindings before removing them. EKS maps IAM roles to Kubernetes groups via aws-auth ConfigMap, so RBAC changes must be coordinated with IAM role mappings.
Output Format
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/auditing-kubernetes-cluster-rbac/SKILL.md
Popularity
- Repository stars
- 27,514
- Repository forks
- 3,334
- 7-day trend score
- 51
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 Jul 2026, 4 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mukul975/anthropic-cybersecurity-skills/auditing-kubernetes-cluster-rbac)