Add AWS WAF Logging Configured Policy #1393
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This PR adds a new detection rule that ensures AWS WAF (Web Application Firewall) logging is configured and sending logs to valid destinations, such as Amazon S3, CloudWatch Logs, or Kinesis Firehose. Proper logging is essential for monitoring AWS WAF activity.
Changes
Python policy file: aws_waf_logging_configured.py
This file contains logic to validate if AWS WAF logging is configured to a valid destination (S3, CloudWatch Logs, or Kinesis Firehose).
It checks the LoggingConfiguration field in AWS WAF resources and validates the destination ARNs.
Metadata file: aws_waf_logging_configured.yml
Adds metadata for the new rule, specifying:
PolicyID: "AWS.WAF.LoggingConfigured"
Severity: High
Tags for easier categorization
Includes test cases for different logging configurations (e.g., valid/invalid ARNs, multiple valid destinations).
Testing
Ran the following test cases using Panther’s panther_analysis_tool:
WAF Logging Configured to CloudWatch Logs
WAF Logging Configured to S3
WAF Logging Configured to Kinesis Firehose
WAF Logging Not Configured
Edge cases (Malformed ARNs for CloudWatch, S3, Kinesis)
Multiple Valid Logging Destinations (S3 and Kinesis)