Skip to content

fix(security): the weekly secret scan has been scanning zero commits - #172

Merged
ChelseaKR merged 2 commits into
mainfrom
fix/secret-scan-scans-nothing
Aug 12, 2026
Merged

fix(security): the weekly secret scan has been scanning zero commits#172
ChelseaKR merged 2 commits into
mainfrom
fix/secret-scan-scans-nothing

Conversation

@ChelseaKR

Copy link
Copy Markdown
Owner

Two bugs, one masking the other

1. The scan never ran. Every scheduled run of secret-scan-scheduled has failed since the workflow was added. Not on a finding: on the action's own guard.

::error::BASE and HEAD commits are the same. TruffleHog won't scan anything.
Process completed with exit code 1.

No chunk count, no verified_secrets line, nothing. With path, base and head all 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.

Detector Count Example match
Lob 37 test_any_single_byte_change_fails_closed in tests/test_property_invariants.py

A Lob API key is test_ or live_ followed by alphanumerics, which is also the shape of every pytest function name in tests/. 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

$ trufflehog git file://. --results=verified --exclude-detectors=Lob
finished scanning  {"chunks": 4875, "verified_secrets": 0, "unverified_secrets": 0}

Note

This is not unique to this repo. The same "scanned nothing" failure is live in swelter and transit-delivery-atlas, and the same Lob false positive is live in id-churn-sentinel (5) and women-artist-discovery (19). It was fixed in ctdl-validate earlier today.

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.
@ChelseaKR

Copy link
Copy Markdown
Owner Author

Follow-up commit: the first dispatch that cleared 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 flags were already there. Dropped from extra_args.

Verified on the runner, dispatched on this branch:

"chunks": 4879, "bytes": 7011660, "verified_secrets": 0, "unverified_secrets": 0

7 MB of history actually scanned, where every previous run scanned zero.

@ChelseaKR
ChelseaKR merged commit bcbeb60 into main Aug 12, 2026
15 checks passed
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