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

A secret was committed and pushed. What is the correct response?

BeginnerConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer
  1. Revoke and rotate the credential immediately. That is the only real fix.
  2. Check provider logs (CloudTrail, audit logs) for use of the key during the exposure window.
  3. Remove it from history (git filter-repo or BFG) and force-push if policy allows, knowing forks, clones and caches may still hold it.
  4. Add a pre-commit hook and CI scan so it does not repeat.

Rewriting history without rotating is theatre, because the secret must be assumed leaked.

All DevSecOps questions Roadmap: Security in the pipeline

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