Secret scanning detected leaks — what’s the correct remediation workflow? #191812
-
🏷️ Discussion TypeQuestion BodyI recently had GitHub secret scanning detect a leaked credential in my repository. I revoked the secret immediately, but I’m not fully confident that I handled everything correctly. What is the recommended remediation workflow after a secret leak? Is revoking and rotating the credential enough, or should I also rewrite Git history to remove it completely? I’d appreciate any guidance or real-world best practices. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi there, 🚨 SECRET LEAK RESPONSE CHECKLIST🔴 1. Immediate Response
🧹 2. Clean Repository HistoryOption 1 (Recommended - git filter-repo)git filter-repo --path <file-containing-secret> --invert-pathsOption 2 (BFG Repo-Cleaner)bfg --delete-files <file>Push cleaned historygit push --force
|
Beta Was this translation helpful? Give feedback.
Hi there,
🚨 SECRET LEAK RESPONSE CHECKLIST
🔴 1. Immediate Response
🧹 2. Clean Repository History
Option 1 (Recommended - git filter-repo)
Option 2 (BFG Repo-Cleaner)
Push cleaned history