Repository navigation
sec(pre-commit): scan Go test files for private keys - #70
Conversation
detect-private-key excluded every _test.go file (and a frontend file this repo does not have), so a PEM key pasted into a test fixture passed the local and CI gate. No tracked file carries a key marker, so the exclusion is dropped entirely. Verified: a key planted in a _test.go file is skipped with the old config and caught with the new one. .gitleaksignore is removed: its only entry named internal/secrets/aws_resolver_httptest_test.go, which does not exist in this repository, and nothing here runs gitleaks. Closes #13 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 59 minutes for your next included review. View limit details
Comment |
|
Merge-driver verdict: CLEAN at An independent adversarial reviewer (Sonnet, high effort, cold brief, not the author) reviewed the full diff. It found no blocking findings. Local verification (real, macOS, pre-commit 4.7.0):
Item 3 of #13 (gitleaks in CI): still an open owner decision. I filed it as #73, so closing #13 does not lose it. Gate items:
|
|
Gate record for head @coderabbitai review |
|
|
Automated review of
Posted by a read-only review sweep. It stays silent on this commit and re-reviews only after a new push. |
Summary
detect-private-keynow scans Go test files. The hook excluded every_test.gofile, plus afrontend/src/index.htmlthis repo does not have. A PEM key pasted into a test fixture therefore passed both the local hook and CI, which runspre-commit run --all-files. No tracked file contains a key marker, so the exclusion and its stale monorepo comment are dropped entirely, not narrowed.scripts/test-git-secrets-allowlist.shbuilds its key fixture at runtime from split literals, so the hook does not match it..gitleaksignoreis removed. Its only entry namedinternal/secrets/aws_resolver_httptest_test.go, which does not exist in this repository. Nothing in CI, the hooks, the Makefile or scripts runs gitleaks or reads the file.Closes #13. The issue's third item, whether to wire gitleaks into CI, is an open question there and is not done here; it is left for the owner. Today the private-key hook and the git-secrets AWS scan cover this repo.
Verification (local, macOS, at d1d2809)
pre-commit run detect-private-key --all-filespasses on the branch._test.gofile:Review
A non-author reviewer (Sonnet, high effort) did two passes and reproduced the planted-key result against both configs. It grepped the repo for every key-marker family and for any gitleaks or
.gitleaksignorereference, and confirmed CI's pre-commit job runs this hook over the same tracked files. It agreed deleting the file is better than emptying it. No actionable findings. CodeRabbit is not pinged because the org's CR quota is exhausted.🤖 Generated with Claude Code