aws-iam-best-practices

Review and harden AWS IAM policies using least privilege principles and CLI audits.

Updated Sep 20, 2024
One-click install
npx skills add https://github.com/AnasIsmai1/dotfiles --skill aws-iam-best-practices-anasismai1
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aws-iam-best-practices
Source: https://github.com/AnasIsmai1/dotfiles/tree/main/claude/.claude/skills/security/aws-iam-best-practices
Command: npx skills add https://github.com/AnasIsmai1/dotfiles --skill aws-iam-best-practices-anasismai1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires boto3.

What problem does it solve? AWS IAM configurations often accumulate overly permissive policies, stale access keys, and users without MFA, creating security gaps that are tedious to audit manually across accounts. ## Core Features & Use Cases - Policy Auditing: Detect wildcard actions, inline policies, and overly permissive managed policies using AWS CLI queries and a Python boto3 hardening script. - Access Hygiene Checks: Find users without MFA, access keys older than 90 days, unused roles, and risky external trust relationships. - Ready-Made Policy Templates: Apply least privilege S3, MFA-enforcement, time-based, and IP-restriction policy JSON templates. - Use Case: Run the IAM hardening report before a quarterly security review to list users without MFA, aged access keys, and wildcard policies in one pass. ## Quick Start Ask the assistant to review your IAM setup for security issues and generate a hardening report covering MFA, key age, and permissive policies.

Frequently Asked Questions about aws-iam-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find overly permissive IAM policies in AWS?▼

List customer-managed policies with aws iam list-policies, fetch each default version document, and check for statements where Action is a wildcard. The included boto3 script automates this scan across all local policies.

How to check which IAM users have MFA enabled?▼

Use aws iam get-credential-report and filter rows where the MFA column is false, or call list_mfa_devices per user with boto3. Users with no MFA devices are flagged in the hardening report.

How do I rotate old IAM access keys safely?▼

Create a new access key, update applications to use it, set the old key to Inactive with aws iam update-access-key, verify nothing breaks, then delete the old key. Keys older than 90 days should be prioritized.

Can I test an IAM policy before applying it?▼

Yes, use aws iam simulate-principal-policy with the user or role ARN, action names, and resource ARNs to see whether specific calls would be allowed or denied without making real changes.

What are the limitations of automated IAM hardening checks?▼

The checks identify common misconfigurations but do not replace environment-specific validation or expert review. Results should be tested in non-production first, and organization-wide controls require SCPs beyond single-account scans.