Is there an S3 policy for limiting access to only see/access one bucket?

前端 未结 23 805
孤城傲影
孤城傲影 2020-11-29 15:08

I have a simple bucket that looks like images.mysite.com on my S3 and other buckets containing backups, etc.

I want to allow a specific user to be able

23条回答
  •  半阙折子戏
    2020-11-29 16:12

    Try this policy. also take into account that there no way to let the user list only selected bucket. You can either list all buckets or none.

    {
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "s3:GetObject",
                    "s3:PutObject",
                    "s3:GetObjectAcl",
                    "s3:PutObjectAcl",
                    "s3:ListBucket",
                    "s3:GetBucketAcl",
                    "s3:PutBucketAcl",
                    "s3:GetBucketLocation"
                ],
                "Resource": "arn:aws:s3:::your_bucket_here/*",
                "Condition": {}
            },
            {
                "Effect": "Allow",
                "Action": "s3:ListAllMyBuckets",
                "Resource": "*",
                "Condition": {}
            }
        ]
    }
    

提交回复
热议问题