Skip to content

review_checks.sh: add --full whole-repo mode and honour .gitleaksignore - #2102

Closed
remigiusz-antczak wants to merge 1 commit into
mainfrom
land/wave-1028an-r2
Closed

remigiusz-antczak wants to merge 1 commit into
mainfrom
land/wave-1028an-r2

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Summary

review_checks.sh was diff-only, so a whole-repo audit had to fake a base and gitleaks ignored the project's .gitleaksignore. This adds a --full mode and makes ignore handling safe.

  • --full reviews the whole working tree against git's empty tree. gitleaks runs once, batched, over the working tree (--no-git -s .), skipping node_modules, vendor and .claude/worktrees.
  • .gitleaksignore is honoured only from the base or committed version, passed with --gitleaks-ignore-path. A change cannot whitelist its own leak by editing the working-tree file.
  • Changed-file matching uses NUL-separated paths, so a non-ASCII filename can no longer hide a finding.
  • If the batched gitleaks run fails (timeout, nonzero exit or unparseable output), it now emits a not-checked row instead of reading as clean.
  • --repo and the offline OSV/trivy/XDG cache handling from Scanner offline vuln DB, semgrep writable cache, dev-only severity cap #2097 are unchanged.

Verification (run locally on this head)

  • bash scripts/test-review-checks-full.sh: 11/11 (adds working-tree-ignore, non-ASCII leak, run-failure and diff-mode cases)
  • bash scripts/test-scanner-offline-db.sh: 19/19
  • bash scripts/test-review-checks-gitleaks-allow.sh: 16/16
  • bash scripts/test-review-checks-gitleaks-template.sh: 9/9
  • python3 scripts/skill_index.py --check: ok

Independent review: 3 red and 3 yellow findings, all fixed in this commit.

🤖 Generated with Claude Code

--full scans every tracked file against git's empty tree, so users no longer synthesize a base; gitleaks runs once over the working tree (--no-git -s .) and only tracked, non-vendored files are reported. gitleaks now drops fingerprints listed in the repo's .gitleaksignore in diff and full modes, read as of BASE (HEAD under --full) so a change cannot approve its own finding. A missing gitleaks now lands as a not-checked row instead of only a stderr line. perun_policy.py is located from the script's resolved directory. The flag is routed in references/tool-hub.md and the test is wired into scripts/ci-tests.d.

Tests: 11/11 (test-review-checks-full.sh); scanner-offline-db 19/19, gitleaks-allow 16/16, gitleaks-template 9/9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@remigiusz-antczak

Copy link
Copy Markdown
Collaborator Author

Superseded by the rebased branch land/wave-1028an-r3.

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