More Info:

Inactive roles should be cleaned up.

Risk Level

Low

Address

Security

Compliance Standards

CBP

Triage and Remediation

How to Prevent

To prevent inactive roles in IAM using the AWS Management Console, follow these steps:

  1. Regularly Review IAM Roles:

    • Navigate to the IAM dashboard in the AWS Management Console.
    • Click on “Roles” to view the list of all IAM roles.
    • Regularly review the list of roles to identify any that have not been used for a significant period.
  2. Enable CloudTrail Logging:

    • Go to the CloudTrail service in the AWS Management Console.
    • Ensure that CloudTrail is enabled to log all API activity.
    • Use CloudTrail logs to monitor the usage of IAM roles and identify inactive ones.
  3. Set Up Automated Alerts:

    • Use AWS Config to create a rule that checks for IAM roles that have not been used within a specified period.
    • Set up Amazon SNS (Simple Notification Service) to send alerts when the rule is triggered, indicating an inactive role.
  4. Implement Lifecycle Policies:

    • Establish and document a policy for the lifecycle of IAM roles within your organization.
    • Ensure that roles are reviewed periodically (e.g., quarterly) and that any roles identified as inactive are flagged for removal according to the policy.

By following these steps, you can proactively manage and prevent the accumulation of inactive IAM roles in your AWS environment.

Additional Reading: