Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 - permission to edit bucket policy

I recently created an S3 bucket on AWS through the console, with the default settigns (except the name, obviously). I try editing the Bucket Policy, but getting this error: "Error Access denied", both with my admin IAM user, and the root account.

How can I get access to edit S3 Bucket policies?

Access dennied error

like image 314
nagy.zsolt.hun Avatar asked Nov 24 '18 10:11

nagy.zsolt.hun


People also ask

How do I give permission to edit a bucket policy?

To create or edit a bucket policy 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. This opens the Edit bucket policy page.

How do I give permission to an S3 bucket?

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 contains the object. In the objects list, choose the name of the object for which you want to set permissions. Choose Permissions.

Who is responsible for S3 bucket access configuration?

By default, all Amazon S3 buckets and objects are private. Only the resource owner which is the AWS account that created the bucket can access that bucket. The resource owner can, however, choose to grant access permissions to other resources and users. One way to do this is to write an access policy.

Does IAM policy override bucket policy?

In accordance with the principle of least-privilege, decisions default to DENY and an explicit DENY always trumps an ALLOW. For example, if an IAM policy grants access to an object, the S3 bucket policies denies access to that object, and there is no S3 ACL, then access will be denied.


1 Answers

Answering my own question: by default, buckets have the following option set: "Block new public bucket policies". Turning this off will enable updating the Bucket Policy.

like image 124
nagy.zsolt.hun Avatar answered Oct 05 '22 07:10

nagy.zsolt.hun