> 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-azure-32.md).

# Azure Key vault Private endpoint connection is not configured misconfiguration detected in code

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC2\_AZURE\_32                   |
| Category - Subcategory | Public Exposure - VPC VCN VNet       |
| Provider               | AZURE                                |
| Severity               | LOW                                  |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | 399924f6-d0a7-4ab2-8dc4-d4b557cd01e2 |

## Impact

This rule is checking to ensure that a private endpoint is configured to a key vault in an Azure environment. Without a private endpoint configured, data stored in the key vault could be accessed, intercepted or altered by unauthorized individuals or systems, posing a significant security risk. A private endpoint provides a secure network path over Azure’s private network, enhancing security by minimizing exposure to potential threats.

## How to Fix

*Resource:* azurerm\_key\_vault, azurerm\_private\_endpoint

## Requires an Azure Key Vault to be connected to a private endpoint, you need to create both an azurerm\_key\_vault resource and an azurerm\_private\_endpoint resource and establish a connection between them in your Terraform configuration. Here is how to do it: \[source,go]

resource "azurerm\_virtual\_network" "example" { name = "example-vnet" address\_space = \["10.0.0.0/16"] location = azurerm\_resource\_group.example.location resource\_group\_name = azurerm\_resource\_group.example.name }

resource "azurerm\_subnet" "example" { name = "example-subnet" resource\_group\_name = azurerm\_resource\_group.example.name virtual\_network\_name = azurerm\_virtual\_network.example.name address\_prefixes = \["10.0.0.0/24"] private\_endpoint\_network\_policies\_enabled = false }

resource "azurerm\_key\_vault" "example" { name = "example-keyvault" location = azurerm\_resource\_group.example.location resource\_group\_name = azurerm\_resource\_group.example.name sku\_name = "standard" tenant\_id = "00000000-0000-0000-0000-000000000000" soft\_delete\_enabled = true purge\_protection\_enabled = true network\_acls { default\_action = "Deny" bypass = "AzureServices" } }

resource "azurerm\_private\_endpoint" "example" { name = "example-private-endpoint" location = azurerm\_resource\_group.example.location resource\_group\_name = azurerm\_resource\_group.example.name subnet\_id = azurerm\_subnet.example.id

## private\_service\_connection { name = "example-private-connection" is\_manual\_connection = false private\_connection\_resource\_id = azurerm\_key\_vault.example.id subresource\_names = \["vault"] } }


---

# 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/public-exposure/appsec2-azure-32.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.
