More Info:

AWS security groups configuration changes should be monitored using CloudWatch alarms. Ensure there is a CloudWatch alarm set up in your AWS account that is triggered each time a security group configuration change is made.

Risk Level

Medium

Address

Security

Compliance Standards

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

Triage and Remediation

Remediation

Sure, here are the step by step instructions to remediate the Security Group Changes Alarm misconfiguration in AWS using AWS console:

Here are the step-by-step instructions to remediate the Security Group Changes Alarm misconfiguration in AWS using the AWS console:

  1. Sign in to your 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 the Create Metric Filter button.

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

{
    ($.eventName = AuthorizeSecurityGroupIngress) || ($.eventName = AuthorizeSecurityGroupEgress) ||
    ($.eventName = RevokeSecurityGroupIngress) || ($.eventName = RevokeSecurityGroupEgress) ||
    ($.eventName = CreateSecurityGroup) || ($.eventName = DeleteSecurityGroup)
}

This pattern will be used for scanning the AWS CloudTrail logs for event names like “CreateSecurityGroup”, “AuthorizeSecurityGroupIngress”, or “DeleteSecurityGroup”.

  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., SecurityGroupConfigChanges).
    • In the Metric Namespace box, type CloudTrailMetrics.
    • In the Metric Name box, type SecurityGroupEventCount 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 in the box next to the dropdown list to trigger the alarm every time a configuration change involving an AWS security group is made.
    • In the Actions section, click the + Notification button, select State is ALARM from the dropdown menu, and choose the AWS SNS topic name created previously from the Send notification to section.
    • 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.

It is important to note that setting up the alarm does not fix the underlying issue. You need to identify and remediate the root cause of the misconfiguration to ensure that your infrastructure remains secure.

Additional Reading: