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

Improved BasicAuth detector #98

Merged
merged 2 commits into from
Dec 4, 2018
Merged

Conversation

domanchi
Copy link
Contributor

@domanchi domanchi commented Dec 1, 2018

Summary

[ 89ff594 ]
Even though browsers have different ways of parsing a URL, there is a set of generic characters that can't be used in certain parts of the URL. Using this information, we can improve our regex to reduce false positives.

On an internal sample set, I managed to reduce false positives by ~8%.

As a side note, I did evaluate the use of https://github.com/dxa4481/truffleHogRegexes/blob/master/truffleHogRegexes/regexes.json#L19, but there were strange length limits which I did not understand. They may have been used to heuristically reduce more false positives, but from the data that I've been testing it on, it doesn't seem to be necessary.

[ d7a0a08 ]
Bug fix: there's a strange case that occurs when comparing baselines. If a secret is removed, then it wouldn't be able to find itself, and perform the proper highlighting. However, since you want to see what lines are removed and added, let's show it for the audit --diff functionality.

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.

LGTM 🚢

@domanchi domanchi merged commit 138816f into master Dec 4, 2018
@domanchi domanchi deleted the improved-basic-auth-detector branch December 4, 2018 20:25
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