Sub topic 7
Triage: finding status, filters and queries
This chapter assumes you can run AWS CLI commands and read their JSON output. It also assumes you have created an external access analyzer and an unused access analyzer, as in the earlier chapters, and that both have produced findings. Here you learn to work through those findings efficiently: what each status means, how to narrow the list with filters, and how to change a finding's status without hiding real risk.
Why triage matters
A new analyzer can report dozens or hundreds of findings. Many are intended, such as a public website bucket or a partner role. Others are stale, such as a role unused for 90 days that someone already deleted. If you read every finding as if it were new, you will either burn out or stop looking. Triage turns the raw list into a short queue of items that need a decision.
Triage has three tools:
- Status tells you whether a finding is still open.
- Filters narrow the list server-side by attributes such as resource type or finding type.
- Queries (JMESPath with
--query) reshape and narrow the result on your own machine.
Finding status
Every finding has one of three statuses.
| Status | Meaning | Who or what sets it |
|---|---|---|
| `ACTIVE` | The access is present and no one has dismissed the finding. | Access Analyzer, when it creates the finding. You can also set it back manually. |
| `ARCHIVED` | You have decided the finding does not need action now. | You (console or `update-findings`) or an archive rule. |
| `RESOLVED` | The access no longer exists, for example because the resource was deleted or the policy changed. | Access Analyzer, on a later scan. |
You cannot set RESOLVED yourself. It is a statement by the analyzer that the condition is gone. This is useful for verification: after you remove a permission, rerun your query and check that the finding moved to RESOLVED instead of assuming the change worked.
ARCHIVED is your decision, so it can become wrong over time. An archived finding for a partner bucket stays archived even if the partner changes. Review archived findings periodically, and give every archive a reason that you can write down elsewhere (a ticket, a tag, a rule name).
Listing findings with filters
Use list-findings-v2 for both external access and unused access analyzers. The older list-findings command works only for external access findings and lacks unused access fields, so prefer the -v2 version.
The --filter option takes a JSON map. Each key is an attribute name. Each value is a criterion with one of these operators:
eq: the attribute equals any value in the list.neq: the attribute equals none of the values in the list.contains: the attribute contains any of the values in the list.exists:trueorfalse, for whether the attribute is present.
Several keys in one filter are combined with AND. Several values inside one eq are combined with OR.
Common filter keys for triage:
| Key | Use |
|---|---|
| `status` | Separate open from dismissed or fixed findings. |
| `findingType` | For example `ExternalAccess`, `UnusedIAMRole`, `UnusedIAMUserAccessKey`, `UnusedIAMUserPassword`, `UnusedPermission`. |
| `resourceType` | For example `AWS::S3::Bucket`, `AWS::IAM::Role`, `AWS::KMS::Key`. |
| `resource` | One specific resource ARN. |
| `resourceOwnerAccount` | Findings for one account, useful from an organization analyzer. |
| `isPublic` | Only findings that grant access to everyone. |
| `principal.AWS` | The external AWS principal that receives access. |
| `condition.<key>` | Findings that involve a given condition key. |
Start with the most urgent question: which active external findings are public?
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--filter '{"status":{"eq":["ACTIVE"]},"isPublic":{"eq":["true"]}}' \
--query 'findings[].[id,resourceType,resource,createdAt]' \
--output tableNext, look only at unused roles in the unused access analyzer. Each key is ANDed, so this returns active findings for role resources only:
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-unused \
--filter '{"status":{"eq":["ACTIVE"]},"findingType":{"eq":["UnusedIAMRole"]}}' \
--query 'findings[].[id,resource,updatedAt]' \
--output tableTo check whether earlier fixes worked, flip the status:
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-unused \
--filter '{"status":{"eq":["RESOLVED"]}}' \
--query 'findings[].[findingType,resource,updatedAt]' \
--output tableServer-side filters and client-side queries
These two mechanisms look similar but behave differently.
--filteris sent to the service. Only matching findings come back, so it reduces the volume of data and the number of pages.--queryis applied by the CLI after the response arrives. It cannot reduce what the service sends. Use it to choose columns or to filter on fields the service does not support as filter keys.
For example, --filter has no "older than 30 days" operator. Combine a server-side filter with a client-side JMESPath comparison on createdAt. ISO 8601 timestamps in the same time zone compare correctly as strings:
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--filter '{"status":{"eq":["ACTIVE"]}}' \
--query "findings[?createdAt<'2026-10-27T00:00:00+00:00'].[id,resource,createdAt]" \
--output tableChoose the cutoff yourself. If the output is empty, check the timestamp format your CLI prints for createdAt before trusting the comparison, because a format mismatch also returns nothing.
Sorting
Add --sort to order results, so the newest or most recently changed findings come first:
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--filter '{"status":{"eq":["ACTIVE"]}}' \
--sort '{"attributeName":"UpdatedAt","orderBy":"DESC"}' \
--max-results 20 \
--query 'findings[].[id,resource,updatedAt]' \
--output table--max-results limits each page. The CLI normally follows pagination tokens for you, so use --max-items or --no-paginate if you want to stop early.
Reading one finding in detail
A list row tells you what and where. To decide what to do, you need the details: which principal gets access, through which action, under which condition. Fetch a single finding with get-finding-v2:
aws accessanalyzer get-finding-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--id FINDING_IDFor an external finding, read the findingDetails section for the principal, the access level and any conditions. For an unused access finding, read the last-accessed information and, for permissions, the unused actions and services.
Changing status
Use update-findings to archive or reactivate findings by ID. You can also pass --resource-arn to change every finding for one resource.
aws accessanalyzer update-findings \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--status ARCHIVED \
--ids FINDING_ID_1 FINDING_ID_2To bring a finding back into the active queue:
aws accessanalyzer update-findings \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--status ACTIVE \
--ids FINDING_ID_1A practical triage routine
Work in this order. It puts the highest risk first and keeps the queue from growing.
- List active public findings (
isPublicequalstrue). Fix or justify each one the same day. - List the remaining active external findings, grouped by
resourceType. Look at theprincipal.AWSvalues. An unknown account ID is a stronger signal than one you recognize. - Archive findings whose access is intended, ideally through an archive rule (next chapter) instead of one-off updates.
- List active unused access findings by
findingType. Credentials (UnusedIAMUserAccessKey,UnusedIAMUserPassword) and whole roles (UnusedIAMRole) are easier to act on than individual permissions (UnusedPermission). - After changes, list
RESOLVEDfindings to confirm they closed.
Common errors and gotchas
- Empty result after a correct-looking filter. Filter values are strings, so write
"true"and nottrueforisPublic. Keys are case-sensitive. - Mixing up analyzers. An ARN for the external analyzer returns no
UnusedPermissionfindings. Check the analyzer ARN before you decide a category is clean. - Wrong Region. Analyzers are Regional, and external access findings are reported in the Region of the analyzer that scans the resource. Run the same query in each Region you use.
- Treating
--queryas a filter. If a command is slow or returns many pages, move the condition into--filterwhere you can. - Archived does not mean safe. Review archived findings on a schedule.
Exercise
You want a table of the IDs and resource ARNs of active findings for IAM roles that were created more than 30 days ago, from an unused access analyzer. Which parts of your command should be a server-side --filter and which a client-side --query?
Show answer
Put status equal to ACTIVE and resourceType equal to AWS::IAM::Role (or findingType equal to UnusedIAMRole) in --filter, because the service supports those keys. Put the age comparison on createdAt in --query with JMESPath, because --filter has no date comparison operator. Use --query also to select the id and resource columns, with --output table.
Exercise
After you remove an unused permission from a role's policy, how do you confirm the fix worked, and why can you not just set the finding to RESOLVED yourself?
Show answer
Wait for the analyzer to scan again, then run list-findings-v2 with status equal to RESOLVED (or get-finding-v2 for that ID) and check that the finding is there. RESOLVED is assigned only by Access Analyzer when it sees that the access no longer exists. Manual status changes are limited to ACTIVE and ARCHIVED, so the status serves as independent evidence of the change.