Skip to content

Chore: [AEA-0000] - use gitleaks for secret scanning#134

Merged
anthony-nhs merged 1 commit intomainfrom
gitleaks
Apr 17, 2026
Merged

Chore: [AEA-0000] - use gitleaks for secret scanning#134
anthony-nhs merged 1 commit intomainfrom
gitleaks

Conversation

@anthony-nhs
Copy link
Copy Markdown
Contributor

use gitleaks for secret scanning

Copilot AI review requested due to automatic review settings April 17, 2026 10:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR switches the repository’s pre-commit secret scanning from git-secrets to gitleaks, aligning local developer checks with a more modern secrets scanner.

Changes:

  • Replace the git-secrets pre-commit hook with a gitleaks hook.
  • Remove the git-secrets allowlist file (.gitallowed).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.pre-commit-config.yaml Replaces the secret-scanning hook implementation to invoke gitleaks.
.gitallowed Removes the legacy allowlist file used by git-secrets.

Comment thread .pre-commit-config.yaml
Comment on lines +50 to +55
name: Git Leaks
description: gitleaks scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
entry: bash
args:
- -c
- 'git-secrets --pre_commit_hook'
- "gitleaks git --pre-commit --redact --staged --verbose"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The hook description claims it scans commit messages and --no-ff merges, but this pre-commit config only runs at the pre-commit stage and the command uses --staged. Please update the description (or stages/command) so it accurately reflects what is actually scanned.

Copilot uses AI. Check for mistakes.
Comment thread .pre-commit-config.yaml
Comment on lines +49 to 56
- id: gitleaks
name: Git Leaks
description: gitleaks scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
entry: bash
args:
- -c
- 'git-secrets --pre_commit_hook'
- "gitleaks git --pre-commit --redact --staged --verbose"
language: system
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

This hook uses language: system and relies on a locally installed gitleaks with an unpinned CLI interface. To avoid contributors/CI breaking when gitleaks isn't installed or its subcommands/flags differ by version, prefer using the official pre-commit hook repo (pinning rev) or otherwise ensuring installation/version pinning in the devcontainer/tooling.

Copilot uses AI. Check for mistakes.
Comment thread .pre-commit-config.yaml
- -c
- 'git-secrets --pre_commit_hook'
- "gitleaks git --pre-commit --redact --staged --verbose"
language: system
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

The gitleaks hook is missing pass_filenames: false and always_run: true. As written, pre-commit will pass filenames to bash -c (unneeded/large argv) and the hook may be skipped on empty commits; secret scanning hooks typically should run regardless of which files changed.

Suggested change
language: system
language: system
pass_filenames: false
always_run: true

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

@anthony-nhs anthony-nhs merged commit e668311 into main Apr 17, 2026
16 checks passed
@anthony-nhs anthony-nhs deleted the gitleaks branch April 17, 2026 11:00
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