【问题标题】:IP Security and Always On Setting in AzureAzure 中的 IP 安全性和 Always On 设置
【发布时间】:2017-05-31 13:33:23
【问题描述】:

我有一个在 Azure Web 应用程序上运行的连续 WebJob,这要求我保持应用程序“始终开启”。在同一个应用程序上,我设置了 web.config 文件以阻止出现 NotFound 错误的未列出 IP:

<security>
  <ipSecurity allowUnlisted="false" denyAction="NotFound">
    <add ipAddress="123.456.789.123" allowed="true"/> <!--office-->
    <add ipAddress="168.62.180.0" allowed="true"/> <!--azure (for Always On setting)-->
  </ipSecurity>
</security>

显然,Always On 设置会导致 Azure 在后台每 5 分钟 ping 一次网站,但安全选项会阻止 Azure 的 ping,这会使错误日志变得混乱。不过,其他列入白名单的 IP 地址可以正常访问该应用程序;只是被阻止的 Azure ping。

这是来自被阻止 ping 的错误日志的屏幕截图:

任何关于如何允许 Azure ping 的见解将不胜感激!

【问题讨论】:

  • 一个好的起点可能是验证这确实是阻止该 GET 请求的原因;能否暂时禁用 ipSecurity 规则,看看 Azure 的 keep alive 请求是否仍然被阻止,然后重新启用该规则?
  • 感谢您的建议。我忘了提到我们实际上已经尝试过了。我们禁用了 ipSecurity 设置,错误停止了。
  • 好的。还要在这里进行真正的基本故障排除,可以从其他列入白名单的地址访问域的根目录,对吗?
  • 正确。实际上还有一些其他的,它们都能够访问域的根目录。
  • 我也有同样的问题,@Sam 你找到解决方案了吗?

标签: asp.net azure security web-config


【解决方案1】:

允许这两个 IP 都对我有用。由于 Always on 的 ping 来自“::1” ip,但是我还在列表中添加了“127.0.0.1”。

<add allowed="true" ipAddress="::1" />
<add allowed="true" ipAddress="127.0.0.1" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-11
    • 2015-04-26
    • 1970-01-01
    • 2021-03-31
    • 1970-01-01
    • 1970-01-01
    • 2011-12-14
    • 1970-01-01
    相关资源
    最近更新 更多