Skip to content

Commit f8c7052

Browse files
committed
Allow internal traffic through WAF
1 parent c1bc161 commit f8c7052

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

obp_private_alb_config/private-alb-waf.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
resource "aws_wafv2_ip_set" "internal_ips" {
2+
name = "internal IPs"
3+
scope = "REGIONAL"
4+
ip_address_version = "IPV4"
5+
addresses = ["10.0.0.0/16"]
6+
}
17
resource "aws_wafv2_web_acl" "basic_protection" {
28
name = "private-alb-waf"
39
scope = "REGIONAL"
@@ -38,6 +44,27 @@ resource "aws_wafv2_web_acl" "basic_protection" {
3844
}
3945
}
4046

47+
rule {
48+
name = "obi-allow-internal-traffic"
49+
priority = 5
50+
51+
action {
52+
allow {}
53+
}
54+
55+
statement {
56+
ip_set_reference_statement {
57+
arn = aws_wafv2_ip_set.internal_ips.arn
58+
}
59+
}
60+
61+
visibility_config {
62+
cloudwatch_metrics_enabled = false
63+
metric_name = "obi_allow-internal-traffic"
64+
sampled_requests_enabled = false
65+
}
66+
}
67+
4168
rule {
4269
name = "aws-common-ruleset"
4370
priority = 10

0 commit comments

Comments
 (0)