azure 存储帐户列出没有读取权限的 blob

问题描述 投票:0回答:1

我有一个用例,我需要向承包商授予访问权限,允许他们浏览存储容器和 blob...即列出 blob 和元数据...但无权下载/编辑它们。

看起来像 list blobsread blobs 都是通过

Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read
DataAction 权限

授予的

列表操作由

Blob.List
的子操作定义,但读取操作是
NOT Blob.List

似乎 IAM 中应该有一种带有“条件”的方法来向我的承包商授予

storage blob data reader
,但提供一个条件:

A) 只允许

Blob.List

的子操作

B)只允许 Not“Not Blob.List”(由于 yoda 逻辑,这会破坏我的大脑)

当我在

Add role assignment condition
屏幕中创建条件时,我可以添加以下条件:

enter image description here

但是当你查看代码编辑器时,我看到了这个:

enter image description here

由于主要的否定,读起来就像它正在做与我需要的完全相反的事情。 我尝试了很多方法但没有成功,直到我删除了代码中的

!

,这给了我我想要的确切行为,但似乎破坏了用户界面:

enter image description here 导致

enter image description here

azure azure-blob-storage identity-management
1个回答
0
投票
我需要向承包商授予访问权限,允许他们浏览存储容器和 blob...即列出 blob 和元数据...但无权下载/编辑它们。

根据此
MS-Document

    存储 Blob 数据读取器角色
  • Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read 用于列出 Blob 和读取 Blob 内容。
    它要么只读取 blob,要么读取 blob 并列出 blob。
  • 因此不可能仅使用角色列出 blob。
  • 如果您需要仅列出 blob,则可以使用
shared access signature

的方式,并且在生成

sas
时,您可以设置
sp=l
只列出 blob。
您可以从门户生成 sas 令牌。

传送门:

enter image description here现在,我可以使用以下请求列出使用该 sas 令牌的 blob。

要求:

https://myaccount.blob.core.windows.net/mycontainer?restype=container&comp=list&<SAS token>

enter image description here现在,如果我尝试读取或下载特定的 blob,我会收到错误:

enter image description here

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.