> For the complete documentation index, see [llms.txt](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults/hashicorp-vault.md). Agents can also search and read this documentation through its [MCP server](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/~gitbook/mcp).

# HashiCorp Vault secrets vault

Configure HashiCorp Vault as a secrets vault, so the Insight Point retrieves integration credentials from Vault with AppRole

This reference guide provides detailed steps for configuring HashiCorp Vault to support Veza's Secrets Vaults feature. For the complete setup process, see the [main Secrets Vaults guide](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults.md).

{% hint style="info" %}
**Available in Veza v2026.8.24 and later.** An earlier Insight Point rejects the vault entry with `Unsupported vault provider: hashicorp_vault`.
{% endhint %}

## Overview

HashiCorp Vault is a self-hosted or HCP-managed secrets management platform. Veza's Insight Point authenticates to your Vault cluster with AppRole and reads secrets from a KV version 2 secrets engine. This guide covers the Vault-specific configuration requirements for integrating with Veza's Secrets Vaults feature.

## Prerequisites

* A HashiCorp Vault cluster (self-hosted or HCP Vault) reachable from your Insight Point
* Permission to enable auth methods, write policies, and create AppRole roles on the cluster
* A KV version 2 secrets engine mounted on the cluster (the default `secret/` mount, or a custom mount path)
* An external [Insight Point](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/insight-point.md) deployed in your environment

{% hint style="warning" %}
Only the KV version 2 secrets engine is supported. A KV version 1 mount fails when the Insight Point attempts to read a secret.
{% endhint %}

## HashiCorp Vault setup

The following steps configure an AppRole that can read secrets under a `veza/` path. Adapt them to your organization's deployment practices.

### Enable AppRole authentication

AppRole is the only supported auth method for this provider. The Insight Point logs in at `auth/approle/login`, so enable AppRole at its default `approle/` path. A custom AppRole mount path is not supported.

1. If AppRole is not already enabled on your cluster, enable it:

   ```bash
   vault auth enable approle
   ```

### Create a policy scoped to your secrets

1. Write a policy that grants read access to the KV v2 paths your Veza secrets live under. KV v2 read requests go through the engine's `data/` sub-path:

   ```hcl
   # veza-secrets-policy.hcl
   path "secret/data/veza/*" {
     capabilities = ["read"]
   }
   ```

   If you don't use the default `secret/` KV v2 mount, replace `secret` with your mount path. Replace `veza` with the path that holds your Veza secrets.
2. Write the policy to Vault:

   ```bash
   vault policy write veza-secrets-policy veza-secrets-policy.hcl
   ```

### Create an AppRole role

1. Create a role bound to the policy:

   ```bash
   vault write auth/approle/role/veza-insight-point \
     token_policies="veza-secrets-policy" \
     token_ttl=1h \
     token_max_ttl=4h
   ```
2. Read the role's **Role ID**:

   ```bash
   vault read auth/approle/role/veza-insight-point/role-id
   ```
3. Generate a **Secret ID** for the role:

   ```bash
   vault write -f auth/approle/role/veza-insight-point/secret-id
   ```

   Record both the Role ID and Secret ID for your Insight Point vault configuration.

{% hint style="warning" %}
**Do not generate the Secret ID with a limited `secret_id_num_uses`.** The Insight Point performs a fresh AppRole login on every secret fetch, not one time at startup, so a Secret ID restricted to a small number of uses runs out quickly, and extractions start failing. Leave `secret_id_num_uses` unset (unlimited) and rely on `secret_id_ttl` and periodic rotation instead.
{% endhint %}

### (Optional) Use a Vault Enterprise namespace

If your cluster uses Vault Enterprise namespaces, enable AppRole, write the policy, and create the role inside one namespace. That namespace must also hold the KV mount. Set `namespace` in the Insight Point configuration (see below) to the same value.

## Configure the vault on the Insight Point

Add a `hashicorp_vault` entry to the secrets vault configuration file on your external Insight Point (see [Configure vault access on Insight Point](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults.md#configure-vault-access-on-insight-point) for how the file is loaded):

```yaml
vaults:
  - name: 'MyHashiCorpVault'
    vault_provider: 'hashicorp_vault'
    auth_type: 'approle'
    auth_config:
      cluster_url: 'https://vault.example.com:8200'
      role_id: '11111111-2222-3333-4444-555555555555'
      secret_id: 'my-approle-secret-id'
      mount_path: 'secret'
      namespace: ''
```

**Field reference:**

* `cluster_url`: The Vault cluster's address, including the scheme (`http://` or `https://`) and host. Include the port if Vault does not listen on the scheme's default port. Required.
* `role_id` / `secret_id`: The AppRole credentials created above. Required.
* `mount_path`: The KV v2 secrets engine's mount path. Optional; defaults to `secret` if omitted.
* `namespace`: The Vault Enterprise namespace containing the AppRole role and KV mount. Optional; leave empty for Vault clusters without namespaces (including Vault Community Edition).

The `name` is the label for the vault in the **External Vault** list when you configure an integration.

The vault configuration has no options for a custom CA certificate or for skipping TLS verification. For an `https://` cluster URL, the Vault server's certificate must chain to a CA that the Insight Point already trusts. For a Vault certificate from a private CA, add the CA to the Insight Point's trusted bundle. With the Helm chart, use the [custom CA certificate bundle](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/insight-point/insight-point-kubernetes.md#custom-ca-certificate-bundle). That bundle replaces the container's default CA bundle, so include the default CAs as well as your private CA.

## Create secrets in HashiCorp Vault

1. Write a secret at a path under your KV v2 mount. Each key you write becomes a field Veza can map to a credential field:

   ```bash
   vault kv put -mount=secret veza/prod-ad-credentials \
     username='domain\serviceaccount' \
     password='secretpassword' \
     ldaps_certificate=@ldaps-cert.pem
   ```

   The path after the mount (`veza/prod-ad-credentials` above) is the value you'll enter as the **Secret Path** when configuring the Veza provider, or as `secret_id` in a [`secret_references` API call](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults/secret-references-api.md).
2. Repeat for each integration's credential set, following the JSON field names documented in [Create external secrets in Azure Key Vault](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults.md#create-external-secrets-in-azure-key-vault). The same field names apply regardless of which vault provider stores them.

The Insight Point reads the latest version of the KV v2 secret and reassembles its keys into the JSON object Veza expects (each Vault key becomes a JSON key). You don't need to store the value as a pre-encoded JSON string the way you would in Azure Key Vault. Because the provider returns a JSON object for every secret, attach the secret with the `JSON` mapping type if you use the [`secret_references` API](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults/secret-references-api.md). A `SIMPLE` mapping would fill the field with the whole JSON object.

## Configure the provider with secrets vault

Follow [Configure provider with secrets vault](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults.md#configure-provider-with-secrets-vault) in the main guide. Select **External Secrets Vault**, choose your HashiCorp Vault entry from the **External Vault** list, and enter the KV v2 path (for example, `veza/prod-ad-credentials`) as the **Secret Path**.

## Security considerations

* Scope each AppRole policy as narrowly as possible. Grant `read` only on the specific paths Veza needs, not the whole KV mount.
* Set `token_ttl` and `token_max_ttl` on the role to align with your rotation policy. The Insight Point logs in fresh for every secret fetch and doesn't revoke the token afterward, so short-lived tokens limit how long each one stays valid without causing failures.
* Rotate the AppRole Secret ID periodically and update the Insight Point's configuration file. The Insight Point picks up the change without a restart.
* Use TLS (`https://`) for `cluster_url` in production. Restrict network access to the Vault cluster to your Insight Point's network.

## Troubleshooting

Secret fetch failures appear in extraction errors in this form, followed by one of the messages below:

```
failed to fetch secret with ID '<secret-path>' from secrets vault '<vault-name>' of vault provider 'hashicorp_vault': ...
```

### AppRole login fails

**Problem:** The error contains `failed to log in to HashiCorp Vault cluster '<url>' via AppRole` or `AppRole login to HashiCorp Vault cluster '<url>' returned no auth info`.

**Solutions:**

1. Verify `role_id` and `secret_id` are correct and belong to the same role.
2. Confirm the Secret ID has not been exhausted (`secret_id_num_uses`) or expired (`secret_id_ttl`).
3. Confirm AppRole is enabled at the default `approle/` path.
4. If using a namespace, confirm `namespace` in the Insight Point configuration matches the namespace where the role was created.

### Secret read fails

**Problem:** The error contains `failed to read secret at path '<secret-path>' from HashiCorp Vault cluster '<url>'`, followed by the HTTP status from Vault.

**Solutions:**

1. For a not-found error, confirm the secret exists at the exact path under the configured `mount_path`, and that its latest version isn't deleted. The Insight Point reads `<mount_path>/data/<secret-path>`, so enter the Secret Path without the mount or `data/`.
2. For a permission-denied error, verify the AppRole role's policy grants `read` on `<mount_path>/data/<secret-path>`, in the correct namespace if you use one.
3. Confirm the mount is a KV **version 2** engine, not version 1.

### Vault entry is ignored

**Problem:** The vault doesn't appear in the **External Vault** list, and the Insight Point logs `Invalid secrets vault configuration` with a list of violations. The Insight Point skips an invalid entry and registers the rest.

**Solutions:**

1. `Unsupported vault provider: hashicorp_vault` means the Insight Point is older than v2026.8.24. Upgrade it.
2. `Must be one of: approle` means `auth_type` is not `approle`.
3. `Cannot be empty` names a missing `cluster_url`, `role_id`, or `secret_id`.
4. `Missing scheme` or `Invalid url scheme` means `cluster_url` doesn't start with `https://` or `http://`.

## See also

* [Main Secrets Vaults configuration guide](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults.md)
* [Using secret references via API](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults/secret-references-api.md)
* [Insight Point deployment guide](https://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/insight-point.md)
* [HashiCorp Vault AppRole documentation](https://developer.hashicorp.com/vault/docs/auth/approle)
* [HashiCorp Vault KV v2 documentation](https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v2)


---

# 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://docs.veza.com/4yItIzMvkpAvMVFAamTf/integrations/connectivity/secrets-vaults/hashicorp-vault.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.
