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.

  • 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

Device credentials must be stored in Vault with the following structure:

{
"username": "device_username",
"password": "device_password",
"enable_password": "enable_password"
}

Example Vault path:

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_ADDR=https://your-vault-server.com:8200
VAULT_TOKEN=your_vault_token
VAULT_NAMESPACE=your_namespace

Configuration Parameters:

  • VAULT_ADDR: The full URL of your HashiCorp Vault server (including port)
  • VAULT_TOKEN: Vault authentication token with read permissions for device secrets
  • VAULT_NAMESPACE: Vault namespace (optional, leave blank if not using namespaces)

Alternative: AppRole Authentication

If using AppRole instead of token authentication:

Terminal window
VAULT_ADDR=https://your-vault-server.com:8200
VAULT_ROLE_ID=your_role_id
VAULT_SECRET_ID=your_secret_id
VAULT_NAMESPACE=your_namespace

Save the file and clear the rConfig cache:

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

Navigate to Settings > Integrations in the rConfig interface.

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.

Successful connection output:

✓ Connection successful
✓ Authentication validated
✓ Read permissions confirmed

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 Settings > 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)
  • This path must exist in Vault and contain the device credentials

Field Mapping:

  • Username Key: Vault key containing username (default: username)
  • Password Key: Vault key containing password (default: password)
  • Enable Password Key: Vault key containing enable password (default: 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 \
username=admin \
password=SecurePassword123 \
enable_password=EnablePass456

For devices with unique credentials:

Terminal window
# Router 1
vault kv put secret/network/devices/router1 \
username=admin \
password=Router1Pass \
enable_password=Router1Enable
# Router 2
vault kv put secret/network/devices/router2 \
username=admin \
password=Router2Pass \
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 \
username=admin \
password=NewSecurePassword \
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=username secret/network/devices/router1
vault kv get -field=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.