Created
December 3, 2013 22:35
-
-
Save benhagen/7778853 to your computer and use it in GitHub Desktop.
S3 bucket policy to restrict access by referer.
This file contains hidden or 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
{ | |
"Id": "Restrict access to S3 keys by HTTP referer header", | |
"Statement": [ | |
{ | |
"Sid": "S3 Referer Header Check", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::static.hx.io/*", | |
"Condition": { | |
"StringLike": { | |
"aws:Referer": "http://hx.io/*", | |
"aws:Referer": "https://hx.io/*" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment