Overview
This page documents known limitations, architectural constraints, and operational considerations when usingiam-audit. Understanding these limitations will help you interpret results correctly and plan remediations.
CloudTrail Regional Limitation
Why This Matters
IAM is a global service, but CloudTrail events are regional. All IAM API calls (regardless of where they originate) generate CloudTrail events inus-east-1 by default.
Affected Code:
What This Means
✅ Captured: All IAM events (CreateUser, DeleteAccessKey, etc.) across all regions
❌ Not Captured: Regional service events in other regions (e.g., EC2, S3 in eu-west-1)
Workaround
If you need multi-region CloudTrail coverage:- Create an organization-wide CloudTrail trail
- Query events from a centralized S3 bucket using Athena
- Modify the script to query multiple regions:
Accounts Without Audit Role
Expected Behavior
When the script cannot assume the audit role:Why This Happens
- Role not deployed in the target account
- Trust policy missing or misconfigured
- Role name mismatch (typo in
--roleargument) - Account is suspended or inaccessible
How to Detect
A skipped account is itself a security finding. It indicates gaps in your organization’s security baseline.
- Check console output for
Error en cuentamessages - Compare the number of accounts in Organizations vs. accounts in the CSV report
- Use AWS CLI to verify role deployment:
Resolution
Option 1: Deploy the audit role using CloudFormation StackSetsAWSControlTowerExecution role (if available)
Root Account Keys Not Audited
Why
The IAM API (list_users) only returns IAM users, not the root account. Root account credentials are managed separately.
Impact
You will not see root access keys in the audit report, even if they exist.Workaround
Manually check root credentials:- Log into each account as root
- Go to My Security Credentials
- Check the Access keys section
iam-root-access-key-check managed rule:
Future Work
This limitation is documented in the roadmap:Source: README.md:162
- Detección de root account keys
Pagination Considerations
IAM User Pagination
The script uses pagination correctly forlist_users and list_accounts:
CloudTrail Pagination
CloudTraillookup_events also uses pagination:
No manual pagination limits are needed. Boto3 handles pagination automatically.
API Rate Limits and Throttling
IAM API Throttling
The script makes multiple IAM API calls per user:list_access_keyslist_mfa_devicesget_login_profileget_access_key_last_used
Mitigation Strategies
1. Add exponential backoff (recommended):CloudTrail Rate Limits
lookup_events is rate-limited to 2 requests per second per account.
With the current implementation:
- 5 event types × number of accounts = total requests
- Pagination adds additional requests
Console Output Language
Error messages and console output are in Spanish:CSV Field Values
Some CSV fields contain Spanish values:password_status:"Configurada"or"No configurada"password_last_used:"Nunca"last_used_date:"Nunca utilizada"
Impact
If you’re building automation on top of the CSV output, use these exact strings in your logic:Workaround
To localize output, modify these strings in iam_audit.py:Hardcoded Date Range
Current implementation:Impact
CloudTrail events are only retrieved from February 18, 2026 onwards. Events before this date are not included in the report.Workaround
Modify the script to accept date range as CLI arguments:IAM Permissions Scope
The audit role requires read-only IAM permissions:What’s NOT Included
❌ IAM policies attached to users ❌ Group memberships ❌ Inline policies ❌ Permission boundaries ❌ IAM roles (only users are audited)Why This Matters
The audit focuses only on long-term credentials (access keys and passwords). It does not evaluate what permissions those credentials have.To audit permissions, consider using AWS IAM Access Analyzer or AWS Config’s
iam-policy-no-statements-with-admin-access rule.No Real-Time Monitoring
The script is a point-in-time audit, not a continuous monitoring solution.Limitations
- Must be run manually or scheduled (e.g., via cron, Lambda)
- No alerting for new access keys created after the audit
- No integration with AWS Security Hub or GuardDuty
Future Roadmap
Planned features to address this:Source: README.md:164-167
- Integración con AWS Security Hub (custom findings)
- Alertas por Slack / email para keys de alto riesgo
- Ejecución programada vía Lambda
CSV File Overwrites
Filename format:Cleanup Recommendation
Empty Report Scenarios
No Findings
If the script outputs:- ✅ Good news: No IAM users have access keys (ideal state)
- ⚠️ All accounts were skipped due to role assumption errors
- ⚠️ The management account profile has no access to Organizations
No CloudTrail Events
IfTotal de eventos CloudTrail encontrados: 0:
Possible causes:
- No IAM events occurred in the specified date range
- CloudTrail is not enabled in the accounts
- CloudTrail lookup permissions are missing
- Events are older than CloudTrail retention (90 days by default)
Summary
| Limitation | Severity | Workaround Available |
|---|---|---|
| CloudTrail only in us-east-1 | Low | Yes (multi-region query) |
| Accounts without role skipped | Medium | Yes (deploy role via StackSets) |
| Root keys not audited | High | Manual check or AWS Config |
| API rate limits | Medium | Yes (exponential backoff) |
| Hardcoded date range | Low | Yes (CLI arguments) |
| Spanish console output | Low | Yes (modify strings) |
| No real-time monitoring | Medium | Planned (Lambda/Security Hub) |
| No permission analysis | Low | Use IAM Access Analyzer |
These limitations are documented as of the current version. Check the GitHub repository for updates and community workarounds.
