How would you build an organisation-wide secret scanning program?

AdvancedProductionGitleaks
Answer

Short answer

Combine prevention (pre-commit hooks, CI gates, push protection), detection (scheduled full-history scans of all repos, images and logs), response (a documented rotation runbook with owners and SLAs), and elimination of static secrets (OIDC, workload identity, secret managers).

Building blocks

Layer Implementation
Developer laptop pre-commit framework with Gitleaks, distributed via repo templates
Pull requests Required Gitleaks/TruffleHog check; SARIF to code scanning
Server-side GitHub/GitLab push protection
Continuous Nightly scan of all repos (incl. archived), container registries, CI logs
Response Runbook: rotate within hours, check audit logs, notify owner, close ticket
Root cause OIDC for CI → cloud, IRSA/Workload Identity for apps, Vault/Secrets Manager for the rest
Metrics Findings per month, time-to-rotate, % repos with hooks/CI checks

Key message

The best secret is one that doesn't exist: short-lived, automatically issued credentials remove most of the risk that scanning only detects.

What to say in the interview

"Layered prevention with hooks, required CI checks and push protection; continuous scanning of repos and images; a rotation runbook with SLAs; and steadily replacing static credentials with OIDC and workload identity, measured with metrics like time-to-rotate."

All Security Tools questions Roadmap: Gitleaks — secret scanning

More on Gitleaks