Skip to content
secret-scan
Menu

Secret-scan classification for CI

One number for your secret scan

gitleaks and trufflehog flag every key-shaped string, including publishable keys and documented placeholders. secret-scan sorts each finding into one verdict, so your gate fails only when .summary.private is above zero.

Sample filtered report (made-up numbers)
  • private: real secret shape, fails the gate0
  • public: safe by design, counted not listed12
  • triage: listed for a human, does not fail1
  • rawGitleaksMatches: before classification14
  • allowlistedFindings: line-bound exceptions1

gate: .summary.private == 0, pass

From scan to gate

  1. Step 1

    Generate the config

    generate-gitleaks-config.mjs writes generated.gitleaks.toml beside the script, built from the private value rules and the whole-file exceptions. It is never committed.

  2. Step 2

    Scan

    gitleaks scans the repository with that config and writes a JSON report. trufflehog is optional and writes NDJSON.

  3. Step 3

    Filter

    Run filter-gitleaks-output.mjs <report.json> with the cwd at the scanned repository root and git on PATH, or pipe trufflehog output into filter-trufflehog-output.mjs.

  4. Step 4

    Gate

    Fail the job when .summary.private is above zero. triage findings are listed for a human but do not fail it.

The whole path →

Put one clear gate behind your scanner

Four zero-dependency Node modules that run in your CI job. Nothing calls a service and there is no account.