microsoft / security-utilities

Security utilities for key generation, string redaction, etc.
MIT License
24 stars 9 forks source link

Provide explicit confidence level for missing rules. #93

Closed michaelcfanning closed 1 week ago

michaelcfanning commented 1 week ago

I've introduced a new unit-test that forces a development invariant, that every pattern include an explicit confidence (i.e., accuracy or precision) designation, between High, Medium and Low. I've also updated doc comments to try to describe these categories. Maybe I should include this as well but typically:

While doing this work I noticed a medium confidence pattern was missing a signature used for pre-filtering (in .NET, these values are confirmed to present in a scan target using string.IndexOf, a check which is empirically observed to be ~10x - 20x faster than non-back-tracking regex engines such as RE2. I've added a second invariant test that insists all patterns of medium confidence or higher include one or more signatures to enable the prec-check.

@nguerrera @suvamM @rwoll @shaopeng-gh @yongyan-gh @LingZhou-gh @evelyn-ys