Repository navigation
sec(scripts): anchor .gitallowed entries and add allowlist self-test (#2170) - #2172
Conversation
Ported from cloud-commitments-mcp, plus a structural check that every .gitallowed entry is anchored and must-catch cases with a placeholder and a secret on one line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…all hang (#2170) Port of the mcp fix. The keyword --allowed entries matched whole path:line:content lines. A no-op say() shim stops git-secrets calling macOS /usr/bin/say, which hung the install; hooks are verified after install, and the PEM and regex detectors are fixed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bare account-ID/UUID entries exempted any line containing them from every detector. Keep only path-and-line anchored entries. Closes #2170 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The repo-wide scan in setup-git-secrets.sh flags separator lines and truncated PEM literals once the bare entries are gone. Each is anchored on path and whole line. Fixtures in the self-test no longer spell a password assignment literally. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 10 minutes for your next included review. View limit details
Comment |
Independent merge-gate review (Opus 5.5): CHANGES REQUESTEDReviewed head: Blocking: removing the bare
|
Re-gate (Opus 5.5) at
|
…ent scan to self-test (#2170) The new account-ID entries and one self-test fixture were themselves flagged by the AWS account-ID pattern under the file-argument scan the pre-commit framework uses. Bracket one digit per entry, build the fixture from $ACCT, and make the self-test run that CI-equivalent scan over all tracked files. Correct the say() comment: on macOS /usr/bin/say can hang on audio output. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Addressed both gate rounds on a29d9ce: the three placeholder digit runs flagged by the file-argument scan are bracketed ( |
Re-gate (Opus 5.5) at
|
Closes #2170. Port of the cloud-commitments-mcp fix (PR #57).
.gitallowed: removed the 18 bare account-ID/UUID entries (git-secrets matches allowlist regexes against the wholepath:line:contentline, so any line containing one was exempt from every detector). Remaining entries are anchored on path and whole line.scripts/setup-git-secrets.sh: removed the 20 keyword--allowedentries (same defect); added the no-opsay()shim. Root cause of the hang: git-secrets 1.3.0 callssay, which on macOS resolves to/usr/bin/say(text-to-speech) and blocks the install. Hooks are now verified after install so a failure is loud. Dropped thetype.*service_accountdetector, as mcp did.scripts/test-git-secrets-allowlist.sh: new self-test (HOME-isolated, runtime-assembled synthetic fixtures), with must-catch cases for placeholder plus secret on one line and a check that every active entry is anchored.Evidence (local, real git-secrets binary): self-test 41 PASS / 0 FAIL. Against the old
.gitallowedit gives 29 PASS / 12 FAIL, including "account-id placeholder with a key on the same line" and "UUID placeholder with a password on the same line" scanning clean.setup-git-secrets.shnow completes on a clone of this branch, with the repo-wide scan clean.The local
actionlintpre-commit hook was skipped on the workflow commit (Docker daemon unresponsive on this machine); CI runs it.🤖 Generated with Claude Code