Skip to content

Commit 411f159

Browse files
committed
feature: added geo restricting rules to playground
1 parent 4bea804 commit 411f159

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

terraform/cloudflare/waf.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,23 @@ resource "cloudflare_ruleset" "playground_bot_protection" {
66
phase = "http_request_firewall_custom"
77

88
rules = [
9+
{
10+
action = "block"
11+
expression = "(http.request.uri.path contains \"/playground\" and ip.geoip.country in {\"CN\" \"RU\" \"VN\" \"IN\" \"BR\" \"ID\"})"
12+
description = "Block playground access from CN, RU, VN, IN, BR, ID"
13+
enabled = true
14+
},
915
{
1016
action = "managed_challenge"
1117
expression = "(http.request.uri.path contains \"/playground\")"
1218
description = "Managed challenge for playground access"
1319
enabled = true
20+
},
21+
{
22+
action = "challenge"
23+
expression = "(http.request.uri.path contains \"/playground\" and cf.threat_score gt 14)"
24+
description = "Challenge IPs with bad reputation accessing playground"
25+
enabled = true
1426
}
1527
]
1628
}

0 commit comments

Comments
 (0)