Skip to main content
Amazon IAM (Identity and Access Management) is a secure AWS service that enables you to manage access to AWS resources. It allows you to create users, groups, roles, and policies to define permissions. IAM helps enforce the principle of least privilege by giving the right access to the right people or systems. The AWSIAMHandler provides asynchronous helper methods to list and audit IAM entities, including users, groups, roles, managed policies, MFA devices, and account-level security configurations.

Example

To create the AWSIAMHandler object, initialize it with AWS credentials and a region:
List IAM Users with Details:
Fetches all IAM users with attached/inline policies, MFA, login profiles, access keys, and groups.
List IAM Roles with Details:
Fetches IAM roles with trust policies, attached policies, inline policies, and instance profiles.
List IAM Groups with Details:
Lists IAM groups with members, attached managed policies, and inline policies.
List IAM Managed Policies:
Retrieves all IAM managed policies (AWS & customer-managed) along with their documents.
List MFA Enabled Users:
Returns IAM users with MFA devices enabled.
Get Account Summary:
Fetches IAM resource usage and quota (roles, groups, users, etc.).
Get Credential Report:
Retrieves IAM account credential report (CSV format) for auditing password age, MFA, and access key rotation.
List Virtual MFA Devices:
Lists assigned and unassigned virtual MFA devices.
Get Account Password Policy:
Retrieves password policy (complexity, expiry, rotation, etc.).
List Account Aliases:
Lists aliases for the AWS account.
List Organization Accounts:
Lists all accounts under AWS Organizations (if enabled).
Collect All IAM Data:
Fetches everything (users, groups, roles, policies, MFA, org accounts, etc.) in a single structured call.