Secrets Management
Secure storage and management of sensitive credentials
Replov provides encrypted secrets management for API keys, database passwords, and other sensitive data. Secrets are encrypted at rest and in transit, never exposed in logs or version control.
AES-256 Encryption
Military-grade encryption at rest
Access Control
Role-based permissions
Audit Logging
Track all secret access
What Are Secrets?
Secrets are sensitive values that should never be hardcoded or committed to version control:
Common Secrets
- • Database passwords
- • API keys and tokens
- • OAuth client secrets
- • Encryption keys
- • Private certificates
- • Third-party credentials
Not Secrets
- • Public API endpoints
- • Port numbers
- • Feature flags
- • Non-sensitive config
- • Public keys
- • Application names
Adding Secrets
Add secrets via the dashboard or API:
Via Dashboard
1. Navigate to Service → Settings → Environment Variables
2. Click "Add Secret"
3. Enter key and value
4. Toggle "Secret" to encrypt the value
5. Click "Save"
Via API
# Add a secretcurl -X POST https://api.Replov.com/api/services/SERVICE_ID/secrets \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"key": "DATABASE_PASSWORD","value": "super-secret-password","encrypted": true}'
Using Secrets in Your Application
Secrets are injected as environment variables at runtime:
import osfrom sqlalchemy import create_engine# Access secrets via environment variablesDATABASE_URL = os.environ['DATABASE_URL']API_KEY = os.environ['STRIPE_API_KEY']JWT_SECRET = os.environ['JWT_SECRET']# Use in your applicationengine = create_engine(DATABASE_URL)# Never log secrets!print(f"Connecting to database...") # Good# print(f"Password: {DATABASE_URL}") # BAD!
// Access secrets from process.envconst stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);const jwt = require('jsonwebtoken');// Sign JWT with secretconst token = jwt.sign({ userId: user.id },process.env.JWT_SECRET,{ expiresIn: '1h' });// Connect to databaseconst db = require('knex')({client: 'pg',connection: process.env.DATABASE_URL});
Secret Rotation
Regularly rotate secrets to maintain security:
Generate New Secret
Create new credentials in the external service
Update in Replov
Update the secret value in your service settings
Restart Service
Restart to load the new value; a brief interruption is possible
Revoke Old Secret
Disable old credentials in the external service
# Update secret via APIcurl -X PATCH https://api.Replov.com/api/services/SERVICE_ID/secrets/DATABASE_PASSWORD \-H "Authorization: Bearer YOUR_API_KEY" \-H "Content-Type: application/json" \-d '{"value": "new-super-secret-password"}'# Restart service to load new secretcurl -X POST https://api.Replov.com/api/services/SERVICE_ID/restart \-H "Authorization: Bearer YOUR_API_KEY"
Secret Scopes
Secrets can be scoped to different levels:
Service-Level Secrets
Available only to a specific service. Most common and recommended.
Scope: my-api-serviceAccess: Only my-api-service can read this secret
Project-Level Secrets
Shared across all services in a project. Useful for shared databases.
Scope: my-projectAccess: All services in my-project can read this secret
Organization-Level Secrets
Available to all projects in your organization. Use sparingly.
Scope: my-organizationAccess: All services in all projects can read this secret
Encryption Details
How Secrets Are Protected
- At Rest: Encrypted with AES-256-GCM using unique keys per organization
- In Transit: TLS 1.3 encryption for all API communications
- In Memory: Decrypted only when injected into your container
- In Logs: Automatically redacted from all logs and error messages
- In Dashboard: Values hidden by default, require explicit "Show" action
Access Control
Control who can view and modify secrets:
| Role | View Secrets | Add/Edit Secrets | Delete Secrets |
|---|---|---|---|
| Viewer | ❌ | ❌ | ❌ |
| Developer | ✓ (masked) | ✓ | ❌ |
| Admin | ✓ | ✓ | ✓ |
| Owner | ✓ | ✓ | ✓ |
Audit Logging
All secret operations are logged for security auditing:
# Get secret audit logscurl -H "Authorization: Bearer YOUR_API_KEY" \https://api.Replov.com/api/services/SERVICE_ID/secrets/audit# Response{"logs": [{"timestamp": "2024-03-20T10:15:00Z","action": "secret_created","key": "DATABASE_PASSWORD","user": "user@example.com","ip": "203.0.113.42"},{"timestamp": "2024-03-20T14:30:00Z","action": "secret_viewed","key": "DATABASE_PASSWORD","user": "admin@example.com","ip": "203.0.113.50"},{"timestamp": "2024-03-21T09:00:00Z","action": "secret_updated","key": "DATABASE_PASSWORD","user": "admin@example.com","ip": "203.0.113.50"}]}
Best Practices
1. Use Descriptive Names
Use clear, consistent naming conventions:
✓ Good:DATABASE_URLSTRIPE_SECRET_KEYJWT_SIGNING_SECRETAWS_ACCESS_KEY_ID✗ Bad:secret1keypasswordtemp
2. Rotate Regularly
Rotate secrets every 90 days or immediately if compromised. Set calendar reminders.
3. Use Least Privilege
Grant minimum necessary permissions. Use service-level secrets instead of project-level when possible.
4. Never Log Secrets
# BAD - Logs secretlogger.info(f"API Key: {os.environ['API_KEY']}")# GOOD - Logs without secretlogger.info("API Key configured successfully")
5. Use Different Secrets Per Environment
Never share production secrets with development/staging. Use separate credentials.
6. Validate Secret Format
// Validate secrets on startupif (!process.env.DATABASE_URL) {throw new Error('DATABASE_URL is required');}if (!process.env.JWT_SECRET || process.env.JWT_SECRET.length < 32) {throw new Error('JWT_SECRET must be at least 32 characters');}
Troubleshooting
Secret Not Available
Symptom: Environment variable is undefined
Check:
- 1. Secret is added in dashboard
- 2. Service has been restarted after adding secret
- 3. Secret name matches exactly (case-sensitive)
- 4. Secret is scoped correctly (service/project/org)
Secret Visible in Logs
Solution: Secrets are automatically redacted from Replov logs, but your application code might log them. Review your logging statements.
Cannot Update Secret
Check: You have Developer or Admin role. Viewers cannot modify secrets.