7 July 2009
Amazon S3 Tricks
We use Amazon S3 as an easy and cheap CDN on many projects. Here’s some interesting things I learned recently while researching how to stop direct downloading or linking to media files:
- Any file on S3 can be turned into a torrent by adding ?torrent to the filename. As in http://bucket.s3.amazonaws.com/myfile.zip?torrent. I read about this over here.
- S3Stat looks like a useful tool for viewing your S3 logs. In particularly, checking for direct linking from other sites.
- You can make auto expiring links using S3 (documentation here). This is the meat of what I wanted to find out. Using the Query String Request Authentication (page 24 of the PDF) you can specify an expire time for a link. As I take it (and we haven’t implemented this yet, so I’m not positive), you would set the read access of the file to “Authenticated Users.” Then you would construct the URL to the file using your public AWS access key, the expire time, and then a signature that includes a hash of your request with the expire time and your private key. So if you set the expire time to something only a few seconds after the current timestamp, that link should not be useable again.
Comments
I always enjoy learning what other people think about Amazon Web Services and how they use them. Check out my very own tool CloudBerry Explorer that helps to manage S3 on Windows . It is a freeware. http://cloudberrylab.com/
Cool, I’ve taken the same approach with audio streaming in the past. It feels good to know you are on the same page with the big Amazon boys.
thanks for the tip on expiring S3 links, the link you provided goes to the API main page, do you by chance have a direct link to the article? I could not find it by searching
thanks in advance.
Check out http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?RESTAuthentication.html and then scroll down to “Query String Request Authentication Alternative.” That’s the crux of it.