代码之家  ›  专栏  ›  技术社区  ›  Steve L.

Azure前门-如何添加地理过滤策略?

  •  0
  • Steve L.  · 技术社区  · 6 年前

    我想为美国以外的国家的azure前门应用一个地理过滤器。

    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": []
                }
            }
        }
      ]
    }
    
    0 回复  |  直到 6 年前
        1
  •  2
  •   msrini-MSIT    6 年前

    AFD中的地理过滤功能目前已被破坏。它包括所有国家,而不是具体位置。修复已完成,将很快发布。更新修复程序后,将在此处更新。

        2
  •  1
  •   Nancy Xiong    6 年前

    这对我也不起作用。不管我怎么做 具有 matchVariable": "RemoteAddr" "operator": "GeoMatch" "matchValue" ,只是根据操作而工作。使用WAF进行地理过滤似乎仍然不可用。

    请注意 the Azure web application firewall (WAF) for Azure Front Door is currently in public preview. enter image description here

    你可以发表你的意见或投票 feedback1 feedback2 关于地理过滤。