Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWS WAF Logging Configured Policy #1393

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

bcpenta
Copy link
Contributor

@bcpenta bcpenta commented Oct 21, 2024

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)

@bcpenta bcpenta requested a review from a team as a code owner October 21, 2024 01:46
@arielkr256 arielkr256 added the policies Real-time misconfiguration detections label Oct 22, 2024
Copy link
Contributor

@arielkr256 arielkr256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice contribution @bcpenta, thank you! Really appreciate the thorough test cases and references.

@arielkr256 arielkr256 merged commit 30c461f into panther-labs:develop Oct 22, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
policies Real-time misconfiguration detections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants