Skip to content

vitalibit/security-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 

Repository files navigation

Gitleaks pre-commit hook

This script sets up a pre-commit hook for Git that automatically checks for secrets in your code using Gitleaks.

Prerequisites

  • Python 3
  • Git
  • Curl (for installation)
  • tar

Installation

git clone https://github.com/vitalibit/security-pre-commit
cd security-pre-commit

Run the Python script pre-commit.py to install Gitleaks and enable the pre-commit hook:

python3 pre-commit.py

Or you can install it with one command:

curl -fsL https://raw.githubusercontent.com/vitalibit/security-pre-commit/main/pre-commit.py | python3 -

Usage

After the installation, the pre-commit hook will automatically run before each commit. If any secrets or sensitive information are detected by Gitleaks, the commit will be rejected and an error message will be displayed.

To disable the pre-commit hook, you can set the gitleaks.enabled configuration option to false:

git config gitleaks.enabled false

To enable the pre-commit hook, run the following command:

git config gitleaks.enabled true

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages