How do you find unused IAM users, keys and permissions?
IntermediateConceptGlobal Infrastructure and IAM Basics
Answer
Use the credential report for account-wide user/key age and last-used data, Access Advisor (iam generate-service-last-accessed-details) for service-level last access per identity, and Access Analyzer unused-access findings at scale.
aws iam generate-credential-report
aws iam get-credential-report --query Content --output text | base64 -d > cred.csv
Look at access_key_1_last_used_date, password_last_used and mfa_active columns.
More on Global Infrastructure and IAM Basics
What is the difference between a Region, an Availability Zone and an edge location?BeginnerHow do you choose a Region for a workload?BeginnerWhat is the difference between an AZ name like `us-east-1a` and an AZ ID like `use1-az1`?IntermediateExplain the shared responsibility model.BeginnerWhat is the root user and how should you treat it?BeginnerWhat is the difference between an IAM user, group and role?Beginner