The defined pre-commit-hook prevents committing passwords to the repository. In case a password is detected git commit fails.
- Install pre-commit-hook tool
$ pip install pre-commit
- Install detect-secrets
$ pip install detect-secrets
- Update pre-commit-hook
$ pre-commit autoupdate
- Enable defined pre-commit-hook
$ pre-commit install
If no .secrets.baseline
is present, simply generate it:
$ detect-secrets scan --disable-plugin KeywordDetector --disable-plugin AWSKeyDetector > .secrets.baseline
- Use Notepad++ or IntelliJ-Editor to convert
.secrets.baseline
to UTF-8
$ detect-secrets scan --baseline .secrets.baseline
- If secrets are identified, add them to .secrets.baseline manually For more details see: https://github.com/Yelp/detect-secrets#adding-secrets-to-baseline