Skip to content

feat: use shared gitleaks rules from bcregistry-sre - #894

Merged
panish16 merged 2 commits into
bcgov:mainfrom
panish16:feat/shared-gitleaks-rules
Oct 15, 2026
Merged

panish16 merged 2 commits into
bcgov:mainfrom
panish16:feat/shared-gitleaks-rules

Conversation

@panish16

@panish16 panish16 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the Git Hooks RFC rollout (bcgov/entity#34619).

Switches the hook to the shared gitleaks rules in bcgov/bcregistry-sre (git-hooks/, added in bcgov/bcregistry-sre#407), same as bcgov/ppr#2380. Rule changes now get made once in sre and every repo picks them up within a day.

  • lefthook.yml - adds the bcregistry-sre remotes: entry. The scan blocks the commit if the shared rules haven't been downloaded yet, instead of scanning with no rules.
  • .gitleaks.toml - extends the shared rules (gitleaks defaults + Patrick's hardcoded-password + Thor's custom-password) instead of just the defaults. No new allowlist entries needed - the password rules find nothing new in the existing tree.

Nothing changes for setup: pnpm install at the repo root once. On Windows run git config --global core.longpaths true once first.

Tested

Real git commit on Windows, pnpm 11.9.0, fresh clone:

  • whole-repo scan: same findings as today, 0 new
  • os.getenv(...), process.env.X → commit fine
  • literal password in Python / YAML / TS, fake GitHub token → blocked
  • shared rules not downloaded (GitHub unreachable, or partial download without core.longpaths) → blocked with "Shared gitleaks rules missing", recovers once fixed

Also fixes the lint error that came in with #893 (missing space before } in name-build-info.vue), which was failing CI on this PR. Lint, unit tests and build pass locally.

Pulls the gitleaks rules from bcgov/bcregistry-sre (git-hooks/, added in
bcregistry-sre#407) via lefthook remotes, same as ppr#2380. This adds the
shared hardcoded-password and custom-password rules on top of the gitleaks
defaults; .gitleaks.toml now extends the shared base and keeps only this
repo's own allowlist. The secret-scan command blocks the commit if the
shared rules haven't been downloaded, instead of scanning with no rules.
@panish16
panish16 merged commit d80719e into bcgov:main Oct 15, 2026
7 of 8 checks passed
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.

2 participants