I have an s3 bucket policy like this which denies requests if the referer is not listed under
{
"Sid": "6",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my_bucket_name/*",
"Condition": {
"StringNotLike": {
"aws:Referer": [
"http://example1.com/*",
"http://example2.com/*",
"https://*amazon.com*/*"
]
}
}
}
note i tried https://*amazon.com*/*, https://*aws.amazon.com* ,https://*amazon.com*,http://*amazon.com*
my problem is that I am not able to get elastic trasncoders(one of the aws service) referer when it tries to fetch the object and thus the job gives an error like this "You do not have the permissions required to read the specified object from the specified bucket". Note everything works fine if I remove the policy. So my question is that what should I put elastic trancoders referer as?. I tried couple of combinations and searched here and there but all in vain.Please do let me know if you think that there is a better way to this.
- update:
Also is there is way that i can filter some denied request by bucket policy , for example in above case can i allow a request which is not from above domains but with a particular ip address. from the amazon docs here i saw that first they check for explicit deny and then those deny requests aren't checked is there a way around this?. Any kind of help will be highly appreciated. thanks for your time