k8s-rbac-audit

k8s-rbac-audit is a command for Claude Code from HermeticOrmus/LibreSecOps-Claude-Code. It costs 30 tokens per session (1,403 once invoked), scanned A, original, MIT.

A command that audits Kubernetes role-based access control, or RBAC—the system that determines which users, teams, and service accounts can perform which actions.

In plain words
What is it for?
Use it to review live-cluster permissions, RBAC YAML, Helm charts, namespace access, cluster-admin bindings, and service-account privileges.
Why use it?
It helps find excessive permissions, dangerous role bindings, and paths that could let an identity gain more access than intended.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the kubernetes-security plugin — 2 skills, 2 commands, 2 agents shipped together

Good fit Use it to review live-cluster permissions, RBAC YAML, Helm charts, namespace access, cluster-admin bindings, and service-account privileges.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreSecOps-Claude-Code

Made for: Claude Code.

Or install kubernetes-security, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-rbac-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit/github.svg)](https://agentmods.dev/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit"><img src="https://agentmods.dev/badge/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-rbac-audit

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit"><img src="https://agentmods.dev/badge/commands/hermeticormus/libresecops-claude-code/k8s-rbac-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,403 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.01403
Opus 5.5 $0.00012 $0.00561
Sonnet 5.5 $0.00006 $0.00281
Haiku 4.5 $0.00003 $0.00140

Measured 12d ago against content hash 11547bff6652, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

k8s-rbac-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/kubernetes-security/commands/k8s-rbac-audit.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/k8s-rbac-audit

Focused audit of Kubernetes RBAC configuration, identifying overly permissive roles and privilege escalation paths.

Trigger

Use when you need to:

  • Audit who has access to what in a Kubernetes cluster
  • Identify overly permissive roles and role bindings
  • Find privilege escalation paths through RBAC
  • Review RBAC after organizational changes (team restructuring, offboarding)
  • Prepare for a security review focused on access control

Input

One of:

  • Live cluster: kubectl access with RBAC read permissions
  • RBAC manifests: Role, ClusterRole, RoleBinding, ClusterRoleBinding YAML files
  • Helm charts: Charts defining RBAC resources
  • Specific scope: Focus on a namespace, team, or service account

Process

Phase 1: Cluster-Level RBAC

  1. cluster-admin bindings

    kubectl get clusterrolebindings -o json | jq -r '
      .items[] |
      select(.roleRef.name == "cluster-admin") |
      "Binding: \(.metadata.name)\nSubjects: \(.subjects | map(.kind + ":" + .name) | join(", "))\n"'
    
    • Every cluster-admin binding (should be minimal -- operators, break-glass only)
    • system:masters group members (equivalent to cluster-admin, cannot be restricted by RBAC)
  2. Overprivileged ClusterRoles

    kubectl get clusterroles -o json | jq -r '
      .items[] |
      select(.rules[]? | .resources[]? == "*" and .verbs[]? == "*") |
      .metadata.name'
    
    • ClusterRoles with * on all resources and all verbs
    • ClusterRoles with create on pods or deployments (code execution)
    • ClusterRoles with access to secrets across all namespaces
  3. Dangerous permission combinations

    • create pods + get secrets = create a pod that mounts any secret
    • create pods + create serviceaccounts + create rolebindings = escalate to any role
    • patch nodes = modify node labels to bypass nodeSelector constraints
    • impersonate users/groups = act as any user
    • escalate on roles = create roles with more permissions than you have
    • bind on roles = bind any role to any subject

Read the full file on GitHub · 148 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago Changed · +5 lines · +30 tokens per session 11547bff6652
  2. 1mo ago First seen · 143 lines · 0 tokens per session scan A 321022065b7c

Subscribe to this mod's changes

k8s-rbac-audit is a command published in the GitHub repository HermeticOrmus/LibreSecOps-Claude-Code (4 stars, last pushed 9d ago), licensed MIT. It adds 30 tokens to every session and 1,403 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.