【发布时间】:2018-04-24 05:10:34
【问题描述】:
我创建了一个 Amazon S3 存储桶来仅存储我网站中的图像。我拥有超过 100 万张具有公共读取权限的图像。每次我登录时,亚马逊都会给我这个警告:
"此存储桶具有公共访问权限 您已提供对此存储桶的公开访问权限。我们强烈建议您永远不要授予对您的 S3 存储桶的任何类型的公共访问权限。 "
我使用以下存储桶策略只允许在我的网站中显示图片:
{
"Version": "2012-10-17",
"Id": "http referer policy example",
"Statement": [
{
"Sid": "Allow get requests originated from www.example.com and example.com.br",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::examplebucket.com/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://www.example.com/*",
"http://www.example.com.br/*",
"https://www.example.com/*",
"https://www.example.com.br/*"
]
}
}
}
]
}
如何撤消对存储桶和我的文件的公共访问权限并将其仅授予我的站点?
谢谢!
【问题讨论】:
标签: amazon-web-services amazon-s3