A CloudWatch Alarm that triggers if a root user uses the account.

 
Tags
Root Account
Items
2
Size
0.9 KB
Missing Parameters
AWSTemplateFormatVersion: '2010-09-09'
Resources:
  CloudWatchAlarm:
    Type: 'AWS::CloudWatch::Alarm'
    Properties:
      AlarmName: root_account_login
      AlarmDescription: A CloudWatch Alarm that triggers if a root user uses the account.
      MetricName: RootUserEventCount
      Namespace: CloudTrailMetrics
      Statistic: Sum
      Period: '60'
      EvaluationPeriods: '1'
      Threshold: '1'
      ComparisonOperator: GreaterThanOrEqualToThreshold
      AlarmActions:
        - ''
      TreatMissingData: notBreaching
  MetricFilter:
    Type: 'AWS::Logs::MetricFilter'
    Properties:
      LogGroupName: ''
      FilterPattern: >-
        { ($.userIdentity.type = "Root") && ($.userIdentity.invokedBy NOT
        EXISTS) && ($.eventType != "AwsServiceEvent") }
      MetricTransformations:
        - MetricValue: '1'
          MetricNamespace: CloudTrailMetrics
          MetricName: RootUserEventCount
Parameters: {}
Metadata: {}
Conditions: {}

Customize Cf Template

Alarm Configuration


Metric Filter Configuration


* Required field