Sub topic 1
What IAM Access Analyzer does and why it matters
IAM Access Analyzer examines AWS policies and activity to identify access that is broader than intended. It can show when a resource is reachable from outside your account or organization, and when IAM access has not been used. These findings help you reduce unintended exposure and apply least privilege.
Prerequisites
This chapter assumes you understand IAM users, roles, identity-based policies, resource-based policies, and JSON policy elements such as Principal, Action, Resource, and Condition. You should also be able to run basic AWS CLI commands and understand AWS accounts and Organizations.
Defining the zone of trust
A zone of trust is the set of AWS principals that you consider trusted. For an account analyzer, the zone normally contains one AWS account. For an organization analyzer, it can contain the organization and its accounts.
Access outside this zone is external access. The analyzer does not decide whether that access is good or bad. It reports the access so you can compare it with your design.
External access and unused access analyzers
External access analyzers inspect resource policies and identify resources that can be accessed by principals outside the zone of trust. For example, an Amazon S3 bucket policy with "Principal": "*" may create a public-access finding.
Unused access analyzers inspect IAM activity over a tracking period. They can identify unused roles, access keys, passwords, and permissions. A permission that was unused during the period may still be needed later, so treat the finding as evidence for review rather than proof that removal is safe.
| Analyzer | Main question |
|---|---|
| External access | Who outside the trust zone can access this resource? |
| Unused access | Which identities or permissions have not been used? |
Creating analyzers and choosing a tracking period
Create analyzers in the AWS account and Region where you want findings. Use an organization analyzer when centralized analysis is required and you have the required Organizations permissions.
aws accessanalyzer create-analyzer \
--analyzer-name account-unused \
--type ACCOUNT_UNUSED_ACCESS \
--configuration '{"unusedAccess":{"unusedAccessAge":90}}'The 90-day setting means Access Analyzer evaluates unused access against that period. Choose a period that covers normal operational cycles. A period that is too short can flag seasonal or emergency access prematurely.
Exercise
What is the main difference between an external access analyzer and an unused access analyzer?
Show answer
An external access analyzer finds access outside the zone of trust, while an unused access analyzer finds identities or permissions that have not been used during the tracking period.