-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaf.tf
36 lines (32 loc) · 810 Bytes
/
waf.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Create WAF Rule ("Request Rate Limits")
resource "aws_wafv2_web_acl" "acl" {
name = "limited-request"
description = "Limited Request Per IP"
scope = "CLOUDFRONT"
default_action {
allow {} # pass traffic until the rules trigger a block
}
rule {
name = "limited-request"
priority = 0
action {
block {}
}
statement {
rate_based_statement {
limit = 500
aggregate_key_type = "IP"
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "limited-request"
sampled_requests_enabled = true
}
}
visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "limited-request"
sampled_requests_enabled = true
}
}