Is it possible to view the cloudformation of managed Response Headers Policies?

0

I need to enhance a ManagedSecurityPolicy and add more to it, but I can't view the actual cloudformation. Is it possible to do this?

I am looking at the policy Policy ID: 67f7725c-6f97-4210-82d7-5512b31e9d03 at https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-response-headers-policies.html

This managed one is good but it is missing Content Security Policy items which I want to add on.

1개 답변
2
수락된 답변

You will need to create your own custom policy. You can describe the managed policy in the CLI to get the JSON output that you can use in your custom policy in CloudFormation

See:

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": "Adds a set of security headers to every response",
            "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 pictureAWS
전문가
Matt-B
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠