More Info:
Web ACL rule group logging should be enabledRisk Level
HighAddress
Operational Maturity, Reliability, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- GDPR
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of WAFv2 WebACL Rule Group Logging not being enabled in AWS CloudWatch using the AWS Management Console, follow these steps:
- Sign in to the AWS Management Console: Go to https://aws.amazon.com/ and sign in to your AWS account.
- Navigate to AWS WAF & Shield console: Click on the ‘Services’ dropdown menu at the top left corner of the console, then select ‘WAF & Shield’ under the Security, Identity, & Compliance section.
- Select the desired WebACL: In the AWS WAF & Shield console, click on ‘Web ACLs’ from the left-hand menu, then select the WebACL that you want to enable logging for.
- Edit the WebACL: Click on the WebACL that you have selected, then click on the ‘Edit’ button to make changes to the WebACL configuration.
- Enable Logging for the Rule Group: In the WebACL configuration page, scroll down to the ‘Logging configuration’ section. Ensure that ‘Log’ is enabled for the desired rule group(s) that you want to log.
- Save Changes: Once you have enabled logging for the rule group(s), click on the ‘Save’ button to save the changes to the WebACL configuration.
- Verify Logging Configuration: After saving the changes, you can verify that logging is enabled for the rule group(s) by checking the ‘Logging configuration’ section in the WebACL configuration page.
Using CLI
Using CLI
To remediate the misconfiguration for WAFv2 WebACL Rule Group Logging in AWS CloudWatch using AWS CLI, follow these steps:By following these steps, you can successfully remediate the misconfiguration and enable logging for the WAFv2 WebACL Rule Group in AWS CloudWatch using AWS CLI.
- List all the WAFv2 WebACLs in your AWS account to identify the WebACL Rule Group for which logging needs to be enabled:
- Get the details of the specific WebACL Rule Group that needs logging enabled:
- Enable logging for the identified WebACL Rule Group by updating its configuration:
- Verify that the logging is enabled for the WebACL Rule Group:
Using Python
Using Python
To remediate the misconfiguration of WAFv2 WebACL Rule Group Logging not being enabled in AWS CloudWatch using Python, you can use the AWS SDK for Python (Boto3) to programmatically enable logging for the WebACL Rule Group. Below are the step-by-step instructions to remediate this issue:
- Install Boto3: Make sure you have the Boto3 library installed. You can install it using pip:
-
Configure AWS Credentials: Ensure that you have configured your AWS credentials either by setting environment variables or using AWS CLI
aws configurecommand. - Write a Python script: Create a Python script with the following code to enable logging for the WAFv2 WebACL Rule Group:
-
Replace the placeholders:
- Replace
YOUR_WEB_ACL_ARNwith the ARN of the WebACL Rule Group for which you want to enable logging. - Replace
REGION,ACCOUNT_ID, andLOG_GROUP_NAMEin theLogDestinationConfigswith your AWS region, account ID, and the name of the CloudWatch Logs log group where you want to store the logs.
- Replace
- Run the Python script: Execute the Python script to enable logging for the specified WebACL Rule Group. Make sure the script runs successfully without any errors.
Using Terraform
Using Terraform
aws_wafv2_web_acl resource will be replaced; the change adds or updates the separate aws_wafv2_web_acl_logging_configuration resource. Be aware that any existing logging configuration for that Web ACL will be overwritten.For CloudFront‑scope Web ACLs, ensure your provider "aws" is configured with region = "us-east-1".Verification: terraform plan should show aws_wafv2_web_acl_logging_configuration.waf_logging (and the Firehose/CloudWatch resources, if new) being created or updated, with log_destination_configs set to the Firehose stream ARN.
