我想对美国以外国家/地区的 Azure 前门应用地理过滤器。
我已经应用了 waf 策略(遵循 microsoft docs ),但我没有得到所需的结果。所有流量似乎都被拒绝。如果我尝试不同的国家/地区代码,所有流量似乎都被允许。
这是我正在尝试实现的拒绝策略的示例。如果我应用此规则并通过 locabrowser 进行测试,则允许流量。
我正在使用 locabrowser 来测试这个理论。模拟来自不同位置的流量。
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"frontdoorwebapplicationfirewallpolicies_DenyChinaWafPolicy_name": {
"defaultValue": "DenyChinaWafPolicy",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"apiVersion": "2018-08-01",
"name": "[parameters('frontdoorwebapplicationfirewallpolicies_DenyChinaWafPolicy_name')]",
"location": "Global",
"properties": {
"policySettings": {
"enabledState": "Enabled",
"mode": "Prevention"
},
"customRules": {
"rules": [
{
"name": "geoFilterRule",
"priority": 1,
"ruleType": "MatchRule",
"rateLimitDurationInMinutes": 1,
"rateLimitThreshold": 0,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"operator": "GeoMatch",
"negateCondition": false,
"matchValue": [
"CH"
]
}
],
"action": "Block"
}
]
},
"managedRules": {
"ruleSets": []
}
}
}
]
}
最佳答案
AFD 中的地理过滤目前已损坏。它包括所有国家/地区而不是特定位置。修复已完成并将很快发布。修复更新后将在此处更新。
关于Azure 前门 - 如何添加地理过滤策略?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56267251/