fix(security): the weekly secret scan has been scanning zero commits - #172
Merged
Conversation
Every scheduled run of this workflow has failed, and not because it found anything. With `path`, `base` and `head` all unset, the TruffleHog action resolves base and head to the same commit and exits on its own guard: "BASE and HEAD commits are the same. TruffleHog won't scan anything." The logs carry no chunk count and no verified_secrets line, because no scan ever started. The comment in this file asserted the opposite, that omitting base/head falls back to a full scan, and that assumption is what broke it. Setting `path: ./` makes it a whole-repository scan for real: 4,875 chunks over the full history, confirmed locally against the same v3.96.0 image the workflow pins. That first real scan surfaced 37 verified findings, all of them false. The Lob detector matches `test_` or `live_` followed by alphanumerics, which is the shape of every pytest function name in tests/, and its verifier confirms them because it cannot tell a malformed key from an unauthorized one. There is no Lob integration in this repo. Excluded by detector, not by path: skipping tests/ would blind the scan to real secrets in fixtures, which is where they are most often committed by accident. With both fixed: 4,875 chunks, 0 verified, 0 unverified.
The first dispatch that got past the BASE==HEAD guard died on "flag 'no-update' cannot be repeated". The action's own command is `git file:///tmp/ --since-commit '' --branch '' --fail --no-update`, so both --fail and --no-update are already there. Replicating that exact command locally: 4,877 chunks, 0 verified, exit 0.
Owner
Author
|
Follow-up commit: the first dispatch that cleared the BASE==HEAD guard died on Verified on the runner, dispatched on this branch: 7 MB of history actually scanned, where every previous run scanned zero. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs, one masking the other
1. The scan never ran. Every scheduled run of
secret-scan-scheduledhas failed since the workflow was added. Not on a finding: on the action's own guard.No chunk count, no
verified_secretsline, nothing. Withpath,baseandheadall unset, the action resolves base and head to the same commit and refuses. The comment in this file asserted the opposite ("on schedule/workflow_dispatch the action scans the whole repository history"), and that assumption is the bug.path: ./makes it a real whole-repository scan. Confirmed locally against the same pinned v3.96.0 image: 4,875 chunks, 7 MB of history.2. What the first real scan found: 37 verified secrets, all false.
test_any_single_byte_change_fails_closedintests/test_property_invariants.pyA Lob API key is
test_orlive_followed by alphanumerics, which is also the shape of every pytest function name intests/. They report as verified because Lob's verification endpoint cannot distinguish a malformed key from an unauthorized one. There is no Lob integration in this repo.Excluded by detector rather than by path: skipping
tests/would blind the scan to real secrets in fixtures, which is where they most often get committed by accident. Every other detector still runs over the whole tree, tests included.Result
Note
This is not unique to this repo. The same "scanned nothing" failure is live in
swelterandtransit-delivery-atlas, and the same Lob false positive is live inid-churn-sentinel(5) andwomen-artist-discovery(19). It was fixed inctdl-validateearlier today.