Simple way to prevent hotlinking via referer fields in the HTTP Request.
(Does not block crafted requests)
- Go to AWS S3 Console
- Go to your bucket name -> Permissions -> Bucket Policy
- Enter the following policy (with replacement at the correct places)
{ "Version": "2008-10-17", "Id": "", "Statement": [ { "Sid": "Allow in my domains", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::imsj-wordpress/*", "Condition": { "StringLike": { "aws:Referer": "https://imsj.dev/*" } } }, { "Sid": "Deny access if referer is not my sites", "Effect": "Deny", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::imsj-wordpress/*", "Condition": { "StringNotLike": { "aws:Referer": "https://imsj.dev/*" } } } ] }
I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
Nice post. I learn something totally new and challenging on websites
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.