Skip to content

HashiCorp Vault Setup

HashiCorp Vault logo for credential management integration

The HashiCorp Vault integration enables rConfig V8 to securely retrieve device credentials from HashiCorp Vault during connection operations. This guide covers the configuration of rConfig to communicate with your HashiCorp Vault instance and the setup of vault-backed device credentials.

Use this page when you want device credentials pulled live from HashiCorp Vault at connection time instead of stored directly in rConfig. Set up the connection once per rConfig instance, then create a Vault-backed credential set for each group of devices that should use it. HashiCorp Vault can be switched on alongside the other supported vaults.

  • HashiCorp Vault instance installed and operational
  • A Vault authentication token with appropriate read permissions
  • Secrets stored in Vault with device credentials
  • Administrator access to rConfig V8
  • Network connectivity between rConfig server and Vault API endpoint

By default, rConfig looks for a secret with these key names:

{
"device_username": "admin",
"device_password": "your_device_password",
"device_enable_password": "your_enable_password"
}

Example Vault path (KV v2):

secret/data/network/devices/router1

From V8.4.2, the Vault connection is set up in the rConfig UI. Nothing needs editing on the server and no cache clear is needed.

Navigate to Platform → Integrations. In the Device Credentials section, click Configure next to Hashicorp Vault.

Field Required Notes
Vault address Yes Full URL of the Vault server, including the port, for example https://vault.example.com:8200.
Namespace No Vault Enterprise and HCP only. Sent as the X-Vault-Namespace header. Leave blank otherwise.
Token Yes A Vault token with read access to the device secrets, sent as the X-Vault-Token header. Once saved, the box shows Saved. Leave blank to keep it. Type a new token to replace it.

Turn on Use this vault for credential sets. rConfig won’t save it switched on until the address and token are filled in.

Click Test Connection. rConfig calls /v1/sys/health with the values in the form, including any you haven’t saved yet, and shows the response. Then click Save.

Navigate to System Settings → Security & Access → Device Credentials.

Click the Add Vault Credential Set button. If more than one vault is switched on, pick Hashicorp Vault in the Vault dropdown.

Add Vault Credential Set

Complete the form with the following information:

Credential Name:

  • Descriptive name for the credential set (e.g., “Production Routers - Vault”)

Vault Endpoint URL:

  • Full path to the secret in Vault (e.g., secret/data/network/devices/router1 for a KV v2 mount named secret)
  • This path must exist in Vault and contain the device credentials

Field Mapping:

  • Username Key: Vault key containing username (default: device_username)
  • Password Key: Vault key containing password (default: device_password)
  • Enable Password Key: Vault key containing enable password (default: device_enable_password)
Vault Credential Set Form

Click Add to create the credential set.

After saving, you will see the new credential set with a Vault icon next to it, indicating it retrieves credentials from HashiCorp Vault.

Navigate to Devices and select a device to edit.

In the device edit form:

  1. Locate the Credential Set dropdown
  2. Select the newly created Vault credential set
  3. Note that username and password fields are no longer visible (credentials will be retrieved from Vault)
Device with Vault Credentials

Click Save to apply the Vault credential set to the device.

Use the debug command or connectivity test feature to verify rConfig can successfully:

  1. Retrieve credentials from Vault
  2. Authenticate to the device
  3. Execute commands or download configurations

For multiple devices sharing the same credentials:

Terminal window
# Using Vault CLI
vault kv put secret/network/devices/shared \
device_username=admin \
device_password=SecurePassword123 \
device_enable_password=EnablePass456

For devices with unique credentials:

Terminal window
# Router 1
vault kv put secret/network/devices/router1 \
device_username=admin \
device_password=Router1Pass \
device_enable_password=Router1Enable
# Router 2
vault kv put secret/network/devices/router2 \
device_username=admin \
device_password=Router2Pass \
device_enable_password=Router2Enable

When credentials change in Vault, rConfig automatically retrieves the updated values on the next device operation: no rConfig configuration changes required.

Terminal window
# Update secret in Vault
vault kv put secret/network/devices/router1 \
device_username=admin \
device_password=NewSecurePassword \
device_enable_password=NewEnablePassword

Symptoms:

  • Test Connection button returns error
  • Cannot authenticate to Vault

Resolution:

Check Vault server accessibility:

Terminal window
curl -k https://your-vault-server.com:8200/v1/sys/health

Verify token validity:

Terminal window
vault token lookup

Check token permissions:

Terminal window
vault token capabilities secret/data/network/devices

Symptoms:

  • Device connection fails
  • Error indicates invalid credentials

Resolution:

Verify secret exists in Vault:

Terminal window
vault kv get secret/network/devices/router1

Check field mappings match Vault secret structure:

  • Ensure username, password, and enable_password keys exist
  • Verify field mapping configuration in Device Credential Set

Test credential retrieval manually:

Terminal window
vault kv get -field=device_username secret/network/devices/router1
vault kv get -field=device_password secret/network/devices/router1

Symptoms:

  • Error indicates path not found
  • Secret retrieval fails

Resolution:

Verify Vault path format:

  • KV v1: secret/network/devices/router1
  • KV v2: secret/data/network/devices/router1

Check Vault version:

Terminal window
vault secrets list -detailed

Ensure path includes correct prefix based on KV version.

Symptoms:

  • Connection test succeeds initially but fails later
  • Authentication errors after period of time

Resolution:

Check token TTL:

Terminal window
vault token lookup

Renew token:

Terminal window
vault token renew

Or create a new token and paste it into the Token box on the HashiCorp Vault page, then click Save:

Terminal window
vault token create -policy=rconfig-policy

Since AppRole isn’t supported, renewal is either a manual vault token renew on a long-lived token, or a new token entered on the HashiCorp Vault page when the old one nears expiry.

Symptoms:

  • Vault returns “permission denied” errors
  • Cannot read secrets despite correct path

Resolution:

Verify token policy allows reading secrets:

# Example policy for rConfig
path "secret/data/network/devices/*" {
capabilities = ["read", "list"]
}

Apply policy to token:

Terminal window
vault policy write rconfig-policy policy.hcl
vault token create -policy=rconfig-policy

Restrict token permissions: Grant read-only access to only the secret paths needed by rConfig.

Enable Vault audit logging: Monitor credential access patterns and detect anomalies.

Rotate tokens regularly: Set appropriate TTL values and implement token renewal processes.

Use TLS encryption: Always use HTTPS for Vault communications (verify with valid certificates).

Namespace isolation: Use Vault namespaces to isolate rConfig credentials from other applications. rConfig sends one namespace for the whole instance, so keep all its secrets in that namespace.