detect-secrets icon indicating copy to clipboard operation
detect-secrets copied to clipboard

Git Hook Config

Open saintmalik opened this issue 3 years ago • 2 comments

hello there

please is it possible to add args of '--all-files' to the git hook config

detect-secrets is skipping files with ".txt" files

see here

  - repo: https://github.com/Yelp/detect-secrets
    rev: v1.3.0
    hooks:
      - id: detect-secrets
         args: ['--all-files', '*']

saintmalik avatar Sep 05 '22 16:09 saintmalik

Hi @saintmalik, thank you for reporting this issue to us. We'll take a look at it in the next few days and let you know when we have updates about it.

lorenzodb1 avatar Sep 16 '22 17:09 lorenzodb1

Hi @saintmalik , I'm unable to reproduce this issue. Please see below logs for details.

Could you please provide detailed steps to reproduce (a minimal MVC would be ideal).

  • Terminal output with a sample .txt file ( private_key_2.txt ):
~/git/test-repo   master ✚  git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	new file:   private_key_2.txt


~/git/test-repo   master ✚  cat private_key_2.txt
-----BEGIN OPENSSH PRIVATE KEY-----
somethingSuperRandomAndSecretHereThatShouldNeverBeShared
-----END OPENSSH PRIVATE KEY-----

~/git/test-repo   master ✚  git commit -m "test commit"
Detect secrets...........................................................Failed
- hook id: detect-secrets
- exit code: 1

ERROR: Potential secrets about to be committed to git repo!

Secret Type: Private Key
Location:    private_key_2.txt:1

Possible mitigations:
  - For information about putting your secrets in a safer place, please ask in
    #security
  - Mark false positives with an inline `pragma: allowlist secret`
    comment

If a secret has already been committed, visit
https://help.github.com/articles/removing-sensitive-data-from-a-repository

Chandra158 avatar Sep 26 '22 14:09 Chandra158

We're going to close this issue as it hasn't received any update in a very long time. Feel free to re-open it if you think it's still relevant.

lorenzodb1 avatar May 16 '24 17:05 lorenzodb1