Last active
September 15, 2017 06:26
-
-
Save rpstreef/b17cac9ef0e09e7f6a6bbe5407c7488c to your computer and use it in GitHub Desktop.
S3 bucket policy for http referrer
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
| { | |
| "Version": "2008-10-17", | |
| "Id": "http referer policy", | |
| "Statement": [ | |
| { | |
| "Sid": "Allow get requests from YOUR.URL", | |
| "Effect": "Allow", | |
| "Principal": "*", | |
| "Action": "s3:GetObject", | |
| "Resource": "arn:aws:s3:::YOUR.URL/*", | |
| "Condition": { | |
| "StringLike": { | |
| "aws:Referer": "YOUR.URL/*" | |
| } | |
| } | |
| }, | |
| { | |
| "Sid": "Deny get requests from other domains", | |
| "Effect": "Deny", | |
| "Principal": "*", | |
| "Action": "s3:GetObject", | |
| "Resource": "arn:aws:s3:::YOUR.URL/*", | |
| "Condition": { | |
| "StringNotLike": { | |
| "aws:Referer": "YOUR.URL/*" | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment