- Never commit real credentials or API keys.
- Store runtime secrets in Google Secret Manager or GitHub Actions Secrets.
- Rotate API keys immediately after any suspected exposure.
Install repository hooks:
./scripts/security/install-git-hooks.shThis enables .githooks/pre-push, which runs scripts/security/scan-secrets.sh.
.github/workflows/ci-security.ymlruns:- gitleaks secret scan
- basic smoke checks
- Revoke exposed key(s).
- Rotate replacements.
- Rewrite git history if committed.
- Re-scan repos and verify active keys.