Skip to content
secret-scan
Menu

Published module

patterns.mjs

The classifier and the reviewed exceptions. The other three modules import it; you can too.

classify({ name, value }) returns private, public or triage. name may be undefined, for example in a built artifact where no variable name survives; then only the value rules and the JWT check apply.

Value rules run first: the public value rules, then the private ones, then the JWT check on the role claim. Name rules run only after that, private before public. A value no rule decides is triage.

It also exports the rule tables (VALUE_PATTERNS, NAME_PATTERNS), the reviewed exceptions (ALLOWLIST_PATHS, ALLOWLIST_FINDINGS) and the helpers the gitleaks filter uses for line-bound exceptions.