aws-iam-review
Skill0 starsChanged 14 days agoMITView on GitHub
Review AWS IAM for over-privilege and escalation paths — admin/wildcard policies, PassRole and other escalation actions, risky trust policies (external accounts, wildcard principals, weak OIDC conditions), stale users and keys, root usage, unused access — with IAM Access Analyzer, credential reports and a bundled tested policy linter. Use for AWS account security reviews, least-privilege projects, or after credential compromise.
In this repository273 other files it gives its agents.
- ad-attack-path-analysisSkill
- adcs-security-reviewSkill
- ad-privileged-access-reviewSkill
- dcsync-detectionSkill
- gpo-security-reviewSkill
- kerberos-attack-detectionSkill
- agent-tool-permission-reviewSkill
- ai-incident-responseSkill
- llm-gateway-controlsSkill
- llm-security-evaluationSkill
- mcp-server-security-reviewSkill
- model-artifact-securitySkill
- prompt-injection-reviewSkill
- rag-security-reviewSkill
- api-abuse-detectionSkill
- api-authorization-testingSkill
- api-inventorySkill
- api-schema-securitySkill
- dast-baselineSkill
- sast-triageSkill
- sca-dependency-riskSkill
- secure-code-reviewSkill
- security-requirementsSkill
- threat-modelingSkill
- asset-criticality-tieringSkill
- asset-inventory-reconciliationSkill
- external-attack-surface-reviewSkill
- shadow-it-discoverySkill
- aws-credential-compromiseSkill
- aws-org-guardrailsSkill
- cloudtrail-investigationSkill
- guardduty-triageSkill
- s3-exposure-reviewSkill
- azure-activity-investigationSkill
- azure-rbac-reviewSkill
- conditional-access-reviewSkill
- entra-audit-investigationSkill
- entra-signin-investigationSkill
- backup-assuranceSkill
- critical-service-mappingSkill
- ransomware-recoverySkill
- recovery-exerciseSkill
- cloud-exposure-reviewSkill
- cloud-incident-responseSkill
- cloud-logging-baselineSkill
- cloud-posture-assessmentSkill
- audit-evidence-packageSkill
- continuous-control-monitoringSkill
- control-mappingSkill
- control-testing-samplingSkill
- container-incidentSkill
- dockerfile-hardeningSkill
- image-scanningSkill
- runtime-detection-falcoSkill
- db-audit-loggingSkill
- db-exfiltration-investigationSkill
- db-hardeningSkill
- db-privilege-reviewSkill
- data-classificationSkill
- data-discoverySkill
- The first 60 shown.
The file
Files
AWS IAM Review
Collect
aws iam get-account-authorization-details > auth.json # all users, roles, groups, policies (incl. trust)
python3 scripts/iam_policy_lint.py auth.json --min-severity medium # bundled linter (exit 1 on critical)
aws iam generate-credential-report && aws iam get-credential-report --query Content --output text | base64 -d > cred.csv
aws accessanalyzer list-findings --analyzer-arn <external-access-analyzer-arn> --filter '{"status":{"eq":["ACTIVE"]}}'
aws accessanalyzer validate-policy --policy-type IDENTITY_POLICY --policy-document file://policy.jsonIAM Access Analyzer: external access analyzer (resources shared outside the zone of trust), unused access analyzer (unused roles, keys, permissions), and policy generation from CloudTrail activity for least privilege.
Credential report checks (cred.csv)
root:access_key_1_activemust be false; MFA on;password_last_usedrecent = investigate.- Users with
password_enabledand nomfa_active. - Access keys older than 90 days (
access_key_1_last_rotated) or unused (access_key_1_last_used_dateN/A). - Users with console + keys — prefer SSO (IAM Identity Center) for humans; no long-term keys for humans.
Trust policy red flags
"Principal": {"AWS": "*"}or"*"without strict conditions.- Cross-account trust to unknown accounts; third-party roles without
sts:ExternalIdcondition (confused deputy). - OIDC federation (GitHub Actions, EKS IRSA) without
subrestriction — e.g.token.actions.githubusercontent.com:submust name repo and branch/environment. - SAML providers you don't recognize.
Escalation actions (if granted broadly)
iam:PassRole with compute creation (ec2:RunInstances, lambda:CreateFunction, glue:CreateDevEndpoint, cloudformation:CreateStack), iam:CreatePolicyVersion, iam:Attach*/Put*Policy, iam:CreateAccessKey on other users, iam:UpdateAssumeRolePolicy, ssm:SendCommand/StartSession on privileged instances, lambda:UpdateFunctionCode on privileged functions.
Output
Principal | Finding | Evidence (policy/statement) | Severity | Fix | Owner plus metrics: users without MFA, keys > 90 days, admin principals count, external trusts.
Related skills
aws-org-guardrails, aws-credential-compromise, cloudtrail-investigation, privileged-access-review
References
- IAM security best practices: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
- IAM Access Analyzer: https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html
- Credential report: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html
- Rhino Security Labs AWS IAM privilege escalation methods: https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

