-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add the ability to reverify a secret knowing the secret type #4170
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
Comments
Thank you for opening this issue. We sincerely appreciate your contribution to the project. Thanks again for helping improve the project! |
Somewhat related to #2128 and #3634 (comment). |
Very much related to those issues. I've thought through the same solution as #2128 also, and think that the most reliable would be to expose the Verify functions for each secret type via command line argument. For example You would likely have to update the function signature of the verify functions so that they all have the same name (cause right now they're often named VerifyBuildkite instead of just Verify), then you can just find the scanner type from the terminal argument and then call the corresponding verify function. |
Oh but TIL on #3634 (comment), not all rawV2 values are the secret themselves, that does make it trickier 🤔, and uplift might be needed there first. |
The other caveat here is that not all secrets are a single token, sometimes requiring multiple values and how to structure them (e.g. and ID & secret, or maybe a URL of the host too). That complicates things also, if we update all Verify functions to have the same signature we need to define some kind of shared struct which you can pack, and then each verifier unpacks and uses whatever values it requires to verify. There may be some other elegant solution. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Reverifying a secret with trufflehog requires re-scanning the source file, since many of the detectors depend on keywords before the secret itself, if you only have access to the secret trufflehog may not identify it as verified.
Preferred Solution
Expose a method to call the verify function on a secret type knowing the secret itself. The scope would be all secrets in trufflehog that have a verifier function, not just those listed in Analyze
Additional Context
It's very similar to the new
trufflehog analyze
except it's only focused on yes/no verification, not what scopes are present for that secret.The text was updated successfully, but these errors were encountered: