Guide

AWS IAM Access Analyzer: How to Use It in an Access Review

What AWS IAM Access Analyzer finds, what it misses, how to set up unused access findings, and how to use them in a user access review an auditor can follow.

Part of the guide User Access Review: How to Run One, Step by Step

11 min readLast updated

Every quarter or half year, someone asks your cloud team for a list of who can get into AWS, and whether all of it is still needed. AWS has a feature that does part of that work for you: IAM Access Analyzer. This guide explains what it checks, what it cannot tell your reviewers, how to switch on the part that matters for a review, and how to turn its findings into a user access review an auditor can follow.

AWS IAM Access Analyzer is an AWS feature that reads your policies and activity and reports access worth a look: resources shared outside your account or organization, and IAM roles, users, access keys, passwords and permissions nobody used for a number of days you choose. It shows where to look. A person still decides what stays.

A few AWS words come up on this page:

  • IAM (Identity and Access Management) is the part of AWS that decides who can do what.
  • An IAM user is a login that lives in one AWS account. An IAM role is a set of permissions that a person or a program takes on for a while.
  • A policy is the document that lists what a user or role may do. A resource-based policy sits on a resource, such as a storage bucket, and says who may use it.
  • IAM Identity Center is the AWS service many companies use to let people log in once and reach several AWS accounts.

What IAM Access Analyzer checks

AWS describes three kinds of analyzer, each created on its own. You pick a scope when you create one: one account, or your whole organization. To cover a whole organization you create it from the management account or a delegated administrator account.

The three IAM Access Analyzer analyzers, from the AWS documentation
AnalyzerWhat it reportsWhere it looksCost
External accessResources, such as S3 buckets, KMS keys or IAM roles, whose policy lets someone outside your account or organization in.Only the Region it runs in. You need one per Region you use.Free.
Unused accessIAM roles with no activity, IAM user passwords and access keys not used, and permissions a role or user holds but did not use, all within the period you set.Findings do not change by Region. One analyzer is enough.Charged per IAM role and user analyzed, per analyzer, per month.
Internal accessWhich IAM users and roles inside your account or organization can reach resources you select, such as a bucket or a database table.Only the resources you select, in the Region it runs in.Charged per resource monitored, per analyzer, per month.

The AWS overview of IAM Access Analyzer lists the resource types each analyzer reads and the other things it does, such as checking a policy before you deploy it. The findings page sets out the cost model, and the pricing page has the rates.

For an access review, the unused access analyzer is the one to start with. It looks at every IAM user and role in scope, including service roles but not service-linked roles (roles that AWS services create and manage for themselves), and reports four kinds of finding:

  • Unused role. A role with no activity in the period.
  • Unused access key. A key belonging to an IAM user that was not used in the period.
  • Unused password. An IAM user’s console password that was not used in the period.
  • Unused permissions. Services and actions a role or user is allowed but did not use in the period.

The period is called the tracking period. You choose it, from 1 to 365 days. AWS only evaluates users and roles that have existed for the whole period, so with a 90-day period, a role created last month gets no finding yet.

What it cannot tell your reviewers

Access Analyzer answers “was this used?”, “is this shared outside?” and “who inside can reach this resource?”. A user access review asks a different question: should this person still have this access? Here is where the two part ways.

It sees roles, not people

Many companies give people AWS access through IAM Identity Center. AWS’s page on permission sets explains that when you assign a permission set, Identity Center creates a matching IAM role in each account and lets the people you assigned take it on. Everyone with the same permission set in an account shares that one role. So an unused role finding means none of them used it. If one of five people uses it, there is no unused role finding, and the other four keep their access unseen. The question “should Priya still have this?” needs the list of assignments from Identity Center, not the analyzer.

Unused is not the same as not needed

An emergency admin role that you keep for outages should go unused. So should a role a yearly job uses, if your tracking period is shorter than a year. These show up as findings, and the right answer is to keep them, with a reason written down. AWS lets you set archive rules, which archive findings that match criteria you define, so known cases stop coming back each run.

Used is not the same as needed

The analyzer is silent about access that is in use. A person who moved from engineering to sales last month and still uses their old production role gets no finding. Catching that is the job of a manager who knows what the person does now. It is how privilege creep builds up.

External access findings are about what a policy allows

AWS says the external access analyzer does not read access logs. It reports that a policy allows someone outside to get in, whether or not they ever did. That is useful: a bucket open to another company is worth a decision even if nobody used it yet.

A finding is not a review record

Your auditor wants to see who looked at each access, what they decided, when, and that removals happened. A finding holds a status (Active, Archived or Resolved) and dates, not a reviewer’s reason. Keep the decisions in your review record, and export the findings you used while the review runs, because they change each time the analyzer runs again.

How to set up an unused access analyzer

AWS’s guide to creating an unused access analyzer covers each screen. In short:

  1. Open the IAM console. Under Access analyzer, choose Analyzer settings, then Create analyzer.
  2. Under Analysis, choose Principal analysis - Unused access, and give the analyzer a name.
  3. Set the tracking period in days. A period as long as the time between two reviews matches what each review looks back on.
  4. Choose Current account, or Current organization if you are in the management account or a delegated administrator account.
  5. Optionally, exclude accounts, or users and roles that carry a tag you choose. Excluded entities get no findings, so record why you excluded them.
  6. Choose Create analyzer. Findings can take a while to appear.

The same thing with the AWS CLI, for one account with a 90-day period. The command and its options come from the create-analyzer reference:

ANALYZER_ARN=$(aws accessanalyzer create-analyzer \
  --analyzer-name unused-access-90d \
  --type ACCOUNT_UNUSED_ACCESS \
  --configuration '{"unusedAccess": {"unusedAccessAge": 90}}' \
  --query arn --output text)

For an organization, use --type ORGANIZATION_UNUSED_ACCESS from the management account or a delegated administrator account. The command stores the analyzer’s ARN, its full AWS name, in ANALYZER_ARN for the next step. An analyzer lives in one Region, so run the next command in the same Region, with the same --region or default Region.

How to export the findings for a review

AWS says unused access findings are only available through the newer ListFindingsV2 API, which the CLI calls list-findings-v2. This lists the active findings with the filter keys AWS documents and prints one line per finding:

aws accessanalyzer list-findings-v2 \
  --analyzer-arn "$ANALYZER_ARN" \
  --filter '{"status": {"eq": ["ACTIVE"]}}' \
  --query 'findings[].[findingType, resource, resourceOwnerAccount, id]' \
  --output text > unused-access-findings.tsv

The file has four columns: the finding type, the user or role, the account it lives in, and the finding’s id. For an unused permissions finding, the services and actions that went unused are in the finding’s details: open it in the console, or run aws accessanalyzer get-finding-v2 --analyzer-arn "$ANALYZER_ARN" --id <finding id>. Write the date on it. A review describes a moment, and findings change as the analyzer runs again.

Each finding type leads to a different question for the reviewer. The suggested actions are AWS’s own, from its page on resolving findings.

Unused access findings and what a reviewer decides
Finding typeQuestion for the reviewerWhat AWS suggests if it goes
UnusedIAMRoleWho or what is this role for, and will they need it again?Delete the role.
UnusedIAMUserAccessKeyDoes a program or a person still need this key?Deactivate or delete the key.
UnusedIAMUserPasswordDoes this person still need to log in to the console?Delete the password.
UnusedPermissionDoes this role or user need these services and actions at all?Replace the policy with a smaller one. The console can suggest it.

If Identity Center created the role, its name starts with AWSReservedSSO_. Do not delete or edit it in IAM: Identity Center manages that role and updates it when the permission set changes. Remove the assignment, or change the permission set, in Identity Center instead. AWS also offers no suggested smaller policy for these roles.

How to use the findings in a user access review

The findings are one input. The review itself still follows the usual steps, which the user access review checklist lists in full.

  1. Take the full list first. Export every IAM user, group and role in each account, the policies on each, and, if you use it, every Identity Center assignment: which person or group holds which permission set in which account. This is what reviewers decide on.
  2. Add the findings as a column. Match each finding to its line in the list. “Not used in 90 days” next to a line helps a reviewer decide in seconds.
  3. Send each line to someone who knows the work. People’s access goes to their manager. Roles used by programs go to the team that owns the program. PCI DSS covers those in requirement 7.2.5.1, with the interval set by your own targeted risk analysis. Admin access gets a second look, as the privileged user access review guide explains.
  4. Ask for a reason when unused access stays. An emergency role or a yearly job is a fine reason. Write it next to the decision. If you archive the finding in AWS, the finding does not hold the reason, so keep it in your record.
  5. Make the removals and check them. Your admins remove what reviewers rejected. After the analyzer runs again, the finding for a fully removed access changes to Resolved. If only part of it was removed, AWS resolves the old finding and opens a new one. Export your list again to see the access gone.
  6. Keep the record together. The dated export, the findings file, each decision with its reviewer, and the tickets for removals. The free user access review template has columns for the decision, reason, reviewer, date and removal ticket.

Tip: Two free checks if you skip the paid analyzer

The IAM credential report lists every IAM user in an account with when their password and access keys were last used. Run aws iam generate-credential-report, then aws iam get-credential-report --query Content --output text | base64 --decode > credential-report.csv, because AWS returns the report Base64-encoded. The credential report guide explains each column. IAM’s last accessed information shows which services each user, group, role and policy tried to use, usually going back at least 400 days. Neither one shows, by name, the people who come in through Identity Center.

What auditors look for

No framework names IAM Access Analyzer. What they ask for is a regular review of access and the removals that follow. If PCI DSS applies to you, requirement 7.2.4 of PCI DSS v4.0.1 says user accounts and their access privileges are reviewed at least once every six months, and that management acknowledges the access that remains is appropriate. SOC 2 and ISO 27001 set no review interval: your own policy sets it, and the auditor tests that you kept to it.

An analyzer report on its own shows that you looked for unused access. It does not show that anyone decided whether access that is in use is still right. Expect your auditor to ask for the list, the decisions and the removals. The findings make the list easier to judge, and they help you find orphaned accounts, such as an IAM user, or its access key, whose owner left.

Where Acciew fits

Acciew runs the review part for AWS. It reads IAM users, groups and roles, the policies attached to each, who may assume each role, and when each user and role was last used. It shows each manager the access of their people, with how they got it, such as a policy that comes through a group, and asks for a yes or no from an email link. At the end it builds the evidence pack. It only reads, and your admins make every change. It does not read IAM Identity Center. It is in early access, with design partners first.

Have an access review coming up?

Acciew is in early access. We are looking for design partners: teams with a user access review ahead of them.

Apply as a design partner

Questions and answers

What does AWS IAM Access Analyzer do?

It reads your AWS policies and activity and reports access worth a look. External access analyzers report resources shared outside your account or organization. Unused access analyzers report IAM roles, access keys, passwords and permissions that nobody used in a period you set. Internal access analyzers report who inside your organization can reach resources you select.

Is IAM Access Analyzer free?

Partly. AWS gives external access findings for free. Unused access findings are charged by the number of IAM roles and users analyzed per analyzer per month, and internal access findings by the number of resources monitored. The AWS pricing page has the current rates.

Does IAM Access Analyzer replace a user access review?

No. It tells you which access went unused or is shared outside, which is a strong hint. It does not say whether a person still needs the access they use, and it records no decision by a reviewer. Use its findings as a column in your review, not as the review.

Do I need an unused access analyzer in every Region?

No. AWS says unused access findings do not change based on Region, so one analyzer is enough, and each extra one is charged. External access is different. It only covers resources in the Region where the analyzer runs, so you need one external access analyzer in each Region you use.

How do I check which IAM users have not logged in to AWS?

Download the IAM credential report, from the IAM console or with the AWS CLI. Its password_last_used column shows when each user last used their password to log in to an AWS website such as the console, and the access key columns show when each key was last used. It does not cover people who come in through IAM Identity Center.