Overview
The IAM Audit tool follows the principle of least privilege. It requires specific permissions in two locations:- Management Account - to list Organization accounts and assume roles
- Member Accounts - to read IAM users, access keys, and CloudTrail events
Management Account Permissions
The identity running the audit from your management account needs two core permissions:List Organization Accounts
The
organizations:ListAccounts action retrieves all active accounts in your AWS Organization.Management Account Policy
Attach this policy to the IAM user or role executing the audit:Replace
NOMBRE-DEL-ROL-EN-CHILD-ACCOUNTS with your actual audit role name (e.g., IAMAuditRole or AWSControlTowerExecution).Member Account Permissions
Each member account requires a role with read-only IAM and CloudTrail permissions.Required Actions
The audit role queries the following AWS APIs:| Action | Purpose |
|---|---|
iam:ListUsers | Enumerate all IAM users in the account |
iam:ListAccessKeys | List access keys for each user |
iam:GetAccessKeyLastUsed | Retrieve last usage timestamp and service |
iam:ListMFADevices | Check MFA configuration status |
iam:GetLoginProfile | Determine console access status |
cloudtrail:LookupEvents | Query IAM events for remediation tracking |
Member Account Policy
Deploy this policy to the audit role in every member account:IAM is a global service, but CloudTrail events are regional. The tool queries
us-east-1 by default for CloudTrail data.Trust Relationship
The audit role in member accounts must trust your management account.Trust Policy Example
Attach this trust relationship to the audit role in member accounts:Security Best Practices
Use temporary credentials only
Use temporary credentials only
The tool uses
sts:AssumeRole to generate temporary credentials that expire automatically. Never store long-term access keys for audit operations.Limit AssumeRole scope
Limit AssumeRole scope
The management account policy restricts
sts:AssumeRole to a specific role name across accounts. This prevents lateral movement to other roles.Read-only permissions
Read-only permissions
The member account policy grants zero write permissions. The tool cannot modify IAM users, keys, or CloudTrail configurations.
CloudTrail logging
CloudTrail logging
All
AssumeRole operations are logged in CloudTrail. Review these events regularly to detect unauthorized audit runs.Validation
Before running the full audit, test your permissions:Next Steps
AWS Organization Setup
Deploy the audit role to member accounts using CloudFormation StackSets
Control Tower Integration
Use the pre-existing AWSControlTowerExecution role for audits
