Search code examples
amazon-web-servicesamazon-s3websign

Amazon S3 Securing Static Website


I'm looking for a combination of policies to access a static website in a S3 bucket only with a certain token/sign string. I mean, is it possibile to make the static website not readable by everyone by default but temporary accessible with something like http://mybucket.s3-website-location.amazonaws.com/myfolder/index.html?sign=XXXXX? With this call you should also have access to all the tree in the "myfolder" folder.


Solution

  • You can only do this for a single URL at a time, using a signed S3 URL with an expiration time. There is no way to create a signature that can be appended to any of a group of URLs that will make them all work with the signature, but not work without it.

    Sorry.

    However, this is fairly easy to do with an actual website as a front end. You'd have to code the website to redirect every request to a signed URL specific to that object. To do that, you'd need an EC2 instance that runs the code you write. But as of now, S3 doesn't have a way to do this all by itself.