Triage and Remediation
How to Prevent
Using Console
Using Console
To prevent User Account Service Inactivity in IAM using the AWS Management Console, follow these steps:
-
Enable IAM Access Analyzer:
- Navigate to the IAM dashboard in the AWS Management Console.
- In the left-hand navigation pane, select “Access Analyzer.”
- Click on “Create analyzer” and follow the prompts to enable IAM Access Analyzer. This tool helps you identify inactive IAM users and roles.
-
Set Up Password Policy:
- In the IAM dashboard, select “Account settings” from the left-hand navigation pane.
- Under “Password policy,” configure settings such as password expiration and password reuse prevention. This ensures that users must periodically update their passwords, reducing the risk of inactive accounts.
-
Enable CloudTrail Logging:
- Go to the CloudTrail dashboard in the AWS Management Console.
- Click on “Create trail” and follow the prompts to enable logging for all regions.
- Ensure that CloudTrail is configured to log IAM actions. This helps you monitor user activity and identify inactive accounts.
-
Set Up Automated Notifications:
- Navigate to the CloudWatch dashboard in the AWS Management Console.
- Create a new rule to monitor IAM user activity.
- Set up an alarm to trigger an SNS (Simple Notification Service) notification if a user account has been inactive for a specified period. This allows you to take proactive measures to address inactivity.
Using CLI
Using CLI
To prevent User Account Service Inactivity in IAM using AWS CLI, you can follow these steps:
-
Create an IAM Policy to Enforce Password Rotation:
Ensure that users are required to change their passwords regularly to prevent inactivity. Create a policy that enforces password rotation.
-
Enable MFA for IAM Users:
Require Multi-Factor Authentication (MFA) for all IAM users to ensure that accounts are actively used and secured.
-
Set Up CloudWatch Alarms for Inactive Users:
Create CloudWatch alarms to monitor and alert you when users have not logged in for a specified period.
-
Automate Inactive User Deactivation:
Use a Lambda function to automatically deactivate users who have been inactive for a specified period. This requires setting up a Lambda function and a CloudWatch event rule to trigger it.
Using Python
Using Python
To prevent User Account Service Inactivity in IAM using Python scripts, you can follow these steps:By following these steps, you can automate the process of identifying and deactivating inactive IAM users using Python scripts, thereby preventing user account service inactivity in AWS IAM.