How to provide public but exclusive access to s3 objects

0

Hi, I am building an application where users can upload and play audio files. I am storing them in an S3 bucket and made access public to it so that web page can access them to be played by users. However, this has a flaw that once user is logged in, other user's files are not protected and can be tried to access by changing/guessing s3url. Though I can use encryption but still urls have to be public which does not seem an ideal solution.

Any suggestions will be appreciated.

Regards, Deepti

질문됨 일 년 전324회 조회
3개 답변
0
수락된 답변

Hi Deepti,

You can use presigned URLs to generate a URL that can be used to access your Amazon S3 buckets. When you create a presigned URL, you associate it with a specific action. You can share the URL, and anyone with access to it can perform the action embedded in the URL as if they were the original signing user. The URL will expire and no longer work when it reaches its expiration time.

For more information about this feature, please follow the link below: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html

profile pictureAWS
답변함 일 년 전
profile pictureAWS
전문가
검토됨 일 년 전
0

Can have 2 options

  1. Use presigned url for uplod to S3 - https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html
  2. Use Cognito for user authentication, once authenticated pass the token to API gateway and then using that create a Lambda function to generate a unique URL for that user. The 2nd options is more secure and can access only user assigned objects.
AWS
Raju
답변함 일 년 전
0

Thanks for your help. I implemented presigned URLs and made the bucket private. It is working perfectly without exposing s3 resources. I believe this is exactly what I needed to do in this scenario. Once again thank you.

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인