/polymath-kubernetes:audit-rbac-grantsfrom polymath-kubernetes
Audit RBAC roles and bindings — find overbroad verbs (*), cluster-wide grants that should be namespaced, stale ServiceAccounts, anonymous access.
Ships in polymath-kubernetes. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read a set of RBAC manifests and flag the grants that are wider than they need to be.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
Role, ClusterRole, RoleBinding, ClusterRoleBinding manifests (or a YAML dump from kubectl get … -o yaml).ClusterRoleBinding to a workload's ServiceAccount → flag unless that workload genuinely needs cluster-wide read/write.RoleBinding referencing a ClusterRole so the role definition is shared but the grant is namespaced.verbs: ["*"] → flag every time. Always.verbs: ["create","update","patch","delete"] on Secrets / ServiceAccounts / RoleBindings → flag.get/list/watch on Secrets → flag: list and watch return every secret's data in the namespace, so they are full read access, not "metadata".verbs: ["impersonate"], ["escalate"], or ["bind"] → flag with high severity (each lets the holder gain permissions it doesn't have).resources: ["*"] → flag.nonResourceURLs: ["*"] → flag.pods/exec, pods/attach, nodes/proxy, serviceaccounts/token (create), and create on pods/workloads in a namespace with powerful ServiceAccounts → flag.system:anonymous or system:unauthenticated → flag immediately.kind: Group referencing OIDC groups → confirm group membership is documented.kind: User with an email → people move; prefer Group-based subjects.RBAC audit: <cluster or namespace>
HIGH severity:
- ClusterRoleBinding refund-admin → ServiceAccount payments/refund
Verbs: ["*"] on resources ["*"]. Namespaced scope is sufficient.
Fix: replace with RoleBinding in payments namespace; tighten verbs.
- ClusterRoleBinding lets system:anonymous list endpoints.
Fix: delete; default-deny anonymous.
MEDIUM:
- RoleBinding refund-ops grants verbs ["create","patch"] on secrets in
payments. Only "get" + "list" are needed for the workload's reads.
LOW (stale):
- RoleBinding old-job-runner → ServiceAccount that no longer exists.
ClusterRole with ["*"] because "it's an operator" without checking what the operator actually uses.impersonate to humans for "convenience".What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-kubernetes3 skills in this plugin
/propose-pod-security-standardsPropose Kubernetes Pod Security Standards (privileged/baseline/restricted) per namespace; identify violating workloads and remediations./write-manifestWrite a Kubernetes Deployment + Service + PDB manifest with safe defaults — resource requests/limits, probes, security context, topology spread.