Documentation
¶
Overview ¶
Command secretscan finds the daemons that take a secret as a plaintext value, in a config field, a flag, an environment variable or a unit file, instead of by reference.
secretscan sweep --json out.json --md out.md # every clone under the root secretscan repo --waive "<reason>" ./some-clone # the gate for one repo
WHY IT EXISTS ¶
The fleet's rule is that a daemon receives a secret by REFERENCE (a go-authn/secretsource ref such as `systemd-creds:name`, `keychain:`, `keepassxc:`, or a `file:` path whose permissions are checked), never as the value. On 2026-11-22 the first inventory of how far the fleet is from that failed because no tool did the sweep: credscan reads git remote URLs and nothing else. This is that tool.
WHAT AN ANSWER IS WORTH ¶
A sweep that could not read reports zero. So the report opens with its DENOMINATOR (clones seen, read, skipped, files read, files unread), every clone carries how stale it is (FETCH_HEAD age, ahead/behind from the LOCAL refs, never a fetch), and the exit status is 2 when anything was skipped or unreadable: an unread clone is NOT READ, never clean.
PRECISION OVER RECALL ¶
Names are judged by words, not substrings, and `token_file`, `password_from`, `max_tokens`, `key_file` are not plaintext secrets; see internal/secretscan.