Skip to content

Run gitleaks in pre-push hook

  • Please check this box if this contribution uses AI-generated content as outlined in the GitLab DCO & CLA

What does this MR do and why?

This MR adds gitleaks to the pre-push hook as requested in #421380 (closed). As this is already commited gitleaks protect can't be used here as this can only used until something is commited. After that gitleaks detect needs to be used which I implemented here.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create a new file with the following content aws_secret="AKIAIMNOJVGFDXXXE4OA"
  2. Stage and commit the file
  3. Run lefthook run pre-push
  4. It should detect the secret and throw it as error
Edited by 🤖 GitLab Bot 🤖

Merge request reports