如何查看CloudFront托管的响应头策略?

0

【以下的问题经过翻译处理】 我需要在CloudFront预设的ManagedSecurityPolicy响应头策略基础上需要添加更多内容,但我无法查看这个策略是如何编写的。

我正在查看策略的Policy ID:67f7725c-6f97-4210-82d7-5512b31e9d03 在https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html

这个策略很好,但缺少我想要添加的内容安全策略项。

profile picture
专家
已提问 5 个月前3 查看次数
1 回答
0

【以下的回答经过翻译处理】 您需要创建自己的自定义策略。您可以在CLI中描述托管策略以获取JSON输出,然后在CloudFront中使用该输出来创建自定义策略。请参见:

aws cloudfront get-response-headers-policy --id 67f7725c-6f97-4210-82d7-5512b31e9d03

{
    "ETag": "E23ZP02F085DFQ",
    "ResponseHeadersPolicy": {
        "Id": "67f7725c-6f97-4210-82d7-5512b31e9d03",
        "LastModifiedTime": "1970-01-01T00:00:00+00:00",
        "ResponseHeadersPolicyConfig": {
            "Comment": "在每个响应中添加一组安全头",
            "Name": "Managed-SecurityHeadersPolicy",
            "SecurityHeadersConfig": {
                "XSSProtection": {
                    "Override": false,
                    "Protection": true,
                    "ModeBlock": true
                },
                "FrameOptions": {
                    "Override": false,
                    "FrameOption": "SAMEORIGIN"
                },
                "ReferrerPolicy": {
                    "Override": false,
                    "ReferrerPolicy": "strict-origin-when-cross-origin"
                },
                "ContentSecurityPolicy": {},
                "ContentTypeOptions": {
                    "Override": true
                },
                "StrictTransportSecurity": {
                    "Override": false,
                    "AccessControlMaxAgeSec": 31536000
                }
            }
        }
    }
}
profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则