Unattached policies are not removed

Description

AWS IAM policies define and control access permissions for IAM users, roles, and groups within an AWS account. A policy is considered unattached when it is not associated with any principals (such as users, roles, or groups).

To reduce the risk of unauthorized access, it is crucial to monitor both the usage and non-usage of IAM policies. This proactive tracking helps prevent inadvertent modifications or misassignments of unattached policies, which could inadvertently grant unauthorized or excessive access to AWS resources.

Fix - Runtime

CLI command

To remove a policy, use the following command:

aws iam delete-policy --policy-arn <value>
ReLambda