gpt4 book ai didi

具有应用程序网关和自定义域的 Azure WAF

转载 作者:行者123 更新时间:2023-12-03 06:16:27 25 4
gpt4 key购买 nike

我已经设置了带有 WAF 和一些 Web 应用程序的应用程序网关 V2。我还为 Web 应用程序设置了自定义域,并且网关的监听器正在重定向到属于网关正在监听的域的 Web 应用程序。

假设我想阻止外部访问不同 Web 应用程序的特定 URL(在本例中包含 f.e admin 或 anotheradmin)。 www.webapp1.com/admin www.webapp2.com/anotheradmin

所以我可以配置WAF“如果requesturi包含admin/anotheradmin则拒绝”。设置此规则对于 WAF 背后的每个 Web 应用程序都是全局的。有没有办法为特定的 Web 应用程序或域设置规则?

我想这样做:“如果 requesturi 包含 admin,则阻止 www.webapp1.com 的流量”或“如果 requesturi 包含 anotheradmin,则阻止 www.webapp2.com 的流量”

谢谢

最佳答案

是的,这可以在单个应用程序上实现,而不是在全局级别配置 WAF 规则。为每个域创建一个单独的监听器,并将监听器关联到包含 Web 应用程序的相应后端池,以便定义 WAF 规则。

使用 WAF 创建应用程序网关 V2:

enter image description here

在应用程序网关 WAF 策略中添加自定义规则,如下所示:

enter image description here

Even you have global policy if you create listener specific or path specific depending upon configuration you can create waf policy and deny traffic. Usually per-site policy will be preferred than global policy, global policy as least preference.

在自定义规则中,如果您要阻止来自外部站点的此访问,则可以阻止来自一系列 IP 地址的流量

在匹配类型中选择Ip地址匹配变量作为remoteaddr保持操作为“Not”,如果操作不包含您的范围,它将被拒绝。只有虚拟网络范围可以被允许,其他的都将被拒绝。

enter image description here

确保在 Waf 策略中包含必要的规则并将策略分配给 Web 应用程序的监听器。

enter image description here

引用文献:

Azure Web Application Firewall (WAF) v2 custom rules on Application Gateway | Microsoft Learn

To restrict a domain from public access in Azure - Microsoft

关于具有应用程序网关和自定义域的 Azure WAF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76219378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com