Hide S3 and Cloudfront endpoints

amazon s3amazon-cloudfrontamazon-route53amazon-web-services

I have setup a static website on AWS S3 and am accelerating it with AWS Cloudfront, but after, I am able to use AWS Route53 to connect my domain name to the Cloudfront endpoint. Now there are two other point of entries, S3 and Cloudfront (aside from the domain name).

Is it possible to hide the S3 and Cloudfront endpoints from the public so that they can only access website via the set domain name?

Thanks a lot!

Best Answer

Yes you can. For hiding S3 you use origin access identities and not expose s3 endpoint to any other service other than CloudFront.

To restrict access to CloudFront you have 2 choices. You can either use CloudFront's private content feature and restrict access by time or to specific IPs. Or, you can use AWS WAF and block access to any source IPs other than specific ones you want to allow