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

pre-commit hook removes audited secrets #60

Closed
domanchi opened this issue Jul 13, 2018 · 1 comment
Closed

pre-commit hook removes audited secrets #60

domanchi opened this issue Jul 13, 2018 · 1 comment
Assignees

Comments

@domanchi
Copy link
Contributor

Steps to Reproduce

$ detect-secrets scan test_data/short_files/first_line.py > .secrets.baseline
$ echo "delete the secret from test_data/short_files/first_line.py"
$ PYTHONPATH=`pwd` detect_secrets/pre_commit_hook.py --baseline .secrets.baseline test_data/short_files/first_line.py
$ git diff .secrets.baseline
@domanchi domanchi self-assigned this Jul 13, 2018
@domanchi domanchi assigned KevinHock and unassigned domanchi Jul 30, 2018
@KevinHock
Copy link
Collaborator

s/"delete the secret from test_data/short_files/first_line.py"/"move the secret to a new line in test_data/short_files/first_line.py"/g

You'll see something like

   "exclude_regex": null,
-  "generated_at": "2018-07-31T17:55:15Z",
+  "generated_at": "2018-07-31T18:06:31Z",
   "plugins_used": [
     {
       "base64_limit": 4.5,
@@ -18,8 +18,7 @@
     "test_data/short_files/first_line.py": [
       {
         "hashed_secret": "4c8e08f94044d9b59913f66873af8eac4299266e",
-        "is_secret": true,
-        "line_number": 1,
+        "line_number": 2,

KevinHock added a commit that referenced this issue Jul 31, 2018
And make _load_baseline_from_dict pick it up, so that it does not get removed when e.g. lines move around.
Add is_secret attribute to _create_baseline() in pre_commit_hook_test.py so that TestPreCommitHook.test_writes_new_baseline_if_modified covers the change.
Fixes #60
@KevinHock KevinHock added the bug label May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants