CRITICAL: Never commit the following to version control:
- JWT secrets/tokens
- Database connection strings with passwords
- API keys (Mapbox, payment processors, etc.)
- Passwords (any kind)
- Private certificates/keys
Development:
- Copy
.env.exampleto.env - Fill in actual values
.envis in.gitignoreand will NOT be committed
Production:
- Use environment variables in Docker Compose:
${VARIABLE_NAME} - Store actual values in secure secret management system
- Never put production secrets in
docker-compose.yaml
❌ WRONG (committing secrets):
environment:
JWT_SECRET: my hardcoded secret
DATABASE_URL: postgresql://user:pass@host/db✅ CORRECT (using env vars):
environment:
JWT_SECRET: ${JWT_SECRET}
DATABASE_URL: ${DATABASE_URL}Then create .env file (not committed):
JWT_SECRET=your_secure_random_string
DATABASE_URL=postgresql://...
If you find any secrets in the repository:
- Revoke/rotate the compromised credentials immediately
- Remove from git history:
git filter-branchorgit filter-repo - Generate new secrets
- Update
.env.examplewith placeholders only
FRONTEND (jerky-vault):
- ❌ Mapbox token exposed in docker-compose.yaml
- ✅ Fixed: Use
${MAPBOX_ACCESS_TOKEN}instead
BACKEND (jerky-vault-back):
- ❌ JWT_SECRET exposed in docker-compose.yaml
- ❌ DATABASE_URL with credentials exposed in docker-compose.yaml
- ✅ Fixed: Create
.envfile with these values
If you discover a security vulnerability, please:
- Do NOT open a public issue
- Contact maintainers directly
- Include details and reproduction steps
-
Use Strong Secrets:
- JWT_SECRET: Minimum 16 characters, preferably 32+
- Use:
openssl rand -base64 32or similar
-
Regular Rotation:
- Rotate JWT secrets periodically
- Rotate database passwords
- Rotate API keys
-
Principle of Least Privilege:
- Database user should only have necessary permissions
- Don't use root/superuser accounts
-
HTTPS in Production:
- Always use HTTPS for API communication
- Validate SSL certificates
-
Dependency Updates:
- Keep dependencies updated
- Run
npm auditregularly - Monitor security advisories