1

How do you restrict bucket access of an endpoint?

Here's my password protected CloudFront page: d2hyhnit1e4g1k.cloudfront.net where the protection is created through a Lambda function.

I want to restrict access to my endpoint so I can't access the endpoint through http://data-flood.s3-website-us-east-1.amazonaws.com only through CloudFront.

1 Answer 1

2

It's easy: Simply do not grant public access to the bucket.

By default, Amazon S3 buckets are private. Therefore, nobody should be able to access the bucket.

But, you ask, how can CloudFront access the bucket to serve content? The answer is Restricting Access to Amazon S3 Content by Using an Origin Access Identity - Amazon CloudFront. That way, CloudFront can access the bucket, but nobody else can access it.

1
  • Slightly trickier, though, if you want the web site hosting features of S3, like index documents... which don't interoperate with OAI. Nov 10, 2018 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.