Skip to content
Discussion options

You must be logged in to vote

Hi there,

🚨 SECRET LEAK RESPONSE CHECKLIST

🔴 1. Immediate Response

  • Revoke the exposed secret immediately (API key, token, password)
  • Rotate the secret (generate a new one)
  • Check logs / usage to detect any abuse (API calls, billing spikes, etc.)

🧹 2. Clean Repository History

Option 1 (Recommended - git filter-repo)

git filter-repo --path <file-containing-secret> --invert-paths

Option 2 (BFG Repo-Cleaner)

bfg --delete-files <file>

Push cleaned history

git push --force
  • Ensure the secret is removed from all commits
  • Force push the cleaned repository

⚠️ 3. Handle Exposure Outside Repo

  • Check and handle forks (contact maintainers if needed)
  • Assume anyone who cloned before cleanup may…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@minhthuy05
Comment options

Answer selected by minhthuy05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Security Build security into your GitHub workflow with features to keep your codebase secure Question Ask and answer questions about GitHub features and usage source:ui Discussions created via Community GitHub templates
2 participants