【问题标题】:Tag based policy for s3 bucketss3 存储桶的基于标签的策略
【发布时间】:2021-06-30 07:42:01
【问题描述】:

我希望为用户(david)创建一个基于标签的策略,以仅访问 costCenter 标签值为 12345 的那些 s3 存储桶。我创建了一个存储桶并用 costCenter 12345 对其进行标记,但我仍然无法在其上执行列表。这是我的政策。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::*",
            "Condition": {"StringLike": {"s3:ResourceTag/costCenter": "12345"
                }
            }
        }
    ]
}

我也尝试过以下条件。

"Condition": {"StringLike": {"aws:ResourceTag/costCenter": "12345"

但在这两种情况下,我都会这样做。

aws s3 ls s3://mybucket-with-tag --profile david 

我明白了

An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

【问题讨论】:

    标签: amazon-web-services amazon-s3 amazon-iam aws-cli


    【解决方案1】:

    基于标签的authorization in S3仅适用于对象,不适用于存储桶:

    Amazon S3 支持对象资源的基于标签的授权。

    但是,ListObjectsV2 是存储桶级别的操作,而不是对象级别的操作。因此,您的政策将不起作用。同样对于对象级标签,S3 具有 additional 条件键。

    【讨论】:

      猜你喜欢
      • 2011-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-26
      • 2019-02-26
      • 2021-01-19
      • 2021-03-31
      • 2017-10-14
      相关资源
      最近更新 更多