Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 Bucket Policy Public Access Denied

Tags:

I'm trying to make my S3 bucket public but when I add the following policy I get Error Access Denied:

{    "Version":"2012-10-17",    "Statement":[{       "Sid":"AddPerm",       "Effect":"Allow",       "Principal":"*",       "Action":[          "s3:GetObject"       ],       "Resource":[          "arn:aws:s3:::emergencydatascience.org/*"       ]     }] } 
like image 886
Richard Trinh Avatar asked Nov 16 '18 22:11

Richard Trinh


People also ask

How do you attach policy to S3 bucket to give public access for object?

Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to create a bucket policy for or whose bucket policy you want to edit. Choose Permissions. Under Bucket policy, choose Edit.

How do I restrict an S3 bucket in public access?

Amazon S3 is the only object storage service that allows you to block public access to all of your objects at the bucket or the account level, now and in the future by using S3 Block Public Access. To ensure that public access to all your S3 buckets and objects is blocked, turn on block all public access.


2 Answers

Go in to your Bucket > Permissions > Public access settings > Edit > Untick Block new public ACLs and uploading public objects and Remove public access granted through public ACLs (warning)

enter image description here

like image 116
Thai Ha Avatar answered Sep 28 '22 22:09

Thai Ha


AWS has introduced Amazon S3 Block Public Access – Another Layer of Protection for Your Accounts and Buckets | AWS News Blog.

You must now disable this feature on any buckets you wish to be publicly accessible.

like image 21
John Rotenstein Avatar answered Sep 28 '22 22:09

John Rotenstein