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

Adding audit --diff functionality #95

Merged
merged 2 commits into from
Nov 26, 2018
Merged

Conversation

domanchi
Copy link
Contributor

@domanchi domanchi commented Nov 7, 2018

Testing

detect-secrets$ pip install -e .
detect-secrets$ detect-secrets scan test_data > .secrets.baseline
detect-secrets$ detect-secrets scan --base64-limit 5.5 --hex-limit 2 > .secrets.baseline.new
detect-secrets$ detect-secrets audit --diff .secrets.baseline .secrets.baseline.new

Output

Secret:      1 of 10
Filename:    test_data/config.ini
Secret Type: Hex High Entropy String
Status:      >> ADDED <<
----------
1:[credentials]                                    
2:password = 12345678901234                        
3:                                                 
4:[parent]                                         
5:    [child]                                      
6:    keyA = 678912345                             
7:    keyB = value1 
----------
What would you like to do? (s)kip, (q)uit:   

Features

  • Leverages the full colored, interactive auditor to be able to see which secrets have been added and removed from the scan, based on plugin configurations.

Hopefully this will better support plugin developers, to make the process easier to configure limits and plugin regexes!

Backwards Compatibility Considerations

  • This requires 0.10.4 at a minimum, because it expects baselines to be fully sorted

Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far, just more discussion stuff.

@@ -1 +1 @@
VERSION = '0.10.5'
VERSION = '0.11.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

B/c this will make it so that people need to manually update the baseline's, do you think we should add the autoupdate baselines functionality now? I think so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that was already merged? But yes, I agree with you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should update the changelog, but #90 was a bug fix for the update functionality, before running the temp bandaid fixer.


base64_secret = 'c2VjcmV0IG1lc3NhZ2Ugc28geW91J2xsIG5ldmVyIGd1ZXNzIG15IHBhc3N3b3Jk'
hex_secret = '8b1118b376c313ed420e5133ba91307817ed52c2'
basic_auth = 'http://username:whywouldyouusehttpforpasswords@example.com'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 except let's wait until we make the pre-commit hook autoupdate the baseline

@KevinHock
Copy link
Collaborator

I guess we can merge this one now @domanchi 👍 (I'd like you to have the GitHub square on account of making the PR 😁 )

@domanchi domanchi merged commit 839f02b into master Nov 26, 2018
@domanchi domanchi deleted the audit-diff-functionality branch November 30, 2018 22:20
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

Successfully merging this pull request may close these issues.

None yet

2 participants