A reproducible walkthrough from a clean clone. It shows:
- a history-only secret, deleted in a later commit but still found;
- CI/CD findings in GitHub Actions, GitLab CI and a Dockerfile, plus committed credential files;
- the HTML report, with redacted previews, severity labels and presence badges.
All secrets in the demo repositories are fabricated at build time and non-functional.
git clone https://github.com/The-Creative-Developer/git-leak-hunter.gitcd git-leak-hunter && npm ci && npm run buildnpm run fixtures -- demo-reposThe last command builds eight small repositories under demo-repos/ plus
demo-repos/ground-truth.json (demo-repos/ is git-ignored). It prints one line per repository
with its secret and bait counts.
Show the repository's history: the AWS key pair and GitHub token were added in commit 2 and removed in commit 3.
git -C demo-repos/history-only log --oneline --statnode dist/cli.js scan demo-repos/history-only --out leak-report/history-onlyExpected console output: 3 findings, all history-only, severity High. The AWS key ID and
secret key are reported as a pair.
✓ walking commit history (4 commits, 6 file versions)
✓ regex signature scan (6 unique blobs, 0 cache hits)
✓ entropy analysis (1 candidate suppressed)
✓ CI/CD config scan (0 CI/CD files)
! 3 findings detected (0 critical, 3 high, 0 medium, 0 low; 3 history-only)
✓ report.html generated (leak-report/history-only/report.html)
✓ report.json generated (leak-report/history-only/report.json)
Point out:
- the working tree is clean (
git -C demo-repos/history-only grep -n AKIAfinds nothing); - the commit hash in each finding is the commit that introduced the secret;
- the presence badge reads HISTORY-ONLY · deleted but still recoverable.
node dist/cli.js scan demo-repos/ci-configs --out leak-report/ci-configs --fail-on highExpected: 12 findings (1 Critical, 11 High, 1 history-only); exit code 1 because of
--fail-on high. Findings come from:
.github/workflows/deploy.yml: workflow-levelenv:(history-only: replaced by${{ secrets.DEPLOY_API_KEY }}in the last commit), job-levelenv:, and awith:input;.gitlab-ci.yml: global and jobvariables:;Dockerfile:ARG NPM_TOKEN=…, a continuedENV … \line, and legacyENV KEY value;.env,.npmrc,config/credentials.json, and.ssh/id_rsa(Critical: a private key still at HEAD).
Contrast with the bait repository: the same constructs written with ${{ secrets.X }}, $VAR,
placeholders, UUIDs and lockfile hashes give 0 findings, and the suppressions are counted:
node dist/cli.js scan demo-repos/false-positives --out leak-report/fp --verboseOpen leak-report/ci-configs/report.html in a browser by double-clicking it. No server is needed.
- Header: repository, scan date, counts per severity, scan stats (commits, unique blobs, cache hits, duration).
- Finding cards, as on slide 10: secret type, severity label, file path, commit hash, line
number, redacted preview (
AKIA****************WXYZstyle), verification status. - Filters: severity buttons, a present-at-HEAD / history-only selector, and severity or recency sorting.
- Details: entropy, first-seen commit, other commits containing the secret, fingerprint, and a redacted context line.
A copy generated from the same fixture is committed as examples/report.html.
node dist/cli.js uiYour browser opens the local console; if it doesn't, open the printed link.
- Click Browse…, open
demo-repos, and pickci-configs(markedgit). Press Scan repository. - Show the live progress steps, then the result card: verdict stamp, severity counts, top findings.
- Scroll to the embedded full report. Open full report ↗ gives the same page in its own tab.
- Scan
history-onlyas well to show the session history list. - Stop the console with Ctrl+C; the session's reports are deleted.
- Memoization: scanning
demo-repos/blob-reusereports 3 unique blobs and 12 cache hits. One secret-bearing blob is copied to four paths, deleted, restored and branched.- Run it with
--no-cacheto compare. - Run
npm run bench:memofor the full benchmark.
- Run it with
- Merge-only secret:
node dist/cli.js scan demo-repos/merge-conflictfinds a token that exists only in a merge commit's conflict resolution.docs/BENCHMARK.mdshows Gitleaks' defaultgitmode missing it.
- XSS-safe report: scan
demo-repos/hostile. File names, the author name and the commit message contain HTML/JS payloads; the report shows them as inert text. - Live verification is opt-in (
--verify --confirm-authorized) and must not be run against credentials you do not own. The demo secrets are fabricated, so verifying them would only reportINACTIVE, at the cost of real requests to AWS and GitHub. Skip it in the demo.
rm -rf demo-repos leak-report