Repository navigation
org_leak_sweep: org-wide history leak sweep script - #2288
Merged
Merged
Conversation
Adds scripts/org_leak_sweep.py under the deep-code-review skill. It lists an org's public repos with curl and a gh-derived token (passed on stdin, never in argv), mirror-clones each, runs gitleaks (redacted) over full history, and greps added lines against a banlist passed by path (default gitignored .banlist.local.txt, never committed). Output is a TSV of repo, file, commit and rule in a private out dir, never a secret or matched term; file names that match a banned term or a token shape are redacted. Git-quoted paths are unquoted and file headers are honoured only between a diff header and its first hunk, so a content line starting with "++ " is scanned. Routed from references/tool-hub.md; hermetic test uses a local fixture repo with a fake token and fake term. Tests: 11/11 size-budget-raise: .claude/skills/deep-code-review/references/tool-hub.md 15770→16646 org leak sweep route row and usage Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4dfwe8bGsWUqekBt1dkaf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2279. Part of #2278.
Adds
org_leak_sweep.pyunder the deep-code-review skill. It lists an org's public repos, mirror-clones each one, runs gitleaks over the full history, and greps added lines against a banlist that is passed by path and never committed. The output is a redacted TSV (repo, file, commit, rule) written to a private directory; no secret value or matched term ever appears in it.The token is passed on stdin, never in argv. Git-quoted paths are handled, and the sweep fails closed on git errors.
Supersedes #2286 (same change, plus two CI fixes so no force-push was needed): the test no longer crashes on runners without gitleaks (it now checks that the sweep fails closed with exit 3 and writes no TSV), and the commit carries the size-budget-raise line for the tool-hub.md growth.
Tests: 11/11 with gitleaks installed; 1/1 fail-closed check without it. The affected local CI suite passed. An independent review found 1 🔴 and 8 🟡, all fixed, and a re-review was clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B4dfwe8bGsWUqekBt1dkaf