This repository follows strict security practices:
wrangler.toml- Contains only resource IDs (D1, KV, R2).dev.vars.example- Template files with placeholder values- Source code with environment variable references
.env- Environment variables.dev.vars- Actual development secretswrangler-account.json- Cloudflare account information- Service account JSON files
- API keys, tokens, passwords
- Private keys or certificates
Development Secrets (Local):
- Store in
.dev.vars(gitignored) - Never commit actual values
Production Secrets (Cloudflare):
- Set via
wrangler secret putCLI - Or use GitHub Actions secrets for CI/CD
GitHub Actions Secrets:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKENVITE_API_BASE_URL
-
Immediately rotate all exposed credentials
# Rotate Cloudflare API token wrangler secret put JWT_SECRET --env production wrangler secret put ADMIN_PASSWORD --env production -
Remove from Git history
git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch PATH_TO_FILE" \ --prune-empty --tag-name-filter cat -- --all -
Force push (
⚠️ destructive)git push origin --force --all
-
Notify team and audit access logs
Before every commit:
- No
.envor.dev.varsfiles - No API keys or passwords in code
- All secrets use environment variables
-
.gitignoreproperly configured - Run
git diff --cachedto review changes
Pre-commit hook checks for:
- Common secret patterns
- Environment files
- Service account files
If you discover a security vulnerability:
- DO NOT open a public issue
- Email: [security contact]
- Include detailed description and steps to reproduce
- Rotate secrets every 90 days
- Review access logs monthly
- Update dependencies regularly
- Audit
.gitignorequarterly