> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-aws-32.md).

# AWS CloudFront distribution does not have a strict security headers policy attached misconfiguration

## Rule Details

|                        |                           |
| ---------------------- | ------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_AWS\_32          |
| Category - Subcategory | Public Exposure - APIs    |
| Provider               | AWS                       |
| Severity               | LOW                       |
| Framework              | Terraform, Terraform Plan |

## Impact

Amazon CloudFront is a content delivery network (CDN) that delivers static and dynamic web content using a global network of edge locations. CloudFront introduced response headers policies to address this need and give the customers more control in defining header modifications performed by CloudFront. While it has been possible to manipulate response headers with CloudFront's edge serverless options, typically it doesn't require a custom logic unique to the use case.

## How to Fix

*Resource:* aws\_cloudfront\_distribution

* *Argument:* response\_headers\_policy\_id (Optional) - The identifier for a response headers policy. \[source,go]

***

resource "aws\_cloudfront\_distribution" "s3\_distribution" { origin { domain\_name = aws\_s3\_bucket.b.bucket\_regional\_domain\_name origin\_id = local.s3\_origin\_id

s3\_origin\_config { origin\_access\_identity = "origin-access-identity/cloudfront/ABCDEFG1234567" } }

* default\_cache\_behavior {
* response\_headers\_policy\_id = aws\_cloudfront\_response\_headers\_policy.pass.id
* }

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec2-aws-32.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
