> 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/ai-and-machine-learning/appsec2-gcp-24.md).

# Vertex AI endpoint is not using a Customer Managed Key (CMK) misconfiguration detected in code

## Rule Details

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

## Impact

This rule is checking to ensure that a Vertex AI endpoint uses a Customer Managed Key (CMK). This is significant because the use of a CMK allows organizations to maintain control over their encryption keys. This can help improve the security of data by adding an additional layer of protection - any data encrypted with a CMK can only be accessed with the appropriate decryption key. Without using a CMK, organizations would be relying solely on provider managed keys, which could potentially leave them more exposed to data breaches.

## How to Fix

*Resource:* google\_vertex\_ai\_endpoint

* *Arguments:* encryption\_spec

To fix the issue you need to modify the terraform code for the Vertex AI endpoint to use a customer managed key (CMK) instead of the default Google-managed key. Set the "encryption\_spec" field in the Vertex AI endpoint block to use a customer managed key.

## The above code instructs Google Cloud to use a customer managed encryption key (CMK) for the Vertex AI endpoint. In the "encryption\_spec" block, "kms\_key\_name" is the resource ID of the customer managed key. This is secure as it gives you more control over the key management, as well as the ability to audit key use and issue key revocation. \[source,go]

## resource "google\_vertex\_ai\_endpoint" "endpoint" { ... encryption\_spec { kms\_key\_name = "some\_name" ... } ... }


---

# 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/ai-and-machine-learning/appsec2-gcp-24.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.
