Skip to content

fix: skip gitleaks test dirs, not substring names - #102

Merged
chrisknvidia merged 4 commits into
NVIDIA:mainfrom
mimran-khan:fix/gitleaks-path-allowlist
Aug 30, 2026
Merged

chrisknvidia merged 4 commits into
NVIDIA:mainfrom
mimran-khan:fix/gitleaks-path-allowlist

Conversation

@mimran-khan

Copy link
Copy Markdown
Contributor

Summary

The default Gitleaks allowlist treated test as a substring, so scripts/latest.py and attestation.py were never scanned. Same shape for example, fixture, and mock.

The skip is now a directory path component (tests/, test/, examples/, ...). Production files whose names happen to contain those letters still go through secrets. Fixes #92.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Release Impact

  • Updated CHANGELOG.md

The default allowlist used (.*)?test(.*)?, which also skipped latest,
attestation, and contest. Match test/example/fixture/mock as directory
path components instead.

Fixes NVIDIA#92

Signed-off-by: mimran-khan <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the exact current head against #92. The allowlist now targets singular/plural test/example/fixture/mock directory components without exempting production names such as latest, attestation, or contest. Focused tests pass (13), with Ruff and diff checks clean. No actionable findings; approved. The red Gitleaks job is unrelated branch history.

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Gitleaks allowlist skips any path containing the substring "test"

3 participants