Deploy a static web page with protection of specific static resources on AWS S3
Last updated
Last updated
{
"Version": "2012-10-17",
"Id": "PreventHotLinking",
"Statement": [
{
"Sid": "Allow get requests referred by specific site",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::www2.kingsharkworld.com/*",
"Condition": {
"StringLike": {
"aws:Referer": "http://www1.kingsharkworld.com.s3-website.ap-northeast-2.amazonaws.com/*"
}
}
},
{
"Sid": "Explicit deny to ensure requests are allowed only from specific referer.",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::www2.kingsharkworld.com/*",
"Condition": {
"StringNotLike": {
"aws:Referer": "http://www1.kingsharkworld.com.s3-website.ap-northeast-2.amazonaws.com/*"
}
}
}
]
}[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST",
"DELETE",
"GET"
],
"AllowedOrigins": [
"http://www1.kingsharkworld.com.s3-website.ap-northeast-2.amazonaws.com"
],
"ExposeHeaders": []
}
]