AWS WAFv2 Web ACL has logging enabled
AWS WAFv2 Web ACLs with logging capture details of inspected requests and rule evaluations. The assessment determines for each Web ACL whether logging is configured to record traffic analyzed by that ACL.
Risk
Without WAF logging, visibility into allowed/blocked requests is lost, degrading detection and response. SQLi, credential stuffing, and bot/DDoS probes can go unnoticed, risking data exposure (C), undetected rule misuse (I), and service instability from unseen abuse (A).
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks wafv2_webacl_logging_enabledRecommendation
Enable logging on all WAFv2 Web ACLs to a centralized destination. Apply least privilege for log delivery, redact sensitive fields, and filter to retain high-value events. Integrate with monitoring/SIEM for alerting and correlation, and review routinely as part of defense in depth.
Remediation
CLI
aws wafv2 put-logging-configuration --logging-configuration ResourceArn=<WEB_ACL_ARN>,LogDestinationConfigs=<DESTINATION_ARN>Terraform
# Enable logging for a WAFv2 Web ACL
resource "aws_wafv2_web_acl_logging_configuration" "<example_resource_name>" {
resource_arn = "<example_resource_arn>" # CRITICAL: target Web ACL ARN
log_destination_configs = ["<example_destination_arn>"] # CRITICAL: log destination ARN
}NativeIaC
# CloudFormation: Enable logging for a WAFv2 Web ACL
Resources:
<example_resource_name>:
Type: AWS::WAFv2::LoggingConfiguration
Properties:
ResourceArn: arn:aws:wafv2:<region>:<account-id>:regional/webacl/<example_resource_name>/<example_resource_id> # CRITICAL: target Web ACL to log
LogDestinationConfigs: # CRITICAL: where logs are sent
- arn:aws:logs:<region>:<account-id>:log-group:aws-waf-logs-<example_resource_name>Other
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.wafv2.wafv2_client import wafv2_client
class wafv2_webacl_logging_enabled(Check):
def execute(self):
findings = []
for web_acl in wafv2_client.web_acls.values():
report = Check_Report_AWS(metadata=self.metadata(), resource=web_acl)
if web_acl.logging_enabled:
report.status = "PASS"
report.status_extended = (
f"AWS WAFv2 Web ACL {web_acl.name} has logging enabled."
)
else:
report.status = "FAIL"
report.status_extended = (
f"AWS WAFv2 Web ACL {web_acl.name} does not have logging enabled."
)
findings.append(report)
return findingsReferences
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/WAF/enable-web-acls-logging.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/waf-controls.html#waf-11
- https://docs.aws.amazon.com/cli/latest/reference/wafv2/put-logging-configuration.html
- https://docs.aws.amazon.com/waf/latest/developerguide/logging.html