Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR implements the following changes to the Mailgun detector:
Adds
key-
as a keyword, as it's a unique prefix of one token typeDeduplicates matches in a chunk's data
Updates the detector to use tri-state verification
Adds the domain response as extradata
Fixes what appears to be a bug in the verification logic
This line of code does not seem to do what it the comment claims.
trufflehog/pkg/detectors/mailgun/mailgun.go
Lines 59 to 64 in 14b1a6e
Mailgun seems to require basic auth for all token tokens. The way this logic is written means that
key-
tokens will be properly verified, but other types like "Hex" won't be unless they happen to be base64-encoded and 72 characters (so they match the "Original MailGun Token" regex).e.g., this is a a base-64 encoded hex key that only gets detected because it happens to match the "Original" pattern.
If it was instead found in plain-text like below, it would be skipped.
I'm partially convinced that the "Original MailGun Token" is just the hex token base64-encoded.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?