配置Azure Front Door WAF策略:允许指定Azure服务绕过地域访问限制
问题与解决方案:Azure Front Door WAF 允许特定Azure服务流量绕过拦截
问题背景
我使用Azure Front Door Standard及配套的Front Door WAF Policy,已配置一条自定义WAF规则,仅允许丹麦(DK)的流量访问,规则运行正常。
现在需要用部署在瑞典中部的Azure Load Testing访问Front Door端点,但被WAF拦截;同时在5个区域执行Availability Test时也遇到同样问题。如果直接把这些国家加入地域允许列表,会开放对应国家的全部公网访问,不符合安全需求。
我的需求是:在不开放瑞典及其他5个国家全部公网访问的前提下,允许瑞典的Azure Load Testing服务以及5个区域的Availability Test绕过WAF拦截,且不希望手动添加Azure IP地址。
现有生效的WAF规则代码
resource wafPolicy 'Microsoft.Network/FrontDoorWebApplicationFirewallPolicies@2024-02-01' = { name: frontDoorFWPolicyName tags: tags sku: { name: frontDoorSkuName } location: 'global' properties: { policySettings: { mode: 'Prevention' requestBodyCheck: 'Enabled' enabledState: 'Enabled' } customRules: { rules: [ { name: 'GeoLocation' action: 'Block' matchConditions: [ { matchValue: [ 'DK', 'SE' ] matchVariable: 'SocketAddr' operator: 'GeoMatch' negateCondition: true } ] priority: 100 ruleType: 'MatchRule' } ] } managedRules: { managedRuleSets: [] } } }
解决方案构想
- 仅允许来自瑞典Azure区域的流量访问,其余拒绝;
- 仅允许来自法国、北欧、西欧、英国Azure区域的流量访问,其余拒绝;
- 允许来自丹麦的流量访问,其余国家全部拒绝。
内容的提问来源于stack exchange,提问作者Maytham Fahmi
相关产品推荐
相关产品推荐

