
What You’ll Accomplish
Secrets Management lets you connect to databases and servers without exposing credentials to users. Instead of sharing passwords, you can:- Store credentials in HashiCorp Vault, AWS Secrets Manager, or other providers
- Inject secrets at runtime—users never see the actual values
- Rotate credentials without updating connection configs
- Audit who accessed what, without credential exposure
How It Works
What Users See
When a user connects to a database configured with secrets:Supported Providers
HashiCorp Vault
Most popular self-hosted secrets manager
AWS Secrets Manager
AWS-native secrets storage
Azure Key Vault
Azure-native key and secret management
GCP Secret Manager
Google Cloud secrets storage
Environment Variables
Simple secrets via gateway environment
Kubernetes Secrets
Native Kubernetes secret references
Quick Start
Example: HashiCorp Vault
Step 1: Store a Secret in Vault
Step 2: Configure Hoop Gateway
Set environment variables for Vault access:Step 3: Create Connection with Secret Reference
In the Web App or via CLI, create a connection that references the secret:- Username:
_envs/vault/secret/databases/prod-postgres#username - Password:
_envs/vault/secret/databases/prod-postgres#password
Step 4: Test the Connection
Secret Reference Syntax
Secrets are referenced using a special syntax:| Component | Description | Example |
|---|---|---|
_envs/ | Prefix indicating a secret reference | |
<provider> | Secret provider name | vault, aws, azure, gcp |
<path> | Path to the secret in the provider | secret/databases/prod |
#<key> | (Optional) Specific key within the secret | #password |
Examples
HashiCorp Vault:Provider Configuration
HashiCorp Vault
Gateway environment variables:| Variable | Description |
|---|---|
VAULT_ADDR | Vault server URL |
VAULT_TOKEN | Authentication token |
VAULT_NAMESPACE | (Optional) Vault namespace |
AWS Secrets Manager
Gateway environment variables:| Variable | Description |
|---|---|
AWS_REGION | AWS region |
AWS_ACCESS_KEY_ID | AWS access key |
AWS_SECRET_ACCESS_KEY | AWS secret key |
Azure Key Vault
Gateway environment variables:| Variable | Description |
|---|---|
AZURE_VAULT_URL | Key Vault URL |
AZURE_CLIENT_ID | Service principal client ID |
AZURE_CLIENT_SECRET | Service principal secret |
AZURE_TENANT_ID | Azure tenant ID |
GCP Secret Manager
Gateway environment variables:| Variable | Description |
|---|---|
GCP_PROJECT_ID | Google Cloud project |
GOOGLE_APPLICATION_CREDENTIALS | Path to service account JSON |
Use Cases
1. Database Credentials
Store database passwords in Vault instead of connection configs:2. API Keys
Inject API keys for application connections:3. SSH Keys
Store SSH private keys securely:4. Kubernetes Secrets
For agents running in Kubernetes, reference native secrets:Credential Rotation
One of the biggest benefits of secrets management is seamless credential rotation:Rotation Best Practices
- Schedule regular rotations - Monthly or quarterly
- Test after rotation - Verify connections still work
- Keep previous version - Some providers support versioning
- Audit access - Check who accessed secrets recently
Troubleshooting
Connection Fails with “Secret Not Found”
Check:- Secret path is correct (including mount point for Vault)
- Provider credentials are configured on the gateway
- Provider is accessible from the gateway network
- Secret exists and has the expected key
“Permission Denied” Errors
Check:- Gateway credentials have read access to the secret
- Vault policy allows reading the path
- IAM role/policy includes the secret ARN
Secret Value Not Substituted
If you see the literal_envs/... string instead of the secret value:
- Check the syntax is exactly correct
- Verify provider is configured in gateway environment
- Restart the gateway after configuration changes
Security Best Practices
Least Privilege
Grant gateway only read access to needed secrets
Audit Logging
Enable audit logs on your secrets provider
Rotate Regularly
Schedule regular credential rotation
Separate by Environment
Use different secrets for dev/staging/prod
What NOT to Do
- Don’t store secrets in connection configs directly
- Don’t share provider tokens with users
- Don’t use the same credentials across environments
- Don’t skip rotation because “it’s working”