I have the following Bucket Policy:
{
"Version": "2008-10-17",
"Id": "MyDomainpremiumflvfiles",
"Statement": [
{
"Sid": "Allow get requests to specific referrers",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::premiumflvfiles/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://mydomain.com/*",
"http://www.mydomain.com/*"
]
}
}
},
{
"Sid": "Allow CloudFront get requests",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789:root"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::premiumflvfiles/*"
}
]
}
Where 123456789 has been replaced with my correct customer id, and mydomain has been replaced with the correct domain.
I have taken off public access, but when I do that, I don't have access to the files from the referring domain. I'm sure I'm missing something obvious, but I can't figure it out.
Thanks for any help.
This will help you to generate a valid policy AWS Policy Generator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With