Description
🐛 Bug Report
In a tartufo.toml file a matched_string value can be used as a signature and tartufo will accept and exclude that value when scanning.
This appears to be a side effect from here:
Lines 424 to 425 in c750412
Those lines of code appear to be intended to ignore signatures from entropy checks, but the resulting outcome is if a matched_string is excluded as a signature (instead of using the signature value) tartufo will still exclude it.
To Reproduce
Take a repo with an item flagged by tartufo. Copy the matched_string value and add it to the tartufo.toml as a signature. For example, if I am getting a match on the string -----BEGIN RSA PRIVATE KEY-----
I can do the following to exclude it:
exclude-signatures = [
{ signature = '-----BEGIN RSA PRIVATE KEY-----', reason = 'exclude signature' }
]
Expected Behavior
This should not result in excluding the matched_string. I would expect tartufo to throw an error indicating one of the signatures to exclude is not a valid signature.
Code Example
See the code example under To Reproduce.
Environment
tartufo, version 3.2.1
Python 3.9.13