S3如何防盜鏈?我設定了規則,但是上傳上去的檔案還是所有人可見,還得手工去掉所有人可見?
uj5u.com熱心網友回復:
你可以試試下面的桶策略readonly目錄全員可讀
refereronly限制referer的域名
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "everyone can read file",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::testpolicy/readonly/*"
},
{
"Sid": "Allow get requests referred by www.example.com and example.com",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::testpolicy/refereronly/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://www.example.com/*",
"http://example.com/*"
]
}
}
}
]
}
參考:https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/dev/example-bucket-policies.html
uj5u.com熱心網友回復:
設定了,好像沒有什么用的轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/54835.html
標籤:AWS
上一篇:spark
