Replace the naive grep-based secret scan with a real secret scanner that hard-fails CI, and document a rotation runbook for any exposed secret.
Requirements and Context
.github/workflows/ci-validate.yml currently greps for sk-[a-zA-Z0-9]{32,} patterns, which misses most secret formats (Stellar keys, JWT secrets, DB URLs, AWS keys, private keys) and only emits a warning. A real secret scanner (gitleaks or trufflehog) with a hard-fail policy, plus a rotation runbook, is the correct control for a payments platform.
Objectives
- Add a gitleaks (or trufflehog) CI job with a curated config and
exit 1 on findings.
- Add a pre-commit hook that runs the scanner on staged files.
- Provide a baseline allowlist for known-safe test fixtures (and re-review them).
- Write a
docs/secret-rotation.md runbook for Stellar keys, JWT secrets, DB creds, and API keys.
Suggested Execution
git checkout -b feat/secret-scanning.
- Add the scanner job to CI and the pre-commit config (
.husky/).
- Create
.gitleaks.toml (or trufflehog config) and the runbook.
- Run the scanner locally, fix/triage findings, and verify CI hard-fails on an injected test secret.
Acceptance Criteria
Guidelines
- Use a pinned action/version for the scanner; keep the config in-repo.
- Treat test fixtures with an explicit allowlist path, not a global disable.
Timeframe: 72 hours
Requirements and Context
.github/workflows/ci-validate.ymlcurrently greps forsk-[a-zA-Z0-9]{32,}patterns, which misses most secret formats (Stellar keys, JWT secrets, DB URLs, AWS keys, private keys) and only emits a warning. A real secret scanner (gitleaks or trufflehog) with a hard-fail policy, plus a rotation runbook, is the correct control for a payments platform.Objectives
exit 1on findings.docs/secret-rotation.mdrunbook for Stellar keys, JWT secrets, DB creds, and API keys.Suggested Execution
git checkout -b feat/secret-scanning..husky/)..gitleaks.toml(or trufflehog config) and the runbook.Acceptance Criteria
Guidelines
Timeframe: 72 hours