This rule ensures the existence of a log metric filter and alarm for changes to Network Access Control Lists (NACL).
Rule | Ensure a log metric filter and alarm exist for changes to Network Access Control Lists (NACL) |
Framework | cis_v130 |
Severity | ✔ Low |
Rule Description:
This rule ensures that a log metric filter and alarm exist for changes made to Network Access Control Lists (NACL) in accordance with the CIS AWS Foundations Benchmark version 1.3.0 (cis_v130).
The aim of this rule is to proactively monitor and alert any modifications or updates made to NACLs, aiding in the detection of potential security breaches or unauthorized changes.
Troubleshooting Steps:
Ensure that the specified NACLs are properly configured and associated with the relevant subnets and VPCs.
Verify that the necessary VPC flow logs are enabled to capture the required network traffic.
Check CloudWatch Logs for any errors related to the log metric filter.
Ensure that the IAM roles and permissions are correctly configured to allow the creation and management of log metric filters and alarms.
Necessary Codes:
Below are the necessary codes to define a log metric filter and alarm for NACL changes:
{ "Filters": [ { "Pattern": "{($.eventName = AuthorizeSecurityGroupEgress) || ($.eventName = AuthorizeSecurityGroupIngress) || ($.eventName = RevokeSecurityGroupEgress) || ($.eventName = RevokeSecurityGroupIngress) || ($.eventName = CreateNetworkAcl) || ($.eventName = ReplaceNetworkAcl) || ($.eventName = DeleteNetworkAcl)) && (($.requestParameters == \"null\") { "logGroupName": "your-log-group-name", "metricTransformations": [ { "metricNamespace": "CloudTrailMetrics", "metricValue": "1", "metricName": "NACLChanges" } ] } } ], "LogGroupName": "your-log-group-name" }
{ "AlarmName": "NACLChangesAlarm", "MetricName": "NACLChanges", "Namespace": "CloudTrailMetrics", "Statistic": "Sum", "Period": 300, "EvaluationPeriods": 1, "Threshold": 1, "ComparisonOperator": "GreaterThanOrEqualToThreshold", "AlarmDescription": "Alarm triggered when any changes occur in Network Access Control Lists (NACLs).", "TreatMissingData": "notBreaching", "Metrics": [ { "Id": "m1", "Expression": "SUM(METRICS('CloudTrailMetrics', 'NACLChanges', 'LogGroupName', 'your-log-group-name'), 300)" } ], "ActionsEnabled": true, "AlarmActions": [ "your-sns-topic-arn" ] }
Remediation Steps:
Follow the step-by-step guide below to remediate any issues related to the log metric filter and alarm for NACL changes:
Validate Log Metric Filter:
Validate CloudWatch Alarm:
Troubleshoot Log Metric Filter (if necessary):
Troubleshoot CloudWatch Alarm (if necessary):
By following these steps, you can ensure the log metric filter and alarm for changes to Network Access Control Lists (NACLs) are successfully implemented and functioning as intended.