Triage and Remediation
How to Prevent
Using Console
Using Console
To prevent root account activity from going unmonitored in AWS IAM using the AWS Management Console, follow these steps:
-
Enable CloudTrail for All Regions:
- Go to the AWS Management Console.
- Navigate to the CloudTrail service.
- Create a new trail or edit an existing one.
- Ensure that the trail is enabled for all regions to capture all root account activities across your AWS environment.
-
Set Up CloudWatch Alarms for Root Account Usage:
- Go to the CloudWatch service in the AWS Management Console.
- Create a new alarm.
- Set the metric to monitor root account usage (e.g.,
AWS/CloudTrail
metric forRootAccountUsage
). - Configure the alarm to send notifications (e.g., via SNS) when root account activity is detected.
-
Enable AWS Config Rules:
- Navigate to the AWS Config service in the AWS Management Console.
- Ensure that AWS Config is enabled and recording.
- Add a managed rule such as
root-account-mfa-enabled
to ensure that root account activity is monitored and that MFA is enabled for the root account.
-
Set Up SNS Notifications for Root Account Activity:
- Go to the SNS (Simple Notification Service) in the AWS Management Console.
- Create a new SNS topic.
- Subscribe your email or SMS to the topic.
- Configure CloudTrail or CloudWatch to send notifications to this SNS topic whenever root account activity is detected.
Using CLI
Using CLI
To prevent the misconfiguration of not monitoring root account activity in AWS IAM using the AWS CLI, you can follow these steps:
-
Enable CloudTrail for Logging:
Ensure that AWS CloudTrail is enabled to log all activities, including those performed by the root account.
-
Set Up CloudWatch Alarms for Root Account Usage:
Create a CloudWatch alarm to monitor root account activity. First, create a metric filter to capture root account usage from CloudTrail logs.
-
Create CloudWatch Alarm:
Create an alarm based on the metric filter to notify you when root account activity is detected.
-
Subscribe to SNS Topic for Notifications:
Ensure you have an SNS topic to receive notifications and subscribe to it.
Using Python
Using Python
To prevent root account activity from going unmonitored in AWS IAM using Python scripts, you can follow these steps:These steps will help you monitor and restrict root account activity, ensuring that any actions taken by the root account are logged, monitored, and controlled.