Commit 3a3335c
authored
ci: Add Gitleaks pre-commit hook for detecting potential credentials (#1153)
### Instructions to reviewer on how to test:
1. Pull this branch and verify that `pre-commit` hooks are active.
Run the following command to confirm `gitleaks` is correctly set up:
```
pre-commit run --all-files
```
This should include output from gitleaks, detecting potential hardcoded
secrets.
Note: It is assumed that the CI environment handles installing gitleaks
as part of the `pre-commit` configuration.
For local testing, the following setup was used:
```
python3 -m venv .venv
source .venv/bin/activate
pip install pre-commit
pre-commit install --hook-type pre-commit
pre-commit run --all-files
```
2. Test gitleaks manually by attempting to commit a file containing a
fake secret (e.g., a fake API key or private key).
The commit should be blocked by gitleaks if the secret is detected. Note
that detection may include false positives or occasionally miss some
secrets (false negatives).
For more information, including configuration options for customizing
detection rules, refer to the official documentation:
https://github.com/gitleaks/gitleaks1 parent 41c09c6 commit 3a3335c
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments