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. Complete this setup once per rConfig instance, then create a Vault-backed credential set for each group of devices that should use it.

  • HashiCorp Vault instance installed and operational
  • Vault authentication token or AppRole credentials with appropriate 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

Open the rConfig .env file:

Terminal window
vim /var/www/html/rconfig8/current/.env

Add or update the following lines:

Terminal window
VAULT_HASHICORP_ADDR=https://your-vault-server.com:8200
VAULT_HASHICORP_TOKEN=your_vault_token

Configuration Parameters:

  • VAULT_HASHICORP_ADDR: The full URL of your HashiCorp Vault server (including port)
  • VAULT_HASHICORP_TOKEN: Vault authentication token with read permissions for device secrets, sent as the X-Vault-Token header on every request

Save the file and clear the rConfig cache:

Terminal window
php /var/www/html/rconfig8/current/artisan rconfig:clear-all

Navigate to Platform → Integrations in the main rConfig sidebar.

Step 2: Configure HashiCorp Vault Integration

Section titled “Step 2: Configure HashiCorp Vault Integration”

Click Configure for the HashiCorp Vault integration.

HashiCorp Vault Integration

Click the Test Connection button to verify connectivity. A successful test shows a Connection test successful toast notification.

If errors occur:

  1. Verify Vault server is accessible from rConfig server
  2. Confirm authentication credentials are correct
  3. Check Vault token has not expired
  4. Ensure network connectivity and firewall rules allow access
  5. Review Vault audit logs for authentication failures

Contact your identity administrator for Vault-specific issues before reaching out to rConfig support.

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

Click the Add Vault Credential Set button.

Add Vault Credential Set

Complete the form with the following information:

Credential Set 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 Save 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 generate new token and update .env:

Terminal window
vault token create -policy=rconfig-policy

Consider using AppRole for automatic token renewal.

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

Use AppRole authentication: Prefer AppRole over long-lived tokens for automated systems like rConfig.

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.