Configuring HashiCorp Vault for Reporting Database Credentials
The Reporting Database username and password, by default, reside within the Manager configuration. Alternatively, you can configure GridServer to retrieve these credentials from a HashiCorp Vault server at connection time. The vault provides only the username and password. You must still specify the reporting database
URL and Driver in the Reporting Database Connection fields.
When you enable the vault, the primary Director connects to the Vault server to fetch the credentials. It caches them for a configurable duration, automatically refreshes them before expiration, and passes only the resolved username and password to the Brokers. Brokers never communicate with the Vault server and do not receive the Vault configuration.
Prerequisites
Before you configure GridServer to use HashiCorp Vault, ensure that you meet the following requirements:
-
Verify that a HashiCorp Vault server (OSS or Enterprise) is online and reachable from the primary Director.
-
A Key-Value (KV) version 2 (KV v2) secret exists in the Vault. This secret must contain exactly two keys:
usernameandpasswordthat hold the reporting database credentials. -
Vault authentication details are available for either the Token or AppRole authentication method.
-
Configure the Reporting Database URL and Driver fields in the Manager configuration. Vault does not provide these values.Note: If you enable Vault but leave Reporting Database URL and Driver fields blank, the reporting database will not set up, and GridServer will not contact the Vault server.
Store the Credentials in the Vault
Create a KV v2 secret containing
username and password data. For example, using the Vault CLI:
vault kv put secret/gridserver/reporting-db username=gs_report password=<db-password>
If the KV v2 engine is mounted at
secret, use secret/data/gridserver/reporting-db as the API path in GridServer.
The
data/ segment is mandatory for KV v2 secrets.
Configure GridServer
-
Log in to the GridServer Administration Tool. Ensure that your account has the
Manager Reconfigurefeature enabled in its Security Role. -
Navigate to Admin> System Admin> Manager Configuration> Database.
-
In Reporting Database Connection, set the
URLandDriverfor your database type. For details, refer to Configuring the Reporting Database . -
Set Use HashiCorp Vault for DB credentials to
True.The HashiCorp Vault configuration fields are available. -
For your chosen authentication method, complete the HashiCorp Vault fields.For configuring the Vault fields, see Fields in Vault Settings.
-
Copy the appropriate
JDBC driver JARfile into the Manager'sDS_MANAGER/webapps/livecluster/WEB-INF/libdirectory.Note:This directory is the same as the standard reporting-database setup. -
Restart the GridServer Manager.Vault settings take effect only after the restart completes.Note:When you enable Vault, leave the
UserandPasswordfields empty. The system ignores these fields and uses credentials from Vault.
Fields in Vault Settings
For configuring the fields in the Vault settings, navigate to Admin> System Admin> Manager Configuration> Database> Reporting Database Connection.
| Field | Description | Default |
|---|---|---|
| Use HashiCorp Vault for DB credentials | When you set this field to true, the system fetches the reporting database username and password from HashiCorp Vault at connection time. The system does not use the User and Password fields. It still uses the URL and Driver fields. You must restart the system for this change to take effect. |
False |
| Vault URL | The Base URL of the HashiCorp Vault server, which includes the protocol and port. For example, https://vault.example.com:8200. | (empty) |
| Vault Auth Method | The authentication method to use when connecting to Vault: Token or AppRole. |
Token |
| Vault Token | The Static Vault token used when Vault Auth Method= Token. (Masked.) |
(empty) |
| Vault AppRole Role ID | The Role ID for AppRole authentication (Vault Auth Method= AppRole). |
(empty) |
| Vault AppRole Secret ID | The Secret ID for AppRole authentication (Vault Auth Method= AppRole). |
(empty) |
| Vault Secret Path | The KV v2 API path to the secret that contains the username and password keys. You must include the data/ segment. For example, secret/data/gridserver/reporting-db. |
(empty) |
| Vault Namespace | Optional. Vault Enterprise namespace. This value sets the X-Vault-Namespace header. For open-source Vault, leave this field blank. |
(empty) |
| Vault Skip TLS Verification | If true, this option disables TLS certificate validation for Vault connections. Use this setting for development and testing environments only. In production environments, this option must be false. |
False |
| Vault Connection Timeout (seconds) | The timeout, in seconds, for Vault HTTP requests. | 10 |
| Vault Credential Cache TTL (seconds) | The duration, in seconds, for which fetched credentials are cached before being re-fetched from the Vault. | 300 |
Setting Vault Properties During Silent Installation
Alternatively, set the Vault properties in the
install.silent response file. This file is in the Manager root directory, which is the same folder as install.bat or install.sh. During a silent installation, the silent installer reads this file. It writes the corresponding DSVault* values to installation.properties in the DS_DATA/conf directory. For more information, see Silent Installation.
The
install.silent keys that correspond to the Reporting Database Connection Vault fields are in the following table.
install.silent key |
Corresponding Field | Example |
|---|---|---|
vaultEnabled |
Use HashiCorp Vault for DB credentials | true |
vaultUrl |
Vault URL | https://vault.example.com:8200 |
vaultAuthMethod |
Vault Auth Method | token or approle |
vaultToken |
Vault Token | <token value> |
vaultRoleId |
Vault AppRole Role ID | <role id> |
vaultSecretId |
Vault AppRole Secret ID | <secret id> |
vaultSecretPath |
Vault Secret Path | secret/data/gridserver/reporting-db |
vaultNamespace |
Vault Namespace | Optional. Vault Enterprise |
For example, a Token-auth configuration:
vaultEnabled=true
vaultUrl=https://vault.example.com:8200
vaultAuthMethod=token
vaultToken=<vault-token>
vaultSecretPath=secret/data/gridserver/reporting-db
Note:
-
The settings
Vault Skip TLS Verification,Vault Connection Timeout (seconds), andVault Credential Cache TTL (seconds)are not available ininstallation.propertiesfile. These settings use default values ofFalse,10 seconds, and300 seconds. You can modify these values in the Administration Tool. For additional details, refer to Securing Passwords and Internal.script. -
When you apply a hotfix or service pack to an existing Manager, the system does not automatically add new
DSVault*keys to yourinstallation.propertiesfile. You must manually add these keys to theDS_DATA/conf/installation.propertiesfile. Then, reinstall or restart the Manager to apply the settings. -
HashiCorp Vault storage is supported for the Primary Director only. Secondary Directors and failover configurations do not support this storage.
-
The HashiCorp Vault integration does not cover either Engine Instrumentation or Scheduler Instrumentation. Vault-based credential resolution is implemented only for the Reporting Database path.
Authentication Methods
GridServer authenticates to Vault using one of the following methods:
-
Token: You authenticate GridServer to Vault using the provided Vault Token. GridServer uses this token for all subsequent interactions with Vault.
-
AppRole: GridServer logs in by sending an HTTP
POSTrequest to<Vault URL>/v1/auth/approle/loginusing the configuredRole IDandSecret ID. GridServer then uses the client token returned by this login process. The system caches this token and reuses it until its lease nears expiration. You must ensure theRole IDandSecret IDare correctly configured for AppRole authentication.
Credential Refresh Process
The system caches credentials for the duration specified by the Vault Credential Cache TTL (seconds) and refreshes them proactively before the cache expires. If a database connection fails due to an authentication error, GridServer invalidates the current cache and retries with newly fetched credentials. Rotated credentials are only applied to new connections. Connections already established and present in the connection pool continue to utilize their existing credentials until those connections are re-established.
Security Notes
-
You must set Vault Skip TLS Verification set to
Falsein production environments to validate the Vault server's certificate. If you enable this setting, the Manager log records a security warning. -
The UI masks the Vault Token and Vault AppRole Secret ID fields.
-
Brokers do not receive the Vault configuration or long-lived credentials. The Director provides only the resolved
usernameandpassword.
Configuration Verification
After the Manager restarts, verify that the reporting database connects successfully. On a successful connection, the Manager log records the following
INFO-level messages:
Fetching reporting DB credentials from Vault at <Vault URL>
Successfully fetched reporting DB credentials from Vault path: <Vault Secret Path>
Troubleshooting
| Symptom / Message | Likely Cause |
|---|---|
Log warning that Vault is enabled but the Reporting Database URL and/or Driver is empty. The reporting database is not set up and Vault is not contacted. |
The URL and/or Driver are not set. Vault supplies only the username/ password. Set the URL and Driver as well. |
Vault auth method is 'token' but ... Token is not configured |
Vault Auth Method is Token, but Vault Token is empty. |
Vault auth method is 'approle' but ... Role ID / Secret ID is not configured |
AppRole is selected, but the Role ID or Secret ID is empty. |
... Secret Path is not configured |
Vault Secret Path is empty. |
Could not extract 'username' and/or 'password' keys from Vault secret at path: ... |
The secret does not contain keys named exactly username and password, or the path is not a KV v2data/ path. |
Vault returned HTTP <status>: ... |
Vault rejected the request (for example, bad token/role, wrong path, insufficient permissions, or the server is unreachable). |