A secret was committed and pushed. What is the correct response?
BeginnerConceptApplication Security Testing (SAST, DAST, SCA, Secrets)
Answer
- Revoke and rotate the credential immediately. That is the only real fix.
- Check provider logs (CloudTrail, audit logs) for use of the key during the exposure window.
- Remove it from history (
git filter-repoor BFG) and force-push if policy allows, knowing forks, clones and caches may still hold it. - 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.
More on Application Security Testing (SAST, DAST, SCA, Secrets)
What is SAST and what are its strengths and limits?BeginnerWhat is DAST and how does it differ from SAST?BeginnerWhat is IAST and RASP?IntermediateWhat is SCA and what does it scan?BeginnerHow does a SAST tool find a SQL injection using taint analysis?AdvancedHow do you write a simple Semgrep rule?Intermediate