Help regarding s3 buckets read-write permissions #7636
-
Hello everyone, I would like to ask you some help regarding s3 bucket acl permissions. My objective is whenever i want to upload some objects/files in the bucket with the help of cli/bash script, i need to make it write allowed, and as soon as this write operation is completed i need to make the object/specific folder go read-only, In order to prevent any other persons (within an organizatino) to not modify/delete the uploaded objects. How can i achieve this? At the time of creating a bucket what kind of permissions are required to be provided? I have referred these and tried out as well. But it didn't work for me even though i see the permissions turned to read only, but i was able to go and upload files to that bucket from GUI. Commands used:
At the time of creating s3 bucket i gave these permissions:
Looking for a solution to my problem eagerly. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
@RyanFitzSimmonsAK can you help me figure out a way to solve this? |
Beta Was this translation helpful? Give feedback.
-
Hi @attili-sanjeet, thanks for reaching out. Bucket owners have full control over the bucket and objects they own inside of it. It shouldn't be possible to restrict your own permissions. If you want to restrict other accounts from deleting or modifying objects in the bucket, you can enforce that the bucket owner owns every object in the bucket, and can set restrictions on them. In your use case, are you worried about other people uploading or modifying objects from the bucket owner account? |
Beta Was this translation helpful? Give feedback.
-
Hi @RyanFitzSimmonsAK , thanks for responding to my query, i have previously tried bucket owner preferred with acl's enabled option, and asked the other people to view that object, even though with read permissions set, they were able to upload new files into that object. Yeah, i am worried wrt other people uploading or modifying objects from bucket owner account |
Beta Was this translation helpful? Give feedback.
It sounds like you're using the account's root user, and that several people have access to it. I would discourage that particular practice, as the root user has complete access to every aspect of the account. I've attached some relevant documentation.
Root user - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html
Read / write - https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html
You should be able to restrict the permissions of people not using the root user.