Skip to main content

Module secret_scan

Module secret_scan 

Source
Expand description

The push scan: what an agent’s git push is refused for.

A credential is what a person’s agent is most likely to leak, and no repository, public or private, is a place for one. The scan looks at the lines a push adds (never at what it removes or leaves alone) for the formats whose shape is certain, and says where and what kind, never the text itself: the refusal would otherwise put the credential in the agent’s transcript.

Structs§

Finding
One credential-shaped string a push would add.

Constants§

MAX_FINDINGS 🔒
The most findings reported; a push with more is refused all the same.

Functions§

combined_new_range 🔒
(start, count) of the result side of a combined hunk header, @@@ -a,b -c,d +e,f @@@; a missing count is 1.
credential_in
A category if text holds a credential of a format whose shape is certain.
has_run 🔒
Whether text holds prefix followed by at least min characters of class, the prefix not being the tail of a longer word (risk-... is not a key).
hunk_counts 🔒
(start, count) of the old and the new side of a hunk header’s -a[,b] +c[,d] @@; a missing count is 1.
is_alnum 🔒
is_key_char 🔒
refusal_text
What a refusal says: where and what, never the text.
scan_diff
The credentials in the lines a unified diff adds (git log -p -U0, git diff -U0).