Skip to content

org_leak_sweep: org-wide history leak sweep script - #2286

Closed
remigiusz-antczak wants to merge 1 commit into
mainfrom
land/leak-sweep
Closed

remigiusz-antczak wants to merge 1 commit into
mainfrom
land/leak-sweep

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Closes #2279. Part of #2278.

Adds org_leak_sweep.py under 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.

Tests: 11/11 (hermetic fixture repo). 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

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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B4dfwe8bGsWUqekBt1dkaf
@remigiusz-antczak

Copy link
Copy Markdown
Collaborator Author

Superseded by #2288 (same change plus the two CI fixes), opened as a new branch to avoid a force-push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public-repo leak sweep: full history, all refs, private banlist

1 participant