Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

s3 Policy has invalid action - s3:ListAllMyBuckets

Tags:

I'm trying these policy through console.aws.amazon.com on my buckets:

      {       "Statement": [         {           "Effect": "Allow",           "Action": [             "s3:ListBucket",             "s3:GetBucketLocation",             "s3:ListBucketMultipartUploads"           ],           "Resource": "arn:aws:s3:::itnighq",           "Condition": {}         },         {           "Effect": "Allow",           "Action": [             "s3:AbortMultipartUpload",             "s3:DeleteObject",             "s3:DeleteObjectVersion",             "s3:GetObject",             "s3:GetObjectAcl",             "s3:GetObjectVersion",             "s3:GetObjectVersionAcl",             "s3:PutObject",             "s3:PutObjectAcl",             "s3:PutObjectAclVersion"           ],           "Resource": "arn:aws:s3:::itnighq/*",           "Condition": {}         },         {           "Effect": "Allow",           "Action": "s3:ListAllMyBuckets",           "Resource": "*",           "Condition": {}         }       ]     }  

But I'm getting this error message: Policy has invalid action - s3:ListAllMyBuckets It doesn't seem to like "Resource": "*" , I've also tried to use **arn:aws:s3:::****, but it doesn't work either.

Anyone has any clue?

like image 746
zdev Avatar asked Nov 30 '12 10:11

zdev


People also ask

What is ListAllMyBuckets?

The ListAllMyBuckets operation returns a list of all buckets owned by the sender of the request. Example. Sample Request.

How do I fix an AWS S3 bucket Policy and Public permissions access denied error?

If you're denied permissions, then use another IAM identity that has bucket access, and edit the bucket policy. Or, delete and recreate the bucket policy if no one has access to it. If you're trying to add a public read policy, then disable the bucket's S3 Block Public Access.

Why is my S3 Access Denied?

If you're getting Access Denied errors on public read requests that are allowed, check the bucket's Amazon S3 block public access settings. Review the S3 Block Public Access settings at both the account and bucket level. These settings can override permissions that allow public read access.


2 Answers

As zdev mentioned, you need to do this for the IAM. Go to the IAM console and navigate to Users > Permissions > Inline policies > Create > Custom, and enter this:

{     "Version": "2012-10-17",     "Statement": [         {             "Effect": "Allow",             "Action": [                 "s3:ListAllMyBuckets"             ],             "Resource": [                 "arn:aws:s3:::*"             ]         }     ] } 
like image 188
z0r Avatar answered Sep 26 '22 10:09

z0r


I figured out myself. It needs to be done in the IAM, not in S3 itself...

like image 39
zdev Avatar answered Sep 23 '22 10:09

zdev