5

我有以下存储桶策略:

{
"Version": "2008-10-17",
"Id": "MyDomainpremiumflvfiles",
"Statement": [
    {
        "Sid": "Allow get requests to specific referrers",
        "Effect": "Allow",
        "Principal": {
            "AWS": "*"
        },
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::premiumflvfiles/*",
        "Condition": {
            "StringLike": {
                "aws:Referer": [
                    "http://mydomain.com/*",
                    "http://www.mydomain.com/*"
                ]
            }
        }
    },
    {
        "Sid": "Allow CloudFront get requests",
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::123456789:root"
        },
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::premiumflvfiles/*"
    }
]
}

其中 123456789 已替换为我正确的客户 ID,并且 mydomain 已替换为正确的域。

我已经取消了公共访问权限,但是当我这样做时,我无权访问引用域中的文件。我确定我遗漏了一些明显的东西,但我无法弄清楚。

谢谢你的帮助。

4

1 回答 1

1

这将帮助您生成有效的策略AWS Policy Generator

于 2012-05-08T07:21:09.503 回答