Repository navigation
sec(scripts): anchor .gitallowed entries, drop bare placeholders - #343
Conversation
…scan Add the structural check (every .gitallowed entry is ^...$ anchored), the secret-plus-placeholder must-catch cases, and the CI-equivalent `git ls-files -z | xargs -0 git secrets --scan` over all tracked files. Correct the say() comment in setup-git-secrets.sh (hang, not silent exit). Refs #340 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
git-secrets matches allowed patterns against the whole path:line:content line, so the 18 bare account-ID/UUID entries exempted any line containing them from every detector. Replace them with path-and-line-anchored entries for the lines a real scan flags; placeholder digits are bracketed so the file does not match itself. Closes #340 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 23 minutes for your next included review. View limit details
Comment |
… entry GNU grep (CI) rejected the "Dry-run" banner that BSD grep accepted; reproduced locally with ggrep. Refs #340 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Independent merge-gate review (Opus 5.5, claude-opus-5-5): APPROVE at 99a8e9bReviewed d5c76b6, then abb64b1 (my Finding at abb64b1 (now fixed): CI Evidence (throwaway clones, isolated HOME):
Non-blocking follow-up: the case "key appended to an allowed account-ID fixture line" uses Mutation sweep: none (tooling change, per policy). |
Closes #340
Git-secrets matches allowed patterns against the whole
path:line:contentline, so the 18 bare account-ID/UUID entries in.gitallowedexempted any line containing them from every detector (a real secret next to123456789012scanned clean). Port of cloud-commitments-cli#2172 / mcp#57..gitallowed: bare entries removed; replaced by^path:line:content$-anchored entries for the lines a real scan flags (markdown/comment rules, gofmt-aligned struct lines, synthetic account-ID fixtures). Placeholder digits are bracketed so entries do not match themselves; banner text is a closed word shape that cannot spell a key or password assignment.scripts/test-git-secrets-allowlist.sh: structural check that every entry is^...$, secret-plus-placeholder must-catch cases, and a file-argument scan (git ls-files -z | xargs -0 git secrets --scan, what pre-commit runs; macOSgit grepignores\s).scripts/setup-git-secrets.sh: corrected the say() comment. The rest of the hardening (say shim, hook verification, no keyword --allowed block, PEM fix) and the pre-commit.yml SHA pin plus self-test step were already on main (sec(scripts): git-secrets allowlist matched whole lines and whitelisted most of the repo #86).Verification (macOS, git-secrets 1.3.0, HOME-isolated clean clone of head d5c76b6): self-test 44 PASS / 0 FAIL; against main's
.gitallowed36 PASS / 8 FAIL.pre-commit run --all-fileswith CI-style--register-aws --global: Scan for AWS secrets, detect-private-key, markdownlint, gocyclo, go vet pass. go-mod-tidy/go-fmt fail only because the isolated HOME lacks the Go toolchain; docker, gosec, trivy and test hooks skipped locally (docker daemon hangs). Mutation check: AKIA key or password appended to banner/account lines is still caught.🤖 Generated with Claude Code