> 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/logging/appsec-aws-276.md).

# Data Trace is not enabled in the API Gateway Method Settings misconfiguration detected in code

## Rule Details

|                        |                               |
| ---------------------- | ----------------------------- |
| Cortex AppSec Rule ID  | APPSEC\_AWS\_276              |
| Category - Subcategory | Logging - Disabled or missing |
| Provider               | AWS                           |
| Severity               | LOW                           |
| Framework              | Terraform, Terraform Plan     |

## Impact

This rule verifies that Data Trace is not enabled in the settings for API Gateway Methods on AWS. If Data Trace is enabled, it could pose a security risk as it allows verbose logging of all data between the client and server. This includes potentially sensitive information like API keys and personal data. Enabling Data Trace can also incur unnecessary costs and hamper performance due to increased logging activities, making it desirable to keep it off.

## How to Fix

*Resource:* aws\_api\_gateway\_method\_settings

* *Arguments:* settings.data\_trace\_enabled

To fix this issue, you need to ensure that 'dataTraceEnabled' is set to false in your AWS API Gateway Method Settings. The dataTraceEnabled field provides detailed information about request or response HTTP headers, status codes, and timings which can be very information-intensive. Therefore, it's recommended to disable it so as to not overload your system with too much data.

## The above code is considered secure because it explicitly sets 'dataTraceEnabled' to false in AWS API Gateway Method Settings. This ensures that no extensive, potentially overwhelming, data is traced and logged. \[source,go]

resource "aws\_api\_gateway\_method\_settings" "example" { rest\_api\_id = aws\_api\_gateway\_rest\_api.example.id stage\_name = aws\_api\_gateway\_deployment.example.stage\_name method\_path = "*/*"

## settings { metrics\_enabled = false logging\_level = "OFF" data\_trace\_enabled = false } }


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/logging/appsec-aws-276.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
