Object ACL Vs Bucket Policy as per AWS docs

Hi All,

As I am preparing for my AWS SAA-C03 exam, while going through the below content on AWS docs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html):

​

You can use a bucket policy to grant public read permission to your objects. However, the bucket policy applies only to objects that are owned by the bucket owner. If your bucket contains objects that aren’t owned by the bucket owner, the bucket owner should use the object access control list (ACL) to grant public READ permission on those objects.

S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to both control ownership of the objects that are uploaded to your bucket and to disable or enable ACLs. By default, Object Ownership is set to the Bucket owner enforced setting, and all ACLs are disabled. When ACLs are disabled, the bucket owner owns all the objects in the bucket and manages access to them exclusively by using access-management policies.

A majority of modern use cases in Amazon S3 no longer require the use of ACLs. We recommend that you keep ACLs disabled, except in unusual circumstances where you need to control access for each object individually. With ACLs disabled, you can use policies to control access to all objects in your bucket, regardless of who uploaded the objects to your bucket.

​

As per first paragraph bucket policy applies only to object owned by bucket owner and that’s why we should use ACL however in last line of content, it’s mentioned that you can use policies to control access to all objects in your bucket. Aren’t both contractory or am I missing something ?

Please suggest.

​

​


Related discussions:

A bucket policy is at the bucket level, object ACL is at the object level. As stated in the content, it’s going to be a rare circumstance where you have something in your bucket that is owned by someone else. Even in a situation where you use the option to have buckets per user in your account, you can use a bucket policy so that only that particular user can access items in their bucket, and in turn, they can’t access other folks files in their bucket.

Like they said, it’s going to be rare that you need to control access to one object, and even then, the control to that one object could be limited by a bucket policy. Say for instance you host log data in your bucket, but that data actually belongs to your client. You COULD use an ACL per object, but that’s multiple ACL vs just using a bucket policy and restricting access to you and the client.

Any questions regarding ACLs just find the one that refers to a bucket policy.

Aren’t both contractory or am I missing something ?

With ACLs disabled ← this is the reason it’s not contradictory.

so are you saying that statement mentioned “You can use a bucket policy to grant public read permission to your objects. However, the bucket policy applies only to objects that are owned by the bucket owner. If your bucket contains objects that aren’t owned by the bucket owner, the bucket owner should use the object access control list (ACL) to grant public READ permission on those objects.” is valid only when ACLs are enabled ?

What I’m saying is when ACLs are disabled, the bucket owner (AWS account) owns all the objects in the bucket. Access to those objects is done via bucket policies and identity policies.

The statement about bucket policies only being useful for objects that the bucket owner owns is valid still … but with ACLs disabled, the bucket owner by definition owns all the objects in the bucket. With ACLs enabled, the bucket owner might not own all the objects.