Skip to content

Instantly share code, notes, and snippets.

@giautm
Forked from ScottPhillips/s3-public-bucket-policy.json
Last active February 22, 2017 15:11
Show Gist options
  • Save giautm/8ccbf0f3df23ae6a34af75b3e6db6bfe to your computer and use it in GitHub Desktop.
Save giautm/8ccbf0f3df23ae6a34af75b3e6db6bfe to your computer and use it in GitHub Desktop.
Amazon S3 Bucket Policy : Restrict Access to Specific Referer
{
"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