Use this checklist before deploying to any environment to ensure secrets are properly managed.
-
.env.examplefiles exist for backend and frontend -
.env.local.examplefiles exist for local development -
.env.production.examplefiles exist for production - All
.envfiles (except.example) are in.gitignore - No actual
.envfiles are committed to git
- Run
git log -p | grep -i "api_key\|secret\|password"- no secrets found - Run
git ls-files | grep "\.env$"- no .env files tracked - All team members aware of secret management policy
- Pre-commit hooks configured (optional but recommended)
-
STELLAR_RPC_URLuses environment variable -
STELLAR_NETWORK_PASSPHRASEuses environment variable -
VAULT_CONTRACT_IDuses environment variable -
DATABASE_URLuses environment variable -
EMAIL_API_KEYuses environment variable -
SLACK_WEBHOOK_URLuses environment variable -
PAGERDUTY_INTEGRATION_KEYuses environment variable - No hardcoded secrets in source code
-
VITE_SOROBAN_RPC_URLuses environment variable -
VITE_STELLAR_NETWORK_PASSPHRASEuses environment variable -
VITE_VAULT_CONTRACT_IDuses environment variable -
VITE_API_BASE_URLuses environment variable - No hardcoded contract IDs in source code
- No hardcoded API endpoints in source code
- Testnet uses testnet RPC URL and passphrase
- Production uses mainnet RPC URL and passphrase
- Contract IDs match the network (testnet vs mainnet)
- CORS origins restricted to appropriate domains
- Production database uses SSL (
sslmode=require) - Database credentials are not in source code
- Connection pooling configured appropriately
- Replica URLs configured if using read replicas
- Email API keys are production-grade for production
- Slack webhooks point to correct channels
- PagerDuty keys are for correct environment
- All API keys are different between environments
- API keys have appropriate permissions (least privilege)
-
deployments/contracts.testnet.jsonhas empty or testnet IDs -
deployments/contracts.mainnet.jsonhas empty or mainnet IDs - Deployment files don't contain secrets
- Deployment scripts use environment variables
- GitHub Secrets configured for all required variables
- CI/CD doesn't log sensitive information
- Build artifacts don't contain secrets
- Environment-specific builds use correct variables
-
ENVIRONMENT_SETUP_GUIDE.mdis up to date - Team members know how to access secrets
- Secret rotation schedule documented
- Incident response plan includes secret rotation
Run these commands to verify your setup:
./scripts/verify-env-security.shgit log -p | grep -i "api_key\|secret\|password\|private"grep -r "G[A-Z0-9]\{55\}" frontend/src backend/src --exclude="*.test.*" --exclude="*.spec.*"git check-ignore -v .env .env.local .env.productiongit ls-files | grep "\.env"-
.env.localcreated from.env.local.example - Testnet RPC URL configured
- Local database connection string set
- Mock/test API keys used (not production)
- Debug mode enabled
-
.env.stagingcreated with staging values - Testnet RPC URL configured
- Staging database connection string set
- Staging API keys configured
- Staging alert channels configured
-
.env.productioncreated with production values - Mainnet RPC URL configured
- Production database with SSL configured
- Production API keys configured
- Production alert channels configured
- CORS restricted to production domains only
- Rate limiting configured appropriately
- All secrets rotated from staging
| Secret Type | Frequency | Last Rotated | Next Rotation |
|---|---|---|---|
| Database Password | 90 days | - | - |
| Email API Key | 180 days | - | - |
| Slack Webhook | As needed | - | - |
| PagerDuty Key | 180 days | - | - |
| Admin API Keys | 90 days | - | - |
-
Immediate Actions (within 1 hour)
- Rotate the compromised secret immediately
- Revoke the old secret/key
- Update all environments with new secret
- Check logs for unauthorized access
-
Investigation (within 24 hours)
- Determine scope of exposure
- Check git history for secret
- Review access logs
- Identify how leak occurred
-
Remediation (within 48 hours)
- Remove secret from git history if committed
- Update documentation
- Notify affected parties if necessary
- Implement preventive measures
-
Prevention (within 1 week)
- Add pre-commit hooks
- Update team training
- Review and update security policies
- Conduct security audit
-
git-secrets - Prevents committing secrets
brew install git-secrets git secrets --install git secrets --register-aws
-
truffleHog - Finds secrets in git history
docker run --rm -v $(pwd):/proj dxa4481/trufflehog file:///proj -
detect-secrets - Baseline secret detection
pip install detect-secrets detect-secrets scan > .secrets.baseline
- AWS Secrets Manager - For AWS deployments
- HashiCorp Vault - For multi-cloud
- Azure Key Vault - For Azure deployments
- Google Secret Manager - For GCP deployments
- 1Password / LastPass - For team secret sharing
Before deploying to production, this checklist must be reviewed and signed off by:
- Developer: _________________ Date: _______
- DevOps: _________________ Date: _______
- Security: _________________ Date: _______
Last Updated: April 29, 2026
Next Review: July 29, 2026
Owner: Security Team