Sub topic 3
Removing Unused Access Without Breaking Workloads
Assume you understand IAM roles, policies, CloudTrail, AWS Organizations, and the AWS CLI. IAM Access Analyzer helps reduce permissions, but a finding is evidence for investigation, not an instruction to delete access immediately.
Remove Access in Small, Reversible Steps
For an unused role or permission, first identify the workload, owner, and deployment path. Check CloudTrail activity and application configuration. Then remove one permission or credential at a time. Deploy the change in a test environment before production, and keep the previous policy available for rollback.
| Check | Question |
|---|---|
| Owner | Which team owns this role or user? |
| Activity | Is the access used outside the analyzer’s observation period? |
| Dependency | Could a scheduled job or emergency process need it later? |
Use Recommendations to Right-Size Policies
For supported unused-access findings, request a recommendation. The result identifies permissions that can be removed or narrowed.
aws accessanalyzer get-finding-recommendation \
--analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-unused \
--id FINDING_IDReview the recommendation against the workload, apply the smallest policy change, and test it. Do not replace a policy automatically just because the recommendation exists.
Automate Alerts with EventBridge
EventBridge can route new findings to Amazon SNS, a ticketing system, or a controlled remediation workflow.
{
"source": ["aws.access-analyzer"],
"detail-type": ["Access Analyzer Finding"]
}Keep remediation approval separate from notification. Automation should usually create a ticket first, especially for production roles.
Validate Before Deployment
Validate policy syntax and IAM best practices, then compare a proposed policy with the current policy:
aws accessanalyzer validate-policy \
--policy-type IDENTITY_POLICY \
--policy-document file://policy.json
aws accessanalyzer check-no-new-access \
--policy-type IDENTITY_POLICY \
--existing-policy-document file://policy-current.json \
--new-policy-document file://policy-proposed.jsonGenerate Policies from CloudTrail
Use Access Analyzer policy generation with CloudTrail activity to create a starting policy for a workload. Treat the generated policy as a draft. Add known delayed or exceptional operations before testing it.
Operate Across an Organization
An organization analyzer evaluates resources across an AWS Organization when configured by the management account or a delegated administrator. Assign ownership for findings, use archive rules for approved sharing, and standardize EventBridge routing across accounts and Regions. Check service quotas and analyzer costs before enabling broad coverage.
Exercise
Why should an unused permission be tested before removal?
Show answer
The analyzer may not observe infrequent, delayed, or emergency activity that still depends on the permission.