- β
.envfiles with real credentials - β Private keys (
.pem,.key,.crt) - β Database passwords
- β API keys or tokens
- β SSL certificates
- β Environment variables for secrets
- β
.gitignorefor sensitive files - β
env.sampleas template (with fake data) - β Secrets managers in production (AWS Secrets Manager, HashiCorp Vault)
- Development: Any password (auto-generated recommended)
- Staging: Strong password (16+ chars, mixed case, numbers, symbols)
- Production:
- Minimum 32 characters
- Generated by password manager
- Rotated regularly
- Never reused
- Local Dev:
sslmode=disable(acceptable) - Staging:
sslmode=require(mandatory) - Production:
sslmode=verify-full(mandatory)
- POSTGRES_PASSWORD must be set via environment
- Running without it will fail with clear error message
- Use:
POSTGRES_PASSWORD=yourpassword docker-compose up -d
- β
Non-root user in Docker (
nonroot:nonroot) - β Input validation at domain layer
- β SQL injection protection (parameterized queries)
- β Error handling (no sensitive data in responses)
β οΈ TODO: Add rate limitingβ οΈ TODO: Add authentication/authorizationβ οΈ TODO: Add request logging
- Immediately rotate all passwords
- Revoke compromised API keys
- Review git history:
git log --all -- .env - Use BFG Repo-Cleaner if needed
- Force push cleaned history
- Notify team members
Before deploying:
- POSTGRES_PASSWORD is set (not using default)
- DATABASE_URL uses SSL (
sslmode=require) - All
.env*files are in.gitignore - No hardcoded credentials in code
- Secrets are stored in secrets manager
- Passwords are strong and unique
# Check for committed secrets
git log --all -- .env .env.* *.pem *.key
# Scan for hardcoded secrets (install gitleaks first)
gitleaks detect --source . --verbose
# Check dependencies for vulnerabilities
go list -json -m all | nancy sleuthIf you discover a security vulnerability:
- DO NOT open a public GitHub issue
- Email: security@yourcompany.com
- Include: description, steps to reproduce, impact
- Allow time for fix before public disclosure
- Application Layer: Input validation, business rules
- Transport Layer: HTTPS/TLS, no sensitive data in URLs
- Database Layer: Encrypted connections, least privilege
- Infrastructure: Firewall rules, VPC, security groups
- Secrets Management: External secrets manager
Last Updated: 2026-01-10
Security Contact: TBD