Forked from ScottPhillips/s3-public-bucket-policy.json
Last active
February 22, 2017 15:11
-
-
Save giautm/8ccbf0f3df23ae6a34af75b3e6db6bfe to your computer and use it in GitHub Desktop.
Amazon S3 Bucket Policy : Restrict Access to Specific Referer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version":"2008-10-17", | |
"Id":"http referer policy example", | |
"Statement":[ | |
{ | |
"Sid":"Allow get requests referred by www.mysite.com and mysite.com", | |
"Effect":"Allow", | |
"Principal":"*", | |
"Action":"s3:GetObject", | |
"Resource":"arn:aws:s3:::YOUR_S3_BUCKET_NAME/*", | |
"Condition":{ | |
"StringLike":{ | |
"aws:Referer":[ | |
" http://www.mysite.com/*", | |
" http://mysite.com/*" | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment