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

How does secrets scanning work in tools like gitleaks and trufflehog?

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

They scan files and Git history using regex rules for known token formats (AWS AKIA..., GitHub ghp_...) plus entropy checks for random-looking strings. TruffleHog additionally verifies many detected credentials by calling the provider API, so it can report whether a key is live.

gitleaks detect --source . --redact --verbose
trufflehog git file://. --only-verified

Scan the full history, not just HEAD: a deleted secret is still in old commits.

All DevSecOps questions Roadmap: Security in the pipeline

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