Leak response
Finding → validate → revoke/rotate → remove → history/exposure review → prevention improvement- Connect each finding to a concrete risk and control.
- Preserve evidence so a reviewer can reproduce the decision.
Prevent credentials from entering source control, detect historical leaks, and respond correctly when a secret is exposed.
Deleting a token from the latest file does not remove it from repository history or caches. Revoke or rotate first, then remove and investigate exposure.
Developer hooks reduce feedback time; CI scans enforce shared policy; periodic history scans detect old or newly recognized patterns.
Use narrow allowlists with owner, reason and expiry. Never silence a whole class of findings because one test fixture is noisy.
Finding → validate → revoke/rotate → remove → history/exposure review → prevention improvementGoal: Practice secret-response reasoning with a clearly fake token.
mkdir -p /tmp/devsecops-secrets && printf '%s\n' 'DEMO_TOKEN=ghp_DEMO_NOT_REAL_1234567890' > /tmp/devsecops-secrets/.envpython3 - <<'PY'
import re,pathlib
p=pathlib.Path('/tmp/devsecops-secrets/.env').read_text()
assert re.search(r'ghp_DEMO_NOT_REAL_[A-Za-z0-9]+',p)
print('synthetic secret detected')
PYRecord why revoke/rotate must happen before assuming deletion has solved exposure.
Fast secret detection matters, but containment requires credential lifecycle action.
Scan a disposable repository or directory with Gitleaks.
gitleaks versiongitleaks dir /tmp/devsecops-secrets --redact --report-format json --report-path /tmp/gitleaks.json || truetest -s /tmp/gitleaks.json && echo 'report created' || trueThree concept checks plus one scenario check.
Revoke or rotate the exposed credential, then remove it and investigate exposure.
A secret can remain in earlier commits after it is removed from the current tree.
A narrow, documented, owned and expiring suppression for a proven false positive or accepted case.
No. Rotate/revoke it and review history, logs and downstream use because the old value remains exposed.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.