AWS WAF ClassicOld PlanLegacyUsage
This article explains how to configure WAF log integration with the old method (Lambda method) for AWS WAF Classic.
In the old method, the following procedure is used to set up.
To use the old method, you are required to create an IAM role and configure Lambda on the AWS management console.
Therefore, the AWS account you use on the AWS management console must have the permissions listed below.
If you have permissions equivalent to the ones listed below, you should be able to complete all the steps.
The architecture overview is as follows.
AWS WAF will output WAF logs to an S3 bucket via Amazon Data Firehose on your AWS environment.
When WAF logs are output to an S3 bucket (S3 putObject Event Trigger), it triggers the Lambda to execute the script.
The data is transferred to WafCharm and monthly reports can be created and viewed without any additional configurations at the beginning of each month.
If you configure email notification settings for WafCharm rule detections on the WafCharm Console, you can use the WAF log alert (notification detection) feature. If you are using CSC's managed rules with WafCharm, you can also receive detection notifications for the detections by CSC's managed rules by turning the CSC's managed rule detection notification on.
If you are attaching CloudFront to your web ACL, select US East (N. Virginia).
Per AWS specification, you are required to add [aws-waf-logs-] in the beginning of the stream name.
If you want to add a prefix, make sure to add a slash ( /
) at the end.
Please choose UTC here because the feature may not work properly with different timezone.
Buffer interval: 60 seconds is recommended
*WAF logs are exported to the S3 bucket when they reach the specified buffer interval or buffer size.
The format should be like below. You will use this information later.
csc-waftest/waflog/
The S3 bucket name and prefix (or lack thereof) will depend on the options you chose in the previous steps.
You will be creating the three items below.
arn:aws:s3:::csc-waftest/waflog/*
Write the S3 bucket path you obtained in the previous steps. The path specified under the [Resources] must end with /*
.
The name can be any value.
Example: wafcharm-waflog-s3-read
arn:aws:s3:::wafcharm.com/*
Enter WafCharm's S3 bucket (as specified above) to enable WAF log transfer. The path specified under the [Resources] must end with /*
.
The name can be any value.
Example: wafcharm-waflog-s3-put
The name can be any value.
Example: wafcharm-waflog
The name can be any value.
Example: wafcharm-waflog
Runtime: Node.js 18.x ~ Node.js 22.x
Execution Role: Use an existing role
Existing role: Select the IAM role you created in the previous steps (e.g.: wafcharm-waflog)
Select a source: S3
Bucket: the S3 bucket you created in the previous steps
Event types: All object create events
Prefix: prefix of the S3 bucket you created in the previous steps (e.g.: waflog/
)
Description (optional)
Timeout: 1 minute
This configuration is optional.
If you want to change the retention period for your logs, please follow the steps below.
Access the target resources to output WAF logs. The Lambda script is triggered when the WAF logs are outputted to the S3 buckets.
The default is set to [Never expire]. Please adjust the period as necessary.