Commit graph

12 commits

Author SHA1 Message Date
Richard Gomez
2964b3b2d2
feat(detectors): log falsepositive reason (#2969) 2024-06-14 08:26:05 -07:00
Cody Rose
2f7029bc4d
Expose detector-specific false positive logic (#2743)
This PR:

Creates an optional interface that detectors can use to customize their false positive detection
Implements this interface on detectors that have custom logic
In most cases this "custom logic" is simply a no-op because the detector does not participate in false positive detection
Eliminates inline (old-style) false positive exclusion in a few detectors that #2643 missed
2024-04-30 16:10:26 -04:00
Cody Rose
e58a2913ea
Support multiple custom detectors (#2064)
#1711 accidentally removed the ability to support multiple custom detectors. This PR partially adds back this capability: Multiple custom detectors are now supported overall, but only one custom detector can be returned for a given keyword match.
2023-10-30 18:17:17 -04:00
Zachary Rice
4938d67e66
Custom detector name (#1400)
* hacky way to add detector name to output

* set name in custom detectors
2023-06-20 13:55:31 -05:00
Bill Rich
762641d970
Add DetectorName to Result (#1223)
* Add DetectorName to Result

* Use GetName method instead of Name
2023-03-30 09:40:05 -07:00
Miccah
0fe9bf0868
Ignore errors from CustomRegex so the channel doesn't leak (#1149) 2023-03-15 17:26:03 -05:00
ah̳̕mͭͭͨͩ̐e̘ͬ́͋ͬ̊̓͂d
2315192fda
Custom regex parallel verify (#1127)
* Refactor generating CustomRegex results into a helper function

* Added errGroup for createResults, and ensure goroutines are non-blocking

* clean return

---------

Co-authored-by: Miccah Castorina <m.castorina93@gmail.com>
2023-02-28 11:12:24 -05:00
trufflesteeeve
114f4b6989
Add Type() to detector interface (#1088)
* Add Type() to detector interface

The goal here is to allow the detector type information to be used
without the need for reflection. This could possibly allow us to more
easily inject information into detectors or filter them out if
necessary.

Co-authored-by: ahmed <ahmed.zahran@trufflesec.com>

* remove test detector

---------

Co-authored-by: ahmed <ahmed.zahran@trufflesec.com>
2023-02-09 14:46:03 -08:00
Miccah
8df9db6ecc
Remove false positive detection for CustomRegex (#1050)
Checking for false positives can lead to results being removed before
ever getting the opportunity to verify them. Users are already
responsible for verification of custom detectors, so let's not interfere
with how they choose to use it.
2023-01-27 11:57:10 -06:00
ahrav
09d4422cdb
Handle invalid regex for custom detector. (#1005)
* Handle invalid regex for custom detector.

* Add comment highlighting invalid regex.
2023-01-09 09:45:30 -08:00
Miccah
861ad057c7
Implement CustomRegex detector (#950)
* Remove verifying successRanges because it is unused in webhook

* Move custom_detectors validation code into its own file

* Initial implementation of custom regex detector

Secret verification is done via webhook.

* Add CustomRegex detector type

* Add upper bound to permutation

* Return early if the context is canceled

* Add headers from configuration

* Add detector name as a key in the JSON body

* Implement faster algorithm for productIndices
2022-12-14 10:26:53 -06:00
Miccah
2a2bcd93ac
Add CustomRegex validation (#939)
* Add validation skeleton

* Add custom detector validation with tests

* Validate and test regex vars

* Implement RegexVarString

* Use RegexVarString for validating regex variables

* Add numerics to the regex variable matching

Co-authored-by: hxnyk <8292703+hxnyk@users.noreply.github.com>
2022-12-02 11:26:22 -06:00