secret-scanning-custom-patterns icon indicating copy to clipboard operation
secret-scanning-custom-patterns copied to clipboard

Social Security Numbers (SSN)

Open GeekMasher opened this issue 3 years ago • 1 comments
trafficstars

Name / Description

Social Security Numbers

Sample Snippets

True Positives

123-45-6789

False Positives

Based on a real UK area code, giving the country code beforehand. We don't normally hyphenate phone numbers, but it does happen:

Hey, my phone number is +44-1642-00-0000

[optional] Propose Solution

[0-9]{3}-[0-9]{2}-[0-9]{4}

Before pattern:

\A|[^0-9-]

After pattern:

\z|[^0-9-]

GeekMasher avatar Sep 14 '22 09:09 GeekMasher

The simplest before/after pair would be \A|[^0-9-] and \z|[^0-9-].

To deal with possible FPs it might make sense to extend it to \A|[^0-9A-Za-z-] and \z|[^0-9A-Za-z-].

aegilops avatar Feb 15 '23 15:02 aegilops