This rule ensures the presence of a log metric filter and alarm for security group modifications.
Rule | Ensure a log metric filter and alarm exist for security group changes |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ Low |
Rule Description: Log Metric Filter and Alarm for Security Group Changes - NIST CSF v1
Rule Summary:
To comply with the NIST Cybersecurity Framework (CSF) version 1, it is necessary to have a log metric filter and alarm in place for monitoring security group changes. This rule ensures that any modifications to security groups within your infrastructure are logged and monitored for potential security incidents.
Troubleshooting Steps:
In case the log metric filter and alarm for security group changes are not present or not functioning properly, follow these troubleshooting steps:
Necessary Code:
The following AWS CloudFormation template demonstrates the necessary code to create a log metric filter and alarm for security group changes:
Resources:
SecurityGroupChanges:
Type: AWS::Logs::MetricFilter
Properties:
LogGroupName: !Ref 'LogGroup'
FilterPattern: '{ ($.eventName = CreateSecurityGroup) || ($.eventName = DeleteSecurityGroup) || ($.eventName = AuthorizeSecurityGroupIngress) || ($.eventName = AuthorizeSecurityGroupEgress) || ($.eventName = RevokeSecurityGroupIngress) || ($.eventName = RevokeSecurityGroupEgress) }'
MetricTransformations:
- MetricName: SecurityGroupChanges
MetricNamespace: AWS/Security
MetricValue: 1
SecurityGroupChangesAlarm:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: SecurityGroupChangesAlarm
AlarmDescription: Alarm for detecting security group changes
Namespace: AWS/Security
MetricName: SecurityGroupChanges
Statistic: Sum
Period: 300 # 5 minutes
EvaluationPeriods: 1
Threshold: 1
ComparisonOperator: GreaterThanOrEqualToThreshold
AlarmActions:
- !Ref 'SNSTopicArn'
Note: This code is in YAML format and can be used with AWS CloudFormation to automate the creation and configuration of the log metric filter and alarm.
Step-by-Step Guide for Remediation:
Follow these steps to create a log metric filter and alarm for security group changes:
{ ($.eventName = CreateSecurityGroup) || ($.eventName = DeleteSecurityGroup) || ($.eventName = AuthorizeSecurityGroupIngress) || ($.eventName = AuthorizeSecurityGroupEgress) || ($.eventName = RevokeSecurityGroupIngress) || ($.eventName = RevokeSecurityGroupEgress) }
Once the log metric filter and alarm are successfully created, any changes to the security groups within the selected log group will trigger the alarm according to the configured threshold and evaluation period.
Summary:
By implementing a log metric filter and alarm for security group changes, you adhere to the NIST CSF v1 requirement of monitoring modifications to security groups. This helps ensure the security of your infrastructure and aids in identifying any unauthorized changes made to security groups.