Interview Prep/Git & GitHub/Secrets, Signing and Security

You adopt a secret scanner on a ten-year-old repo and it reports 400 historical findings.

IntermediateScenarioSecrets, Signing and Security
Answer

Situation read → You cannot block all work for historical issues, but you must stop new ones.

What I'd do →

  1. Run a full-history scan once; rotate anything still valid.
  2. Create a baseline so only new findings fail: gitleaks detect --baseline-path gitleaks-baseline.json.
  3. Enable the scanner in pre-commit and as a required CI check.
  4. Burn down the baseline over time.

Why → The baseline separates "known history" from "new risk", which keeps the gate usable.

Interview tip → Rotation matters more than whether history is rewritten.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security