Interview Prep/DevSecOps/Application Security Testing (SAST, DAST, SCA, Secrets)

Where should secrets scanning run: pre-commit, CI, or both?

IntermediateConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer

Both, plus server-side. Pre-commit (gitleaks protect --staged or the pre-commit framework) gives instant feedback but developers can skip it with --no-verify. CI scanning is the enforceable backstop. GitHub push protection or GitLab secret push protection blocks pushes server-side before the secret lands in the repo.

Layering them means the cheap local check catches most cases and the server-side check catches the rest.

All DevSecOps questions Roadmap: Security in the pipeline

More on Application Security Testing (SAST, DAST, SCA, Secrets)