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
Thevault-init container automatically:
- Initializes Vault on first startup
- Stores unseal keys in the
vault-initvolume - Unseals Vault automatically
- 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:- Parsing the reference format
- Authenticating to Vault with
VAULT_TOKEN - Fetching the secret data
- 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:- Receives OAuth tokens or API keys
- Stores them in Vault under the user’s path
- Saves a Vault reference in the database
Retrieving Secrets
Security Best Practices
Token Management
Production Considerations
- Use AppRole Authentication: Instead of the root token, create AppRole credentials for Aurora services
- Enable Audit Logging: Track all secret access
- Implement Secret Rotation: Regularly rotate cloud provider credentials
- Backup Vault Data: Regularly backup the
vault-datavolume - 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:- Export existing secrets from the database
- Store in Vault using the format above
- Update database records to Vault references
- Delete plaintext secrets from the database
Web UI
Vault’s web UI is available at http://localhost:8200/ui- Enter your
VAULT_TOKEN - Navigate to
aurora/users/ - View, create, and manage secrets
The Vault UI is useful for debugging but should be disabled or restricted in production.