Problem
The application currently lacks proper secrets management infrastructure, creating security risks:
- No
.env.example template — developers don't know which env vars are required
- Secrets in logs — LLM API keys and DB credentials may leak in error traces
- No secrets rotation docs — unclear how to rotate keys in production
- Git risk — developers might accidentally commit
.env files
For CAL FIRE deployment, this is critical because:
- Incident data is sensitive (personnel, locations, operations)
- API keys must be rotated regularly per federal compliance
- Production secrets leakage could expose entire system
Current State
Proposed Solution
1. Add .env.example template
# Database
DATABASE_URL=postgresql://user:pass@localhost/fireform
# LLM Service
LLM_API_KEY=your_api_key_here
LLM_TIMEOUT=30
# Application
SECRET_KEY=your_secret_key_here
TEMPLATE_DIR=./templates
2. Add secrets sanitization in logging
# Redact common secret patterns in logs
REDACT_PATTERNS = [
r'(api[_-]?key["\s:=]+)([a-zA-Z0-9-_]+)',
r'(password["\s:=]+)([^\s"]+)',
r'(token["\s:=]+)([a-zA-Z0-9-_.]+)'
]
3. Add secrets rotation documentation
- How to rotate DB credentials
- How to rotate LLM API keys
- Zero-downtime rotation strategy
4. Add pre-commit hook template (optional)
Suggest git hook to prevent .env commits
Impact
- Security: Prevents credential leakage
- Developer Experience: Clear onboarding for new developers
- Compliance: Aligns with federal security standards
- Production-ready: Necessary for CAL FIRE pilot deployment
References
- OWASP: Sensitive Data Exposure
- NIST SP 800-53: Access Control (AC-2)
Problem
The application currently lacks proper secrets management infrastructure, creating security risks:
.env.exampletemplate — developers don't know which env vars are required.envfilesFor CAL FIRE deployment, this is critical because:
Current State
.envis gitignored, but no template existsProposed Solution
1. Add
.env.exampletemplate2. Add secrets sanitization in logging
3. Add secrets rotation documentation
4. Add pre-commit hook template (optional)
Suggest git hook to prevent
.envcommitsImpact
References