Enable the kv-v2 secrets engine
This page explains how to enable and configure the HashiCorp Vault kv-v2 secrets engine so that Vault can manage and share secrets securely with Itential Platform.
Itential supports only kv-v2. Itential doesn’t support kv-v1.
About the kv-v2 secrets engine
Key-value version 2 (kv-v2) is a secrets engine that stores arbitrary secrets as key-value pairs and includes built-in versioning.
Benefits of kv-v2
Version control
- Maintains a complete history of secret changes.
- Lets you retrieve or restore previous versions.
- Prevents accidental data loss from overwrites.
Enhanced safety
- Supports soft deletes, so you can recover a secret within a retention period.
- Supports check-and-set operations, which prevent concurrent update conflicts.
- Supports configurable retention policies that control how many versions to keep.
Audit capabilities
- Tracks creation time, modification time, and version numbers.
- Provides a complete audit trail of secret changes.
- Helps you comply with security policies.
HashiCorp recommends kv-v2 for production use. It supersedes kv-v1, which doesn’t support versioning or soft deletes.
How versioning works
Each time you update a secret, kv-v2 creates a new version and keeps the previous versions:
API path structure
The kv-v2 API path includes /data/:
The /data/ segment distinguishes secret data from metadata and configuration endpoints. You also include this segment when you configure Platform.
Enable the kv-v2 secrets engine
Update the properties file
Go to /opt/pronghorn/current and edit the properties.json file to add the location of the token.txt file. For details, see Configure Vault properties.
Configure Vault properties
To use Vault, add a vaultProps section to your properties.json file.
Configuration parameters
Token authentication
The following example configures token authentication:
The endpoint value kv-v2/data includes the /data path segment that kv-v2 requires to access secret data. This segment distinguishes the endpoint from metadata or configuration endpoints.
If you don’t specify authMethod, Platform uses token authentication. This default maintains compatibility with earlier Platform configurations.
AppRole authentication
The following example configures AppRole authentication:
You must set up AppRole authentication and generate the role_id and secret_id separately in Vault. Include valid policies and TTL or usage limits.
Endpoint URL structure
You can customize the endpoint path. In the following example URL, v1 is a hard-coded path segment in Platform:
The URL has the following components:
http://localhost:8200: The Vault server address./v1: The Vault API version./kv-v2: The secrets engine mount point./data: The kv-v2 data endpoint. Required to access secret values.
Configure the readOnly property
The readOnly property in vaultProps controls how Platform writes secret data to Vault. The default is true.
When readOnly is true:
- UI masking is disabled.
- The UI shows secrets in clear text.
- Platform ignores custom user decorations.
- Platform doesn’t write data to Vault.
If you change readOnly from false to true after you store passwords in Vault, Platform loses access to those passwords. You must set them again manually.
Verify the configuration
After you enable kv-v2 and configure the Vault properties, verify the connection.
Check the Platform logs
Check the Platform logs for Vault messages:
Confirm that the logs show successful Vault authentication.
Test secret storage
Create a test secret in Vault and verify that Platform can retrieve it. For instructions, see Create secrets.
Additional resources
- Secrets engines in the HashiCorp Vault documentation
- KV secrets engine version 2 in the HashiCorp Vault documentation
- Secrets engines overview in the HashiCorp Vault documentation