Secrets Management - Replov Docs
Skip to main content

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
Never Commit Secrets
Never commit secrets to Git. Use environment variables and Replov's secrets management instead.

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

bash
# Add a secret
curl -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:

app.pypython
import os
from sqlalchemy import create_engine
# Access secrets via environment variables
DATABASE_URL = os.environ['DATABASE_URL']
API_KEY = os.environ['STRIPE_API_KEY']
JWT_SECRET = os.environ['JWT_SECRET']
# Use in your application
engine = create_engine(DATABASE_URL)
# Never log secrets!
print(f"Connecting to database...") # Good
# print(f"Password: {DATABASE_URL}") # BAD!
server.jsjavascript
// Access secrets from process.env
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const jwt = require('jsonwebtoken');
// Sign JWT with secret
const token = jwt.sign(
{ userId: user.id },
process.env.JWT_SECRET,
{ expiresIn: '1h' }
);
// Connect to database
const db = require('knex')({
client: 'pg',
connection: process.env.DATABASE_URL
});
Environment Variables
Secrets are available as standard environment variables. No special SDK or library required!

Secret Rotation

Regularly rotate secrets to maintain security:

1

Generate New Secret

Create new credentials in the external service

2

Update in Replov

Update the secret value in your service settings

3

Restart Service

Restart to load the new value; a brief interruption is possible

4

Revoke Old Secret

Disable old credentials in the external service

bash
# Update secret via API
curl -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 secret
curl -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.

text
Scope: my-api-service
Access: Only my-api-service can read this secret

Project-Level Secrets

Shared across all services in a project. Useful for shared databases.

text
Scope: my-project
Access: All services in my-project can read this secret

Organization-Level Secrets

Available to all projects in your organization. Use sparingly.

text
Scope: my-organization
Access: 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:

RoleView SecretsAdd/Edit SecretsDelete Secrets
Viewer❌❌❌
Developer✓ (masked)✓❌
Admin✓✓✓
Owner✓✓✓

Audit Logging

All secret operations are logged for security auditing:

bash
# Get secret audit logs
curl -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:

text
✓ Good:
DATABASE_URL
STRIPE_SECRET_KEY
JWT_SIGNING_SECRET
AWS_ACCESS_KEY_ID
✗ Bad:
secret1
key
password
temp

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

python
# BAD - Logs secret
logger.info(f"API Key: {os.environ['API_KEY']}")
# GOOD - Logs without secret
logger.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

javascript
// Validate secrets on startup
if (!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.

Next Steps