【问题标题】:Azure is blocking request that come from the same serverAzure 阻止来自同一服务器的请求
【发布时间】:2017-05-22 03:44:45
【问题描述】:

上下文

Umbraco CMS 网站在 Azure 上作为应用服务运行

预定发布

Umbraco 的一项功能是允许在给定时间发布内容。发布功能对同一网站(或负载平衡环境中的不同服务器但同一网站)进行 HTTP 调用。

API 调用地址:

http://sample-site-umbraco.azurewebsites.net/umbraco/RestServices/ScheduledPublish/Index

IP 安全

由于客户要求,对网站的访问仅限于给定的 IP 地址列表。此任务正在通过 web.config 中的 IP 安全限制完成。

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="52428800" />
  </requestFiltering>
  <ipSecurity allowUnlisted="false" denyAction="NotFound">
    <!-- "clear" removes all upstream restrictions -->
    <clear />

    <!-- permit the loopback address  -->
    <add ipAddress="127.0.0.1" allowed="true" />

    ...
    ...
    ...

    <!-- domain Name for Scheduled Publishing -->
    <add allowed="true" domainName="sample-site-umbraco.azurewebsites.net"/>
  </ipSecurity>
</security>

问题

当 IP 安全开启时,发布 API 的 HTTP 调用被阻止,因为它不是白名单。

API调用响应状态码及内容:

404 - NotFound
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

Problem Thread our.umbraco.com

修复尝试

将 domainName 添加到允许条目列表中

<!-- domain Name for Scheduled Publishing -->
<add allowed="true" domainName="sample-site-umbraco.azurewebsites.net"/>

此解决方案不起作用。通话仍被阻止。

问题

如何解决这个问题?有没有可以覆盖的功能?

【问题讨论】:

    标签: asp.net azure security umbraco azure-web-app-service


    【解决方案1】:

    好的,我找到了解决方案。我认为它会起作用。

    我在 stackoverflow 上找到了 this question,它确实有效 :)

    解决方案

    解决方案是将所有出站 IP 地址添加到 System.WebServer > Security > ipSecurity > [List]。

    出站 IP 地址是逗号分隔的 ips 列表。 您需要将它们全部添加到 web.config 中的白名单中。

    缺点

    我不确定 Outbound Ips 列表是否是静态的,并且将来不会更改...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-24
      • 1970-01-01
      • 2021-10-09
      • 1970-01-01
      • 1970-01-01
      • 2021-05-23
      • 2016-09-08
      相关资源
      最近更新 更多