DBdock handles sensitive data — database credentials, API keys, and backup contents. This page covers the security features built in and the practices we recommend for production use.Documentation Index
Fetch the complete documentation index at: https://docs.dbdock.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Secrets never live in the config file
DBdock enforces a strict split:Lives in dbdock.config.json | Lives in .env |
|---|---|
| Host, port, database name, username | Database password |
| Bucket names, regions | Storage access keys |
| SMTP host, port, sender addresses | SMTP credentials |
| Slack enabled/disabled | Slack webhook URL |
| Encryption enabled flag | Encryption secret |
dbdock.config.json to your repository. Never commit .env.
Strict mode
Enable strict mode to have DBdock refuse to run if any secret appears in the config file:Encryption
Algorithm
- AES-256-GCM (authenticated encryption)
- Key derived from
DBDOCK_ENCRYPTION_SECRETvia PBKDF2 (100,000 iterations by default) - Unique IV per backup
- Authentication tag stored with the ciphertext
Generate an encryption key
Where to store the key
- Not in the backup destination. An attacker with your S3 bucket should not also have the key.
- Not in the repository.
.envis gitignored for a reason. - A password manager, secret vault, or cloud KMS is ideal.
Rotating the key
See the Key rotation guide for the full procedure. The short version: decrypt old backups with the old key, re-encrypt with the new one.Credential masking
DBdock masks credentials in log output by default. You’ll see entries like:Using .pgpass
For host-level credential isolation, use PostgreSQL’s native .pgpass file:
.pgpass automatically when present. Environment variables take priority if both are set.
.pgpass is useful when:
- Multiple tools need the same credentials
- You want OS-level file permissions gating access
- You share a machine across environments
Storage provider best practices
AWS S3 / R2
Create a dedicated IAM user or R2 API token for DBdock with least privilege:- Enable server-side encryption on the bucket (SSE-S3 or SSE-KMS)
- Block public access
- Enable versioning for ransomware protection
- Set up lifecycle rules to move old backups to Glacier if you want long retention
Local storage
- The backup directory should have
0700permissions (owner read/write/execute only) - The user running DBdock should own the directory
- Filesystem-level encryption (LUKS, FileVault, BitLocker) protects against stolen hardware
CI/CD considerations
When running DBdock in CI:- Use secret managers (GitHub Actions secrets, Vault, AWS Secrets Manager) — never commit secrets
- Prefer
DBDOCK_DB_URLover separate variables for fewer leakable values - Enable strict mode
- Use read-only database credentials for logical backups where possible
Reporting security issues
Do not file public GitHub issues for vulnerabilities.- Email: naheemolaide@gmail.com
- Or use GitHub’s private vulnerability reporting

