Skip to main content
Aurora uses HashiCorp Vault to securely store user credentials, cloud provider tokens, and API keys.

Overview

Vault provides:
  • Secure storage: Encrypted secrets at rest and in transit
  • User scoping: Each user’s secrets are isolated under users/{user_id}/
  • Dynamic secrets: Cloud provider credentials are resolved at runtime
  • Audit logging: Track secret access and modifications

Architecture

Configuration

Environment Variables

string
default:"http://vault:8200"
required
Vault server address
string
required
Vault root token for authentication. Auto-generated by make init.On first startup, check the vault-init container logs for the root token.
string
default:"aurora"
KV v2 secrets engine mount point
string
default:"users"
Base path for user secrets

Persistent Storage

Vault data is persisted using Docker volumes:
  • vault-data: Main Vault data storage
  • vault-init: Initialization state and unseal keys

Auto-Initialization

The vault-init container automatically:
  1. Initializes Vault on first startup
  2. Stores unseal keys in the vault-init volume
  3. Unseals Vault automatically
  4. Generates a root token

First Run Setup

On first startup:

Secret Management

Secret Path Format

Secrets are stored in the KV v2 engine with the following structure:

Database References

In the Aurora database, secrets are stored as references rather than actual values:
At runtime, Aurora resolves these references by:
  1. Parsing the reference format
  2. Authenticating to Vault with VAULT_TOKEN
  3. Fetching the secret data
  4. Using the credentials

Example: Storing AWS Credentials

Vault CLI Operations

You can interact with Vault directly using the CLI:

Access Vault Shell

List Secrets

Read a Secret

Write a Secret

Delete a Secret

Test Vault Connection

API Integration

Storing User Secrets

When users connect cloud providers through the UI, Aurora:
  1. Receives OAuth tokens or API keys
  2. Stores them in Vault under the user’s path
  3. Saves a Vault reference in the database

Retrieving Secrets

Security Best Practices

Token Management

The root token has unlimited access to Vault. In production:
  1. Store it securely (password manager, secrets manager)
  2. Rotate it regularly
  3. Use AppRole authentication for services
  4. Never commit it to version control

Production Considerations

  1. Use AppRole Authentication: Instead of the root token, create AppRole credentials for Aurora services
  2. Enable Audit Logging: Track all secret access
  3. Implement Secret Rotation: Regularly rotate cloud provider credentials
  4. Backup Vault Data: Regularly backup the vault-data volume
  5. Use TLS: Enable TLS for Vault API communication

AppRole Example (Production)

Troubleshooting

Vault Not Initialized

Vault Sealed

Connection Errors

Permission Denied

Migration from Database Storage

If you’re migrating from storing secrets directly in the database:
  1. Export existing secrets from the database
  2. Store in Vault using the format above
  3. Update database records to Vault references
  4. Delete plaintext secrets from the database

Web UI

Vault’s web UI is available at http://localhost:8200/ui
  1. Enter your VAULT_TOKEN
  2. Navigate to aurora/users/
  3. View, create, and manage secrets
The Vault UI is useful for debugging but should be disabled or restricted in production.