Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gitleaksignore file is ignored when using pre-commit #1051

Open
fabasoad opened this issue Dec 3, 2022 · 0 comments
Open

.gitleaksignore file is ignored when using pre-commit #1051

fabasoad opened this issue Dec 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@fabasoad
Copy link

fabasoad commented Dec 3, 2022

Describe the bug
I have a frontend project that generates uuid during tests and save them into *.snap files. These uuid are OK to commit but gitleaks detects them as secrets, which is fine. Though, adding fingerprints of each error to .gitleaksignore file to ignore them - doesn't help.

To Reproduce

  1. Have project with secret hardcoded.
  2. Add pre-commit-config.yaml file with the content below. (Additional context: [1])
  3. Run pre-commit run gitleaks.
  4. Be sure that secret is detected.
  5. Create .gitleaksignore file and copy-paste fingerprint from the output at step 4.
  6. Run pre-commit run gitleaks.

Actual behavior
gitleaks detects that line anyway, meaning that .gitleaksignore file is ignored.

Expected behavior
Line which fingerprint has been added to the .gitleaksignore file shouldn't be detected anymore.

Screenshots
N/A

Basic Info (please complete the following information):

  • OS: macOS Monterey, version 12.6
  • Gitleaks Version: 8.5.12

Additional context
[1] pre-commit-config.yaml:

- repo: https://github.com/zricethezav/gitleaks
  rev: v8.15.2
  hooks:
    - id: gitleaks

cc @zricethezav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant