More Info:

AWS S3 Buckets configuration changes should be monitored using CloudWatch alarms. An alarm should be configured to trigger every time an S3 bucket configuration change is made, such as changes to bucket policies, ACLs, or lifecycle configurations.

Risk Level

Medium

Address

Security

Compliance Standards

CISAWS, CBP, SOC2, NIST, AWSWAF, HITRUST, NISTCSF, PCIDSS, CISAWSF, PCI, APRA, MAS, NIST4

Triage and Remediation

Remediation

When you receive an S3 Bucket Changes Alarm, it indicates that there has been a change in the configuration of one of your S3 buckets. Here are the steps to remediate this issue in the AWS Console:

  1. Log in to your AWS Management Console and navigate to the CloudWatch dashboard at CloudWatch Console.

  2. In the left navigation panel, select Logs.

  3. Select the log group created for your CloudTrail trail event logs and click on Create Metric Filter.

  4. On the Define Logs Metric Filter page, paste the following pattern inside the Filter Pattern box:

{
    ($.eventSource = s3.amazonaws.com) && (($.eventName = PutBucketAcl) || ($.eventName = PutBucketPolicy) ||
    ($.eventName = PutBucketCors) || ($.eventName = PutBucketLifecycle) || ($.eventName = PutBucketReplication) ||
    ($.eventName = DeleteBucketPolicy) || ($.eventName = DeleteBucketCors) || ($.eventName = DeleteBucketLifecycle) ||
    ($.eventName = DeleteBucketReplication))
}

This pattern will be used for scanning the AWS CloudTrail logs for relevant event names.

  1. Review the metric filter configuration details and then click Assign Metric.

  2. On the Create Metric Filter and Assign a Metric page, provide the following:

    • In the Filter Name box, enter a unique name (e.g., S3BucketConfigChanges).
    • In the Metric Namespace box, type CloudTrailMetrics.
    • In the Metric Name box, type S3BucketEventCount.
    • Click Show advanced metric settings to expand the section.
    • In the Metric Value box, enter 1.
  3. Review the details and click Create Filter to generate your new CloudWatch Logs metric filter.

  4. Click Create Alarm on the same page:

  5. In the Create Alarm dialog box, enter a unique name and description for the alarm.

  6. Under Whenever: Metric Name, select >= (greater than or equal to) and enter 1 as the threshold value.

  7. In the Actions section, click the + Notification button, select State is ALARM, and choose the AWS SNS topic created earlier.

  8. In the Alarm Preview section, select 5 Minutes from the Period dropdown and Sum from the Statistic list.

  9. Review the configuration details and click Create Alarm. The new alarm will be listed on the Alarms page.

Additional Reading: