【问题标题】:Granting write access for the Authenticated Users to S3 bucket授予 Authenticated Users 对 S3 存储桶的写入权限
【发布时间】:2018-04-29 20:24:30
【问题描述】:

我想向所有经过 AWS 身份验证的用户授予对存储桶的读取权限。注意我不希望我的存储桶公开可用。旧的亚马逊控制台似乎提供了我不再看到的规定 -

旧 S3 存储桶 ACL -

新存储桶 Acl -

如何实现旧行为?我可以使用存储桶策略吗 -

我又不想了

{
  "Id": "Policy1510826508027",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1510826503866",
      "Action": [
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::athakur",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    }
  ]
}

【问题讨论】:

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


    【解决方案1】:

    该支持已在新的 s3 控制台中删除,必须通过 ACL 进行设置。

    您可以使用 put-bucket-acl api 将 Any Authenticated AWS User 设置为被授权者。

    受赠人是:

    <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><replaceable>http://acs.amazonaws.com/groups/global/AuthenticatedUsers</replaceable></URI></Grantee>

    更多信息请参考http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html

    【讨论】:

    • 感谢@ExploringApple 的投入。
    【解决方案2】:

    我们可以像 ExploringApple 解释的那样在 aws cli 命令中提供整个 ACL 字符串,或者只是这样做 -

    aws s3api put-bucket-acl --bucket bucketname --grant-full-control uri=http://acs.amazonaws.com/groups/global/AuthenticatedUsers
    

    文档 - http://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-acl.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-08
      • 2016-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-31
      相关资源
      最近更新 更多