【发布时间】:2021-10-29 01:17:32
【问题描述】:
我使用 root 用户创建存储桶调用xxx,我还创建了 IAM 用户。当我通过 IAM 用户登录时,我访问 S3 并看到错误:
You don't have permissions to list buckets
After you or your AWS administrator have updated your permissions to allow the s3:ListAllMyBuckets action, refresh this page. Learn more about Identity and access management in Amazon S3
我尝试在 IAM 上创建如下策略并为我的 IAM 用户附加。但我还是有错误?为什么 IAM 用户无法访问 s3。我还为 IAM 用户添加了AmazonS3FullAccess 权限。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListStorageLensConfigurations",
"s3:ListAccessPointsForObjectLambda",
"s3:GetAccessPoint",
"s3:PutAccountPublicAccessBlock",
"s3:GetAccountPublicAccessBlock",
"s3:ListAllMyBuckets",
"s3:ListAccessPoints",
"s3:ListJobs",
"s3:PutStorageLensConfiguration",
"s3:CreateJob"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::*/*",
"arn:aws:s3:::xxx"
]
}
]
}
【问题讨论】:
-
还有其他类型的策略可能会影响您的用户,例如基于资源的存储桶策略或 SCP 策略或权限边界。假设这些都无效,您应该在自定义策略中使用
s3:ListBuckets。如果您已将“AmazonS3FullAccess”策略附加到用户并且没有其他拒绝访问的策略,则用户将能够看到存储桶。如果用户不能,那么你做错了什么。
标签: amazon-web-services amazon-s3 amazon-iam