Works with the AI Agents you already use
IAM Least-Privilege & K8s RBAC Auditor
Eliminate AWS/GCP wildcard admin policies, PassRole privilege-escalation chains, public Trust Policies, and Kubernetes cluster-admin bindings—with a read-only policy auditor and SOC 2-ready diffs.
$9
IAM Least-Privilege & K8s RBAC Auditor
Example session with this skill installed
Audit our AWS Terraform IAM (iam.tf, policy.json) and EKS RBAC manifests (k8s-rbac.yaml) for privilege-escalation paths before our SOC 2 audit. Show least-privilege replacements before editing any files.
- Read your context and instructions
- Compiled the iam least-privilege
IAM Least-Privilege & K8s RBAC Blast-Radius Report
Blast-Radius Risk Tier: CRITICAL ·
Least-Privilege Score: 0 / 100 (Grade F) ·
Findings: 9 Critical · 4 High · 1 Medium
| Rule | Severity | Location | Escalation / Blast-Radius Risk | Least-Privilege Replacement |
|---|---|---|---|---|
IAM-AWS-002 | Critical | policy.json:14 | iam:PassRole + lambda:CreateFunction on Resource: "*" allows full account takeover | Scope PassRole to specific execution role ARN + iam:PassedToService condition |
IAM-AWS-003 | Critical | iam.tf:22 | Trust policy uses Principal: { AWS: "*" } without aws:SourceAccount | Restrict to exact AWS account ARN + sts:ExternalId |
IAM-K8S-001 | Critical | k8s-rbac.yaml:8 | ClusterRoleBinding grants cluster-admin to payments-sa | Replace with namespace-scoped Role + RoleBinding |
IAM-K8S-003 | High | k8s-rbac.yaml:31 | Cluster-wide get/list/watch on secrets without resourceNames | Restrict to namespace Role with explicit resourceNames: ["payments-db"] |
Least-Privilege Kubernetes RBAC Replacement (Preview)
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: payments-secret-reader
namespace: payments
rules:
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["payments-db"]
verbs: ["get"]
Next Steps (Approval Required)
Reply
"Apply least-privilege IAM & RBAC diffs" to harden iam.tf, policy.json, and k8s-rbac.yaml (lifting score from
0/100 CRITICAL to
100/100 LOW).
Connects securely to your tools. The creator never sees your data.
About this skill
Shrink Your Cloud & Kubernetes Blast Radius Before SOC 2 or an Incident
Most cloud breaches don't start with zero-days—they start with Action: "*", iam:PassRole escalation paths, overly broad Trust Policies, or cluster-admin Kubernetes bindings. IAM Least-Privilege & K8s RBAC Auditor combines a strictly read-only Python static analyzer (scripts/audit_iam_rbac.py) with senior AWS, GCP, and Kubernetes RBAC hardening guides to flag escalation chains and generate minimal least-privilege replacements.
What It Detects (10 Cloud IAM & K8s RBAC Rules)
- AWS & Terraform IAM (
IAM-AWS-001–005):- Full wildcard admin policies (
Action: "*"+Resource: "*") &AdministratorAccesson workload roles - Privilege-escalation action chains (
iam:PassRole+ec2:RunInstances/lambda:CreateFunction/ecs:RunTask, oriam:CreatePolicyVersion/AttachRolePolicy/PutRolePolicyon*) - Public/confused-deputy Trust Policies (
Principal: "*"withoutExternalId/aws:SourceAccount) - Service wildcards (
s3:*,iam:*,kms:*,secretsmanager:*) onResource: "*"and staticaws_iam_access_keyusers vs OIDC
- Full wildcard admin policies (
- GCP IAM (
IAM-GCP-001): Primitiveroles/owner/roles/editorbindings andallUsers/allAuthenticatedUsersexposure. - Kubernetes RBAC (
IAM-K8S-001–004):cluster-adminbindings on app ServiceAccounts, wildcard*verbs/resources orescalate/bind/impersonate, broadsecretsread access withoutresourceNamesorpods/exec, and pods missingautomountServiceAccountToken: false.
How to Use
Ask your AI agent in any Terraform, AWS IAM, or Kubernetes repository:
- "Audit our Terraform IAM policies and EKS RBAC YAML for privilege-escalation paths ahead of SOC 2."
- "Replace our wildcard
s3:*andcluster-adminbindings with least-privilege policies."
Or invoke the read-only analyzer directly:
python3 scripts/audit_iam_rbac.py --path . --format markdown
What's Inside (16 Files)
SKILL.md— Deterministic 5-step least-privilege review withLOW/MEDIUM/HIGH/CRITICALBlast-Radius Risk Tier &A–Fgradescripts/audit_iam_rbac.py— Pure Python 3 stdlib analyzer for AWS JSON, Terraform HCL & multi-doc K8s YAML (--fail-onCI gate)references/— AWS privilege-escalation path catalog, Kubernetes RBAC hardening guide, and complete 10-rule catalogtemplates/&examples/— Blast-radius audit report, least-privilege policy diff template, and worked AWS + EKS SOC 2 audittests/— Overprivileged & least-privilege IAM/RBAC fixtures + runnable unit tests
Security & Privacy Guarantee
- 100% read-only & offline — never calls AWS/GCP/K8s APIs; skips
.env*,*.tfstate*,*.tfvars*,*.key,*.pem, andkubeconfig.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.
Static policy analysis of AWS IAM JSON, Terraform HCL, and Kubernetes RBAC YAML; does not simulate live AWS IAM Policy Simulator evaluations or inspect runtime cluster roles.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python 3.9+ (stdlib only)
Permissions
Bundled analyzer is 100% offline and read-only; skips .env, .tfstate, .tfvars, .key, .pem, and kubeconfig files. Write Files is only used after explicit user approval.