-
-
Save dedg3/8c155574134355ff78c27ef4b4a1cce4 to your computer and use it in GitHub Desktop.
AWS: Bucket Policy Example (Allow Get by 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 from certain domains (including local development)", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket-name-here/*", | |
"Condition": { | |
"StringLike": { | |
"aws:Referer": [ | |
"http://sub1.domain.com/*", | |
"https://sub1.domain.com/*", | |
"http://domain.com/*", | |
"https://*.domain.dev/*", | |
"https://*.domain.com/*", | |
"http://sub1.domain.dev/*", | |
"https://sub1.domain.dev/*", | |
"https://domain.com/*", | |
"http://s3.amazonaws.com/*", | |
"http://*.domain.com/*", | |
"http://app-name.herokuapp.com/*", | |
"https://app-name.herokuapp.com/*", | |
"https://s3.amazonaws.com/*", | |
"http://*.domain.dev/*", | |
"http://localhost*/*", | |
"http://localhost:*/*", | |
"https://localhost*/*", | |
"https://localhost:*/*" | |
] | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment