简体   繁体   English

使用 Azure 应用程序网关阻止所有 http/https 流量的 WAF 规则

[英]WAF Rule to block all http/https traffic using Azure Application gateway

When configuring WAFs I'm used to configuring the lowest priority rule to block all inbound http/https traffic.配置 WAF 时,我习惯于配置最低优先级规则来阻止所有入站 http/https 流量。 I then add higher priority allow rules to open up the access I require.然后我添加更高优先级的允许规则来打开我需要的访问权限。

I cant see how I can create a "block all" rule in the Azure Application Gateway's WAF custom rules?我看不到如何在 Azure 应用程序网关的 WAF 自定义规则中创建“全部阻止”规则?

So.. this is how you can do this (apologies the config is in terraform format)所以..这就是你如何做到这一点(抱歉,配置格式为 terraform)

custom_rules { name = "blockAllPaths" priority = 90 rule_type = "MatchRule" custom_rules { name = "blockAllPaths" priority = 90 rule_type = "MatchRule"

match_conditions {
  match_variables {
    variable_name = "RequestUri"
  }
  operator           = "BeginsWith"
  negation_condition = false
  match_values       = ["/"]
}

action = "Block"

} }

There is no way to "block all traffic" rule in Azure Application Gateway's WAF,because its helps your web to safe from some common threats only在 Azure 应用程序网关的 WAF 中没有办法"block all traffic"规则,因为它只能帮助您的 web 免受一些常见威胁

Azure WAF is a web application firewall that helps protect your web applications from common threats such as SQL injection, cross-site scripting, and other web exploits. Azure WAF 是一个 web 应用程序防火墙,可帮助保护您的 web 应用程序免受常见威胁,例如 SQL 注入、跨站点脚本和其他 web 攻击。 You can define a WAF policy consisting of a combination of custom and managed rules to control access to your web applications.您可以定义由自定义规则和托管规则组合组成的 WAF 策略,以控制对 web 应用程序的访问。

Azure Application Gateway Web Application Firewall (WAF) v2 comes with a pre-configured, platform-managed ruleset that offers protection from many different types of attacks. Azure 应用程序网关 Web 应用程序防火墙 (WAF) v2 带有一个预配置的、平台管理的规则集,可以防止多种不同类型的攻击。 If you're a WAF admin, you may want to write your own rules to augment the core rule set (CRS) rules.如果您是 WAF 管理员,您可能希望编写自己的规则来扩充核心规则集 (CRS) 规则。 Your rules can either block or allow requested traffic based on matching criteria.您的规则可以根据匹配条件阻止或允许请求的流量。

Plese refer this document for what are the rule currently available for WAF.请参阅此文档以了解当前适用于 WAF 的规则是什么。 In the Document there is no rule for block all traffic.在文档中没有阻止所有流量的规则。

Please refer this document for more information about custome rule.有关客户规则的更多信息,请参阅此文档 Custome rule is just help you use more than one rule based on different condition (which provided in above document only).These rules hold a higher priority than the rest of the rules in the managed rule sets自定义规则只是帮助您根据不同的条件使用多个规则(仅在上述文档中提供)。这些规则比托管规则集中的规则 rest 具有更高的优先级

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM