Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions infrastructure/modules/ui/waf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,31 @@ resource "aws_wafv2_web_acl" "rapid_acl" {
}

rule {
name = "validate-request"
name = "RateLimitRule"
priority = 0

action {
block {}
}

statement {
rate_based_statement {
limit = 1000
aggregate_key_type = "IP"
}
}

visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "RateLimitRule"
sampled_requests_enabled = true
}
}

rule {
name = "validate-request"
priority = 1

action {
allow {}
}
Expand Down Expand Up @@ -81,7 +103,7 @@ resource "aws_wafv2_web_acl" "rapid_acl" {

rule {
name = "validate-query"
priority = 1
priority = 2

action {
block {}
Expand Down Expand Up @@ -134,7 +156,7 @@ resource "aws_wafv2_web_acl" "rapid_acl" {

rule {
name = "validate-large-query"
priority = 2
priority = 3

action {
block {}
Expand Down Expand Up @@ -187,7 +209,7 @@ resource "aws_wafv2_web_acl" "rapid_acl" {

rule {
name = "AWS-AWSManagedRulesKnownBadInputsRuleSet"
priority = 3
priority = 4

override_action {
none {}
Expand All @@ -207,7 +229,6 @@ resource "aws_wafv2_web_acl" "rapid_acl" {
}
}


visibility_config {
cloudwatch_metrics_enabled = true
metric_name = "${var.resource-name-prefix}-acl"
Expand Down
Loading