AWS S3 policy for authenticated users

I am trying to install the S3 Policy bucket, but it does not work at all. I need to be allowed to upload files to anonymous users, but only authenticated users can download them. I tried 2 thoughts:

{ "Id": "Policy1378380575437", "Statement": [ { "Sid": "Stmt1378380436712", "Action": [ "s3:PutObject" ], "Effect": "Allow", "Resource": "arn:aws:s3:::my_bucket/*", "Principal": { "AWS": [ "*" ] } }, { "Sid": "Stmt1378380568645", "Action": [ "s3:GetObject" ], "Effect": "Allow", "Resource": "arn:aws:s3:::my_bucket/*", "Principal": { "AWS": [ "arn:aws:iam::1111111111:root" ] } } ] } 

But the problem is that GetObject is enabled by default, which means that anonymous users can upload files. I tried adding a new Sid argument to * GetObject, but always prohibits overriding.

I appreciate any suggestion.

Thanks.

+4
source share
1 answer

I think you could do it with an ACL. Change the permissions on your bucket to have an authenticated-read ACL. Your users will need to set this ACL flag at boot time or get an available negative error, but if you can get them to set this flag, I think this might work for you. Bucket Editing Permissions

+1
source

Source: https://habr.com/ru/post/1500712/


All Articles