Skip to content

audit(ci): one-time secret scan of every branch and PR head (do not merge) - #2390

Closed
lilyshen0722 wants to merge 3 commits into
mainfrom
audit/secret-scan-every-ref
Closed

lilyshen0722 wants to merge 3 commits into
mainfrom
audit/secret-scan-every-ref

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

One-time audit run, not for merge; it gets closed and its branch deleted once the scan has run.

Until #2389, Secret Scan covered 0 commits on pull requests, so commits that exist only on a branch or a PR head were never scanned. Main itself was scanned on every push. This branch swaps the scan step for one run over every remote head plus every refs/pull/*/head, with the same gitleaks version and config as #2389. It prints commit, file and rule only, never a value.

🤖 Generated with Claude Code

https://claude.ai/code/session_015eTFc9yqm2vKZiUyvLuBT4

lilyshen0722 and others added 3 commits October 21, 2026 09:57
…n has been red since 10-16

generic-api-key matched a test fixture in agentProvisionerServiceK8s.test.js:456,
the base64 of {"alg":"RS256"} followed by ".jwt" (no payload, no signature).
Because the scan walks main's full history, every push to main has failed
Secret Scan since #2213 (f660d6f), which hides any real finding behind a
known red. The allowlist names that exact literal, so a real JWT still fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015eTFc9yqm2vKZiUyvLuBT4
…of a --remotes glob

`--remotes=origin/main` is a git glob that becomes origin/main/*, so it
matched nothing. On a push the scan still worked, because `--branches`
held the checked-out branch, but a pull request checks out a detached
merge commit with no local branch, and every PR scan reported "0 commits
scanned, no leaks found": #2375, #2368 and #2389 all did. That is how
#2213's fixture passed review and only went red on main. Scan HEAD (the PR
merge commit, or the pushed branch) plus origin/main and origin/v1.0.x by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015eTFc9yqm2vKZiUyvLuBT4
…o not merge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015eTFc9yqm2vKZiUyvLuBT4
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Audit done: 8,883 commits across 3,267 refs (every remote head plus every refs/pull/*/head). One finding, at 8bc3faa frontend/src/components/ApiDevPage.tsx (generic-api-key), on an unmerged April branch. It is the developer page's example response, the standard JWT header {"alg":"HS256","typ":"JWT"} followed by a literal "...", which is not a credential. The same placeholder is already allowlisted in the .js version. No real secret found. Closing; this branch was never for merge.

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.

1 participant