Control: AWS > PCI v3.2.1 > CloudWatch > 1 A log metric filter and alarm should exist for usage of the 'root' user
This control checks for the CloudWatch metric filters using the following pattern:
{ $.userIdentity.type = "Root" && $.userIdentity.invokedBy NOT EXISTS && $.eventType != "AwsServiceEvent" }
It checks the following:
- The log group name is configured for use with active multi-Region CloudTrail.
- There is at least one Event Selector for a Trail with IncludeManagementEvents set to true and ReadWriteType set to All.
- There is at least one active subscriber to an Amazon SNS topic associated with the alarm.
Remediation
The steps to remediate this issue include setting up an Amazon SNS topic, a metric filter, and an alarm for the metric filter.
To create an Amazon SNS topic
- Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home.
- Create an Amazon SNS topic that receives all CIS alarms.
- Create at least one subscriber to the topic.
- For more information about creating Amazon SNS topics, see the Amazon Simple Notification Service Developer Guide.
- Set up an active CloudTrail trail that applies to all Regions.
- To do this, follow the remediation steps in CIS v1.3.0 3.1 Ensure CloudTrail is enabled in all Regions.
- Make a note of the associated log group name.
To create a metric filter and alarm
- Open the CloudWatch console.
- Choose Logs, then choose Log groups.
- Choose the log group where CloudTrail is logging.
- On the log group details page, choose Metric filters.
- Choose Create metric filter.
- Copy the following pattern and then paste it into Filter pattern.
{$.userIdentity.type="Root" && $.userIdentity.invokedBy NOT EXISTS && $.eventType !="AwsServiceEvent"}
- Enter the name of the new filter. For example, RootAccountUsage.
- Confirm that the value for Metric namespace is
LogMetrics
. - This ensures that all CIS Benchmark metrics are grouped together.
- In Metric name, enter the name of the metric.
- In Metric value, enter 1, and then choose Next.
- Choose Create metric filter.
- Next, set up the notification. Select the select the metric filter you just created, then choose Create alarm.
- Enter the threshold for the alarm (for example, 1), then choose Next.
- Under Select an SNS topic, for Send notification to, choose an email list, then choose Next.
- Enter a Name and Description for the alarm, such as
RootAccountUsageAlarm
, then choose Next. - Choose Create Alarm.
PCI requirement(s): 7.2.1
Resource Types
This control targets the following resource types:
Category
In Your Workspace
Developers
- tmod:@turbot/aws-pciv3-2-1#/control/types/logMetricFilterRootLogin
- tmod:@turbot/turbot#/control/categories/compliancePci
- turbot graphql controls --filter "controlTypeId:tmod:@turbot/aws-pciv3-2-1#/control/types/logMetricFilterRootLogin"
Get Controls
Control Type URI
Category URI
GraphQL
CLI