【问题标题】:Azure API Management behind a Front Door前门后的 Azure API 管理
【发布时间】:2022-08-20 06:00:34
【问题描述】:

我希望有人可以帮助我理解这个问题并希望能解决它。

我的订阅中有一个 api 管理服务,我想尝试通过在它前面使用 Azure Front Door 来保护它。

因此,为了实现这一点,我创建了一个 API 管理和一个前门。

关于前门配置,我设置了这个:

Frontend/domain:
hostname: frontdoorapim.azurefd.net
Session Affinity: Disabled
WAF: Disabled

BackEndPool:
name: apimbackend
Backend: my-api-management.azure-api.net
Status: Enabled
Path: /
Protocol HTTPS
Probe: GET
Interval: 30

RoutingRules:
Status:Enabled
Accepted Protocol: HTTP and HTTPS
Frontend/domains: frontdoorapim.azurefd.net
Patterns to match: /*
Route Type: Forward
backend pool: apimbackend
Match Request

通过此配置,我能够通过 Front Door url 访问我的 api 管理网关 url。

所以我想限制对直接网关 url 的访问,只允许 FrontDoor 能够访问它。 我的第一个想法就是创建一个虚拟网络和子网以及一个网络安全组。

我创建了 VNET 和子网,并配置了安全组如下:

作为入站规则:

Priority: 100
Source: AzureFrontDoor.Frontend
Source Port Range: *
Destination: Any
Destination port: 3443
Protocol: TCP
Action: Allow

保存此消息后,我将 API 管理更改为 internal mode。 此时一切都停止了工作。 API 管理不再可访问,前门正在返回:

Our services aren\'t available right now
We\'re working to restore all services as soon as possible. Please check back soon.

请如果有人可以帮助我了解如何将网络安全组配置为仅允许通过前门访问。 他们拥有Access Restriction 的应用程序服务,我想通过我的 api 管理实现类似的目标。

非常感谢您提供的任何帮助,在这个阶段我很沮丧。 如果您需要任何额外的详细信息或屏幕截图,请随时告诉我。

  • 嗨@NaydenVan,如果提供的答案解决了您的问题,您可以将其标记为答案或支持它,以便遇到类似问题的其他人可能对他们或社区成员有用。

标签: azure-api-management azure-virtual-network azure-front-door azure-nsg


【解决方案1】:

• 是的,您可以通过确保相应地配置下面提到的步骤来实现所需的,即仅通过 Azure Front Door URL 访问 APIM 资源:-

一)Please ensure that if you are using a public IP address for the APIM, then you will have to disable the certificate name check from the resource explorer (https://resources.azure.com). To do that, navigate to the Azure front door resource in Azure resource explorer, and change the ‘enforceCertificateNameCheck’ as ‘Disabled’

b)Ensure that you are entering the value for path in the backend pool health probe as ‘/status-0123456789abcdef’ and the probe method is set to ‘GET’. Also, do ensure that the certificate for HTTPS protocol is valid and complete with correct validation chain

c) 确保在Azure 前门的规则部分, 你有允许配置的前端域/端点的所有路径并且有仅将 HTTPS 配置为其中的转发协议.

d) 完成上述配置后,请确保您是为 APIM 实例设置 IP 地址 ACL接着将流量限制为 Front Door 发送的标头“X-Azure-FDID”的特定值.

• 为此,您必须在网络安全组中创建入站规则,以允许 APIM 子网的服务标签“AzureFrontDoor.Backend”使用端口 443.另外,allow the incoming traffic from the virtual IP of the host nodes according to Azure platform consideration, i.e., 168.63.129.16 and 169.254.169.254 and allow the necessary inbound rules for APIM deployed in a virtual network according to the below documentation link. Deny all other incoming traffic to the subnet: -

https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-vnet#-common-network-configuration-issues

然后允许 APIM IP 限制策略中的以下链接中给出的 Azure Front Door 后端 IP,并允许此处所述的虚拟主机 IP 地址.

https://www.microsoft.com/download/details.aspx?id=56519

这样,一旦完成了上述操作,您就可以仅通过 Azure 前门 URL 访问 APIM 资源.有关更多详细信息,我建议您参考下面的链接,其中详细解释了实现所需的进一步步骤:-

https://techcommunity.microsoft.com/t5/azure-paas-blog/integrate-azure-front-door-with-azure-api-management/ba-p/2654925#:~:text=Azure%20Front%20Door%20needs%20a,accessible%20from%20external%20load%20balancer.

【讨论】:

    【解决方案2】:

    您说将 APIM 转为内部后,一切都停止了工作。 Azure Front Door 仅与公开的公开资源通信,并且最近开始使用特定的内部资源,即:内部负载均衡器。 在这种情况下,您需要在 FD 后面有一个应用程序网关,而 APIM 将在 AppGw 后面,因为 AppGw 有一个用于 FD 的公共 IP,而且它可以与内部(私有 IP 地址)资源“对话”。

    【讨论】:

      猜你喜欢
      • 2019-03-23
      • 1970-01-01
      • 2020-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      相关资源
      最近更新 更多