Repository navigation
feat(#1352): improve(security): enable secret scanning + push protection and add gitleaks with project rules — four manual-caught leaks in a public repo - #1357
Merged
admarble merged 4 commits intoOct 8, 2026
Conversation
…ession links Entire-Checkpoint: 0ad537cafd3a
… tests in the gitleaks job The gitleaks job flagged the PR's own fixtures (home paths, a session URL). They are now assembled at run time, so the committed tree passes the scanner and the AC-5 grep. The hook-corpus redaction tests feed a real-shaped home dir again; the earlier /Users/user/ input made them unable to fail. The rule tests skip where gitleaks is absent, so the gitleaks job now runs them with SEQUANT_REQUIRE_GITLEAKS=1. Entire-Checkpoint: e122c8e45ebb
…n by fingerprint The PR scan checks every commit, so d718c03's fake fixtures still failed it after 2119fce rebuilt them at run time. .gitleaksignore lists those four findings by fingerprint (commit:file:rule:line), which cannot hide a new leak; the scanner doc says when to add one. Entire-Checkpoint: 9b9faf5e8a89
…d rule QA round 2: the range step interpolated github.base_ref and the merge_group SHAs into run:. They now arrive through env, guarded by a shape test. The claude-cse-id rule gets a fixture test (a real-shaped id flagged, a FAKE one allowed). Entire-Checkpoint: 6d79baf384c7
3 tasks
admarble
deleted the
feature/1352-improve-security-enable-secret-scanning-push-prote
branch
October 8, 2026 03:37
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.
Summary
evals/results/qa-trust-boundary-{pr-comment,tool-output}.json. I also replaced the real-shaped session URL,cse_id and project name inscripts/hook-corpus.test.tsandin-place-checkout-skill.integration.test.tswith fake values..gitleaks.tomlextends the default rules with three project rules:home-path,claude-session-urlandclaude-cse-id. Rules match by shape only, and placeholder names are allowlisted by name. I also allowlisted four fake test tokens..github/workflows/gitleaks.ymlruns onpull_requestandmerge_group. It installs a pinned gitleaks 8.30.1 with a verified checksum and SHA-pins everyuses:. It scans the PR range and the working tree, and fails if anentire/*ref exists onorigin.scripts/gitleaks-precommit.shis an optional pre-commit hook that also loads an untracked.gitleaks.local.toml, which is now gitignored.docs/reference/secret-scanning.mdand a CHANGELOG entry.AC verification
gh api repos/sequant-io/sequant --jq .security_and_analysisshowssecret_scanning,secret_scanning_push_protectionanddependabot_security_updatesallenabled.gitleaks.ymlhas the triggers and thegitleaks detect --config .gitleaks.tomlstep, and now also runs the rule tests withSEQUANT_REQUIRE_GITLEAKS=1. Four shape tests in__tests__/gitleaks-config.integration.test.tscover triggers, checksum, SHA pins and that test step.claude.ai/code/session_URL, and passes the tracked tree. 9 of 9 pass with gitleaks 8.30.1 (SEQUANT_REQUIRE_GITLEAKS=1). The first round's "8 of 8" was wrong: the tree-pass test failed on this PR's own fixtures (fixed in2119fcea).AC-4: every project rule regex is shape-basedis the mechanical backstop, not a full check. Reviewer check recorded here.git grep -nE '/Users/[a-z]+/'on the branch, filtered to non-placeholder names, is empty. Leak-shaped fixtures are built at run time.sha256sum -c -underset -euo pipefail, so a mismatch fails the job.claude plugin evalwrites the paths and is outside this repo. I redacted the committed files, and thehome-pathrule now fails any PR that reintroduces them. A note is in the scanner doc.Two deviations from the spec:
aliceis not allowlisted. It's a real-shaped name for the tests. Fixtures build/Users/alice/at run time so the committed source never holds it.testjob). The gitleaks job installs the binary and runs them withSEQUANT_REQUIRE_GITLEAKS=1, so they cannot skip there.QA round 1 fixes (
2119fcea)home-path×3,claude-session-url×1 in the new test file). Fixtures are now assembled at run time, the same idiom asFAKE_GHPinscripts/hook-corpus.test.ts. No path allowlist was added, since one would also hide a real leak added to that file later.hook-corpus.test.tsredaction tests had been switched to/Users/user/input, which made them unable to fail: with the home-path redaction disabled inscripts/hook-corpus.ts, the round-1 tests still passed 13/13. They feed a real-shaped home dir again.Mutation-verified: AC-2 — removed the "Test the project rules" step from
gitleaks.yml;__tests__/gitleaks-config.integration.test.ts > gitleaks workflow shape (#1352 AC-2) > runs the rule tests with gitleaks required, so they cannot skip in CIfailed; restored.Mutation-verified: AC-5 — replaced the home-path redaction regex in
scripts/hook-corpus.tswith a never-matching one;scripts/hook-corpus.test.ts > hook-corpus redaction > redacts emails and the home directory of a public repofailed; restored.CI round fix (
b374f18e)The PR scan checks every commit, so
d718c03e's fake fixtures still failed it after2119fcearebuilt them at run time..gitleaksignorelists those four findings by fingerprint (commit:file:rule:line), which can't hide a new leak, anddocs/reference/secret-scanning.mdsays when to add one. After a squash merge the commit isn't onmain, so the entries do nothing there.The owner still has to add the new check to the
mainruleset after a green week.npm run buildandnpm run lintpass.Mutation-verified: AC-3 — replaced the
home-pathregex with a never-matching one;__tests__/gitleaks-config.integration.test.ts > gitleaks project rules (#1352) > flags a real-shaped home pathfailed; restored.Mutation-verified: AC-3 — replaced the
claude-session-urlregex with a never-matching one;__tests__/gitleaks-config.integration.test.ts > gitleaks project rules (#1352) > flags a Claude session URLfailed; restored.Each mutation also failed the tree-pass test and the AC-4 shape test, because the never-matching regex trips both.
Pre-PR Confidence Check
merge_groupbranch of the workflow's scan range and theentire/*ls-remote step have only been checked by reading, not run on a real runner. (Restored from exec's transcript; the 2.19.0 server cut the body here, investigation(run): the exec output handed to createPR was not exec's final message — PR #1310 got the placeholder body although exec ended with a full ## Summary #1311.)scripts/gitleaks-precommit.shhas no test. It's a short optional wrapper, only syntax-checked. It usesgitleaks protect, deprecated in 8.x but working.QA round 2 fixes (
98f99f6c)github.base_refand themerge_groupSHAs reach the range script throughenv:, not${{ }}insiderun:. A shape test guards everyrun:block.claude-cse-idrule has a fixture test: a real-shaped id is flagged, acse_FAKE…one is allowed.Mutation-verified: AC-2 — put
${{ github.base_ref }}back into the rangerun:script;__tests__/gitleaks-config.integration.test.ts > gitleaks workflow shape (#1352 AC-2) > passes event values to run: scripts through env, not ${{ }}failed; restored.Mutation-verified: AC-3 — replaced the
claude-cse-idregex with a never-matching one;__tests__/gitleaks-config.integration.test.ts > gitleaks project rules (#1352) > flags a Claude cloud session id but allows a FAKE onefailed; restored.Fixes #1352
🤖 Generated by
sequant run