Skip to content

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

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

Chore: [AEA-0000] - use gitleaks for secret scanning#739
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:15
@sonarqubecloud
Copy link
Copy Markdown

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

Switches the repo’s local pre-commit secret scanning from git-secrets to gitleaks, aligning developer workflows with the intended secret-scanning tool.

Changes:

  • Replaced the local git-secrets pre-commit hook with a gitleaks-based hook command.
  • Removed the .gitallowed allowlist file previously used by git-secrets.

Reviewed changes

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

File Description
.pre-commit-config.yaml Updates the local secret-scanning pre-commit hook to run gitleaks.
.gitallowed Removes the git-secrets allowlist file that is no longer used after switching tools.

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.

This hook uses language: system with entry: bash -c ... and doesn’t appear to consume the filenames pre-commit will pass by default. Consider setting pass_filenames: false (and, if you want a pinned/managed version, using the official gitleaks pre-commit repo instead of a system dependency) to avoid unnecessary args and potential command-line length issues when many files are staged.

Suggested change
language: system
language: system
pass_filenames: false

Copilot uses AI. Check for mistakes.
Comment thread .pre-commit-config.yaml
description: git-secrets scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
- id: gitleaks
name: Git Leaks
description: gitleaks scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
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 hook runs at the pre-commit stage and the configured command appears to only scan staged content. Please update the description to reflect the actual behavior, or add separate hooks/stages (e.g., commit-msg/post-merge) if those checks are intended.

Suggested change
description: gitleaks scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
description: gitleaks scans staged changes during pre-commit to help prevent adding secrets to the repository.

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

@anthony-nhs anthony-nhs merged commit 327fb0f into main Apr 17, 2026
15 checks passed
@anthony-nhs anthony-nhs deleted the gitleaks branch April 17, 2026 10:58
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