More Info:

Any unauthorized API calls made within your AWS account should be monitored using CloudWatch alarms to respond quickly to unapproved actions.

Risk Level

Medium

Address

Security

Compliance Standards

CISAWSF, PCI, APRA, MAS, NIST4, SOC2, HIPAA, ISO27001, AWSWAF, HITRUST

Triage and Remediation

Remediation

The “Authorization Failures” alarm in AWS CloudWatch should be configured to trigger whenever unauthorized API calls are made. To set this up using the AWS Console:

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon CloudWatch console.

  3. In the left-hand menu, under Logs, choose Log groups.

  4. Click on the name (link) of the log group associated with your Amazon CloudTrail trail.

  5. Select the Metric filters tab and choose Create metric filter.

  6. On the Create metric filter setup page, perform the following actions:

    • For Step 1: Define pattern, paste the following pattern in the Filter Pattern box:
      {($.errorCode = "*UnauthorizedOperation") || ($.errorCode = "AccessDenied*")}
      This will scan your Amazon CloudTrail logs for “AccessDenied” and “UnauthorizedOperation” events. Choose Next.

    • For Step 2: Assign metric, provide the following information:

      • In the Filter name box, enter a unique name for the new filter.
      • In the Metric namespace box, type CloudTrailMetrics.
      • In the Metric name box, type AuthorizationFailure.
      • In the Metric value box, type 1.
      • (Optional) Choose Count from the Unit – optional dropdown list.
      • Choose Next to continue.
  7. On the Metric filters panel, select the newly created metric filter and choose Create alarm.

  8. On the Create alarm setup page, perform the following actions:

    • For Step 1: Specify metric and conditions:

      • In the Metric section, select Sum from the Statistic list, and choose 5 minutes from the Period dropdown list.
      • In the Conditions section, select Static as Threshold type.
      • For Whenever AuthorizationFailure is, select Greater/Equal (greater than or equal to), and enter 1 in the configuration box to trigger the CloudWatch alarm.
      • Choose Next.
    • For Step 2: Configure actions, define the alarm state that will trigger the CloudWatch alarm action:

      • Select In alarm under Alarm state trigger.
      • Choose Select an existing SNS topic and select the name of the SNS topic created at Step 1.
      • Choose Next.
    • For Step 3: Add name and description, provide a unique name and a short description for your new CloudWatch alarm. Choose Next.

    • For Step 4: Preview and create, review the alarm configuration details, then choose Create alarm.
      Once the alarm is created, its State (status) will change from Insufficient data to OK.

Additional Reading: