> 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/storage/appsec2-gcp-23.md).

# Document AI Warehouse Location is not configured to use a Customer Managed Key (CMK) misconfiguratio

## Rule Details

|                        |                           |
| ---------------------- | ------------------------- |
| Cortex AppSec Rule ID  | APPSEC2\_GCP\_23          |
| Category - Subcategory | Storage - Encryption      |
| Provider               | GCP                       |
| Severity               | MEDIUM                    |
| Framework              | Terraform, Terraform Plan |

## Impact

This rule is checking to make sure that Document AI Warehouse Location is configured to use a Customer Managed Key (CMK). This step is important because it ensures that data stored in Document AI Warehouse in Google Cloud Platform is protected by encryption. Using a Customer Managed Key gives the user more control over their encryption settings, as they can set key rotation periods and disable the key when necessary. This reduces the risk of unauthorized access to data. Without a CMK, data might become vulnerable to security threats.

## How to Fix

*Resource:* google\_document\_ai\_warehouse\_location

* *Arguments:* kms\_key

In order to fix this issue, you need to specify the customer-managed encryption key while creating a document warehouse. This can be done by using the `kms_key` attribute in your `google_document_ai_warehouse_location` resource.

## The updated code now properly employs a Customer Managed Key (CMK) for handling the encryption of the document AI warehouse. This enhances the overall security as it provides tighter control over the cryptographic keys by the cloud customer compared to default encryption that uses Google-managed keys. Key Access Justifications helps to ensure that only the expected keys are being accessed. This also provides audit logging for all key usage, aiding in regulatory and compliance efforts. \[source,go]

## resource "google\_document\_ai\_warehouse\_location" "example" { ... kms\_key = "some\_value" ... }


---

# 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/storage/appsec2-gcp-23.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.
