Sub topic 7
Triage: finding status, filters and queries
This chapter assumes you have created at least one analyzer and can read the JSON policy documents behind findings. It covers how to work through a list of findings: what each status means, how to narrow the list, and how to record your decision.
Finding status
Every finding has one of three statuses.
| Status | Meaning | Who sets it |
|---|---|---|
| `ACTIVE` | The access exists and nobody has reviewed it. | Access Analyzer |
| `ARCHIVED` | You reviewed it and decided to keep it hidden from the active list. | You, or an archive rule |
| `RESOLVED` | The access that caused the finding no longer exists. | Access Analyzer |
You cannot set RESOLVED yourself. Access Analyzer sets it after you change the policy, delete the resource or remove the unused permission, and the analyzer scans again. If the same access returns later, an active finding appears again.
Listing and filtering findings
Always filter by status first. Without a filter, the list includes archived and resolved findings, which hides the work that remains.
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--filter '{
"status": {"eq": ["ACTIVE"]},
"resourceType": {"eq": ["AWS::S3::Bucket"]},
"isPublic": {"eq": ["true"]}
}' \
--query 'findings[].[id,resource,findingType,status]' \
--output tableEach filter key takes one operator: eq, neq, contains or exists. Several keys in one filter are combined with AND. Several values in one eq list are combined with OR. Common keys are:
status,resourceType,resourceandfindingTypefor any analyzer.isPublicandprincipal.AWSfor external access findings.resourceOwnerAccountto focus on one account in an organization.
For unused access, filter on findingType to separate the categories. UnusedIAMRole and UnusedPermission need different fixes.
aws accessanalyzer list-findings-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-unused \
--filter '{
"status": {"eq": ["ACTIVE"]},
"findingType": {"eq": ["UnusedPermission"]}
}'The --query option is the AWS CLI's own JMESPath filter. It reshapes the output after Access Analyzer has returned it. Use --filter to reduce what the service returns, and --query only to choose columns.
Recording a decision
Read the details of one finding before you decide.
aws accessanalyzer get-finding-v2 \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--id FINDING_IDFor an external access finding, check the principal, the action and any condition. Then pick one of two outcomes:
- The access is a mistake. Fix the policy, wait for the rescan, and let the status become
RESOLVED. - The access is intended. Archive the finding.
aws accessanalyzer update-findings \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-external \
--ids FINDING_ID \
--status ARCHIVEDTo reverse the decision, run the same command with --status ACTIVE.
A practical triage order
- List active findings with
isPublicset totrue. These are the highest risk. - List the remaining active external findings and check each principal against your known accounts.
- List active
UnusedIAMRolefindings, thenUnusedPermissionfindings. - Archive findings that are intended. If the same kind keeps appearing, an archive rule is better than archiving by hand, as the next chapter shows.
Exercise
You want a list of active external access findings for S3 buckets in one member account, and you want the output limited to the resource and finding ID. Which options do you use, and which part does each do?
Show answer
Use --filter with status eq ACTIVE, resourceType eq AWS::S3::Bucket and resourceOwnerAccount eq the account ID. The service applies this filter. Then add --query 'findings[].[id,resource]' to choose the columns. The CLI applies that locally after the results return.