Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access denied when put bucket policy on aws s3 bucket with root user (= bucket owner)

I have an AWS root user which I used to create a S3 bucket on Amazon.
Now I want to make this bucket public by adding following policy:

{
   "Version": "2012-10-17",
   "Statement": [{
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::<my bucket name>/*"
   }]
}

Where <my bucket name> is the name of the bucket. When I try to save this policy I get a 403 access denied.

I tried explicitly setting the s3:PutBucketPolicy permission but it still gives a 403. Anybody knows why?

This is the image error:

image of the aws error message

like image 583
Tijl .Reynhout Avatar asked Nov 19 '18 11:11

Tijl .Reynhout


2 Answers

Capture on my AWS S3

Uncheck 2 rows for fixing the access denied. But please remember reading it clearly and consider it before you create a new bucket. Permission is really important.

like image 96
Huu Phong Nguyen Avatar answered Sep 18 '22 18:09

Huu Phong Nguyen


I've tried creating a new bucket and by setting the following permission parameters unchecked (false) the bucket policy can now be adjusted to make the bucket objects public. Afterwards I ticked off the four previous checkboxes and now it works.

permissions

like image 42
Tijl .Reynhout Avatar answered Sep 21 '22 18:09

Tijl .Reynhout