More Info:

AWS VPC Customer/Internet Gateway configuration changes should be monitored using CloudWatch alarms.

Risk Level

Medium

Address

Security

Compliance Standards

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

Triage and Remediation

Remediation

To remediate the “Internet Gateway Changes Alarm” misconfiguration in AWS using the AWS console, follow these steps:

  1. Sign in to the AWS Management Console.
  2. Navigate to the CloudWatch dashboard at https://console.aws.amazon.com/cloudwatch/.
  3. In the left navigation panel, select Logs.
  4. Select the log group created for your CloudTrail trail event logs and click Create Metric Filter.
  5. On the Define Logs Metric Filter page, paste the following pattern inside the Filter Pattern box:
{
    ($.eventName = CreateCustomerGateway) || ($.eventName = DeleteCustomerGateway) || ($.eventName = AttachInternetGateway) ||
    ($.eventName = CreateInternetGateway) || ($.eventName = DeleteInternetGateway) || ($.eventName = DetachInternetGateway)
}

This pattern will be used for scanning the AWS CloudTrail logs for event names like “CreateInternetGateway”, “AttachInternetGateway” or “DeleteInternetGateway”.

  1. Review the metric filter configuration details, then click Assign Metric.
  2. On the Create Metric Filter and Assign a Metric page, perform the following:
    • In the Filter Name box, enter a unique name for the new filter, e.g., VPCGatewayConfigChanges.
    • In the Metric Namespace box, type CloudTrailMetrics.
    • In the Metric Name box, type GatewayEventCount for the metric identifier.
    • Click Show advanced metric settings to slide down the advanced settings section.
    • In the Metric Value box, enter 1.
  3. Review the details, then click Create Filter to generate your new CloudWatch Logs metric filter.
  4. On the current page, click Create Alarm.
  5. In the Create Alarm dialog box, provide the following information: - Within the Alarm Threshold section, in the Name and Description fields, enter a unique name and a short description for the new CloudWatch alarm. - Under Whenever: Metric Name, select >= (greater than or equal to) from the dropdown list and enter 1 as the threshold value to trigger the alarm every time a configuration change involving a VPC Network Customer/Internet Gateway is made. - In the Actions section, click the + Notification button, select State is ALARM from the Whenever this alarm dropdown menu, and choose the AWS SNS topic name created at Step 1 from Send notification to. - In the Alarm Preview section, select 5 Minutes from the Period dropdown list and Sum from the Statistic list. - Review the CloudWatch alarm configuration details, then click Create Alarm. Once created, the new alarm will be listed on the Alarms page.

Additional Reading: