qoomon / aws-s3-bucket-browser

Single page application to browse AWS S3 bucket content
https://qoomon.github.io/aws-s3-bucket-browser/index.html?bucket=https://s3.amazonaws.com/spacenet-dataset#
MIT License
246 stars 85 forks source link

Private Bucket support #18

Closed samuelvinay91 closed 3 years ago

samuelvinay91 commented 3 years ago

I would like to thank for your amazing tool and I found it very useful.I request your inputs on how can we implement this for private buckets?

qoomon commented 3 years ago

Glad to hear that.

Do you want grant access bei AWS IAM or another auth provider?

samuelvinay91 commented 3 years ago

My current setup is like to have a index.htm file which would be yours and top of it I will be having a simple Basic HTTP auth driven from Lambda function.

But as per your solution, our bucket should be public to get Listobject result.But in my case its a non public.

Is there any possibility to have this BucketURL with authentication (E..g, AWS S3 SDK) and fetch the Listobject

On Thu, Jul 15, 2021, 1:40 PM Bengt Brodersen @.***> wrote:

Glad to hear that.

Do you want grant access bei AWS IAM or another auth provider?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qoomon/aws-s3-bucket-browser/issues/18#issuecomment-880490165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AET4MGKVYBPS4FV3AHA26DLTX2JV3ANCNFSM5AL2OWTQ .

qoomon commented 3 years ago

If you'll use basic auth proxy, you should be able to use something like http://username:password@your.bucket.url/

samuelvinay91 commented 3 years ago

How can do the same with accessId & secret key?

On Thu, Jul 15, 2021, 1:59 PM Bengt Brodersen @.***> wrote:

If you'll use basic auth proxy, you should be able to use something like @.***/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qoomon/aws-s3-bucket-browser/issues/18#issuecomment-880503736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AET4MGJT2MU4AYDXWDEDIGTTX2L57ANCNFSM5AL2OWTQ .

samuelvinay91 commented 3 years ago

Adding the above, would it be a safe practice to expose creds from html file?Kindly help me with best approach

On Thu, Jul 15, 2021, 2:03 PM Vinay Kumar @.***> wrote:

How can do the same with accessId & secret key?

On Thu, Jul 15, 2021, 1:59 PM Bengt Brodersen @.***> wrote:

If you'll use basic auth proxy, you should be able to use something like @.***/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qoomon/aws-s3-bucket-browser/issues/18#issuecomment-880503736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AET4MGJT2MU4AYDXWDEDIGTTX2L57ANCNFSM5AL2OWTQ .

qoomon commented 3 years ago

If you like to do it with accessId & secret key you probably need add some login logic to this index.html

Every PR is welcome. There should be an option enable login via accessId & secret key.

My approach would be the following.

qoomon commented 3 years ago

maybe this this helpful https://medium.com/@aidan.hallett/securing-aws-s3-uploads-using-presigned-urls-aa821c13ae8d

samuelvinay91 commented 3 years ago

I am actually thinking of handling this through API Gateway for S3 and I want to see that this API endpoint should work in VPC

What's your input on this ?

qoomon commented 3 years ago

I think that's fine.

Dhyanesh97 commented 2 years ago

@SamuelVinay91 Have you achieved showing contents in static-website from private bucket ? If yes any inputs from you how can I proceed ?

Use Case: I have Implemented s3-static-website + cloud-front with labda@Edge + aws congnito. cloud-front url is authenticated with cognito to show the static-website.

Even though we have enable authentication at browser level for static website, files can be accessed programmatically from anywhere.

Could you please suggest a way how we can restrict the same ?