【问题标题】:Whitelisting cross tenant subnet in storage account firewall in azure在 Azure 的存储帐户防火墙中将跨租户子网列入白名单
【发布时间】:2021-07-01 02:51:33
【问题描述】:

我想从位于其他 Azure AD 租户(例如租户 ID T2)中的子网(例如 S1)访问驻留在 Azure AD 租户(例如租户 ID T1)中的存储帐户。使用 azure CLI,我能够在存储帐户的 防火墙和虚拟网络 选项卡中添加这个现有的通风口/子网。

AZ CLI:az storage account network-rule add -g myRG --account myAccount --subnet mySubnetId

但此子网的端点状态显示权限不足而不是已启用。因此无法从添加的子网 S1 访问此存储帐户。

错误: Unable retrieve endpoint status for one or more subnets. Status 'insufficient permissions' indicates lack of subnet read permissions ('Microsoft.Network/virtualNetworks/subnets/read').

详细错误:

You do not have authorization to access this resource.

Resource ID: /subscriptions/****/resourceGroups/my-network-rg/providers/Microsoft.Network/virtualNetworks/my-vnet

Status Code: 401

Status Message: The access token is from the wrong issuer 'https://sts.windows.net/T1/'. It must match the tenant 'https://sts.windows.net/T2/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/T2' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.

我缺少哪些必要的跨租户权限?如何提供它们?任何帮助表示赞赏。虽然这可能是微不足道的,因为我是 Azure 的新手,我不确定我在这里缺少什么。谢谢。

【问题讨论】:

  • 您使用的订阅是否与租户 2 匹配?
  • 您正在使用租户 1 颁发的令牌调用租户 2 的订阅资源。
  • 您能否详细说明“您正在使用匹配租户 2 的订阅”是什么意思?两种资源(存储帐户和 vnet)都在不同租户的不同订阅中。
  • 关于“使用租户 1 颁发的令牌调用租户 2 的订阅资源”:明确地说,我没有进行任何 API 调用,它是默认存储帐户的后端。有什么方法可以让我提到这个特定的 vnet/子网来自不同租户的存储帐户服务,以便它使用该租户的 sts 令牌进行身份验证。
  • 您使用的订阅 ID 在租户 2 中,对吧?

标签: azure azure-active-directory azure-storage multi-tenant web-application-firewall


【解决方案1】:

您已正确执行所有步骤,只是令人困惑的消息:您使用从租户 1 获得令牌的用户登录到 Azure 门户,但 VNet 驻留在租户 2 中并且您没有令牌可用于读取租户 2 中的子网数据。

要确认网络规则实际上设置正确,您可以运行

az storage account network-rule list --account-name myAccount

你应该会看到"state": "Succeeded"

剩下要做的就是确保访问来自子网的存储帐户的用户帐户具有eligible role 分配以访问存储帐户。例如,如果用户应该能够读取和写入 blob 数据,请为您的用户添加 Storage Blob Data Contributor 角色。

【讨论】:

  • 嘿,谢谢!由于来自 Azure 门户的误导性错误消息,我从未真正尝试过通过子网访问存储帐户。虽然 azure CLI 显示 "state": "Succeeded" 并且我能够访问存储帐户。
猜你喜欢
  • 2021-01-08
  • 2019-09-28
  • 1970-01-01
  • 2018-09-21
  • 2018-11-13
  • 2021-10-29
  • 2022-07-02
  • 2020-06-18
  • 2022-09-24
相关资源
最近更新 更多