N
N
NameOf Var2019-10-31 17:10:49
Amazon Web Services
NameOf Var, 2019-10-31 17:10:49

How can I restrict reading files in an AWS S3 Bucket folder?

Hello.
I have an S3 Bucket, I created two folders in it: User1PhotosFolder and User2PhotosFolder. Each of these folders stores user photos.
There is also a website where these photos are uploaded and rendered. For example, suppose User1 (who is logged into my website) has a photo my-secret-photo.jpg in the User1 folder. Is there any way to set restrictions so that another user cannot access this photo? Accordingly, User1 should not have access to the User2 folder. I saw that in Amazon there is a certain key X-Amz-Security-Token in the metadata, is it possible to somehow restrict access through it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-10-31
@inoise

The whole question is through what authentication occurs. If your script goes there under your own credits, then you are doomed to implement logic in your application. If you use, for example, Cognito, then you can set the user rights and receive data using his token. In any case, you can always create temporary tokens with limited rights

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question