Skip to content

fix: scan staged blobs in pre-commit secret guard#214

Open
yibeichan wants to merge 1 commit into
mainfrom
codex/fix-precommit-staged-secret-scan
Open

fix: scan staged blobs in pre-commit secret guard#214
yibeichan wants to merge 1 commit into
mainfrom
codex/fix-precommit-staged-secret-scan

Conversation

@yibeichan

Copy link
Copy Markdown
Owner

Summary

  • scan staged blob content in the pre-commit secret guard instead of working-tree files
  • skip deleted paths when scanning staged entries
  • bump hook template version to v4 and add a regression for staged/working-tree divergence

Closes #211.

Tests

  • uv run --with pytest --with ./cli python -m pytest cli/tests/test_pre_commit_hook.py -q
  • uv run --with pytest --with ./cli python -m pytest cli/tests/test_init_standalone.py::TestInitStandalone::test_pre_commit_constant_matches_disk cli/tests/test_init_standalone.py::TestInitStandalone::test_post_commit_constant_matches_disk cli/tests/test_init_standalone.py::TestInitStandalone::test_pre_commit_blocks_real_looking_keys cli/tests/test_init_standalone.py::TestInitStandalone::test_pre_commit_does_not_match_sk_substrings -q
  • uv run --with pytest --with ./cli python -m pytest cli/tests/test_doctor.py::TestCheckHooksFreshness -q
  • cd cli && uv run --with pytest --with . python -m pytest tests/

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.

security: pre-commit hook scans working-tree files, not staged content — secret in stage can bypass detection

1 participant