Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS S3 how to allow acces only from specific domain?

I would make video awailable but only from my own domain. Do you think it is possible to set it up with AWS S3? Or anyway this kind of intellectial property protection is not possible. If asset is available in a website, people can download it anyway, right?!

If this is the case I should prevent listing of the bucket and put salt in the name of the filename? The most valuable assets are available only with registration – login.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You’d need a custom policy for that.

{
  "Version":"2021-11-13",
  "Id":"White list a specific http-referrer",
  "Statement":[
    {
      "Sid":"Allow get requests originating from www.giuseppemandato.com",
      "Effect":"Allow",
      "Principal":"*",
      "Action":"s3:GetObject",
      "Resource":"arn:aws:s3:::BUCKET_NAME/*",
      "Condition":{
        "StringLike":{"aws:Referer":["http://www.giuseppemandato.com/*","http://giuseppemandato.com/*"]}
      }
    }
  ]
}

You can flip it by stating Effect: Deny eventually, and ignore any req coming from the given domain.


Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading