You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This needs Python to install "pre-commit" and "go" to run gitleaks. Therefore, a more appropriate alternative would be using Husky + the Docker version of gitleaks, similarly to what we do to run Mongo.
Second try with Husky + Docker
In package.json:
"prepare": "husky install || echo 'Husky command not installed or not working, are you running in production? You won't be protected when committing code",
"pre-commit:gitleaks": "docker run -v $(pwd):/path zricethezav/gitleaks:latest detect --source=\"/path\" --report-format json",
"pre-commit": "# Automatically run by husky on commit",
With husky set to run "npm run pre-commit"
=> very slow, gives false positive
3rd try With protect command
It seems that the command we need is protect. Will test and finish this issue when the commands are ok.
Not sure if it actually catches leak yet, to be tested more extensively:
"prepare": "husky install || echo 'Husky command not installed or not working, are you running in production? You won't be protected when committing code",
"detect-leaks": "docker run -v $(pwd):/path zricethezav/gitleaks:latest detect -v --source=\"/path\"",
"pre-commit:gitleaks": "docker run -v $(pwd):/path zricethezav/gitleaks:latest protect -v --source=\"/path\" --staged",
"pre-commit": "echo 'Running yarn pre-commit command' && yarn run pre-commit:gitleaks # Automatically run by husky on commit",
The text was updated successfully, but these errors were encountered:
First try pre-commit + gitleaks
Using gitleaks : https://github.com/zricethezav/gitleaks
And pre-commit: https://pre-commit.com/#install
Example script:
This needs Python to install "pre-commit" and "go" to run gitleaks. Therefore, a more appropriate alternative would be using Husky + the Docker version of gitleaks, similarly to what we do to run Mongo.
Second try with Husky + Docker
In package.json:
With husky set to run "npm run pre-commit"
=> very slow, gives false positive
3rd try With protect command
It seems that the command we need is
protect
. Will test and finish this issue when the commands are ok.Not sure if it actually catches leak yet, to be tested more extensively:
The text was updated successfully, but these errors were encountered: