The Snort Team
Revision History
-Revision 3.1.40.0 2022-08-25 09:57:58 EDT TST
+Revision 3.1.41.0 2022-09-08 16:40:05 EDT TST
---------------------------------------------------------------------
The sd_pattern IPS option provides detection and filtering of
Personally Identifiable Information (PII). This information includes
-credit card numbers, U.S. Social Security numbers, and email
-addresses. A rich regular expression syntax is available for defining
-your own PII.
+credit card numbers, U.S. Social Security numbers, phone numbers, and
+email addresses. A rich regular expression syntax is available for
+defining your own PII.
5.17.1. Hyperscan
5.17.2.1. Pattern
Pattern is the most important and is the only required parameter to
-sd_pattern. It supports 3 built in patterns which are configured by
-name: "credit_card", "us_social" and "us_social_nodashes", as well as
-user defined regular expressions of the Hyperscan dialect (see https:
-//intel.github.io/hyperscan/dev-reference/compilation.html#
-pattern-support).
+sd_pattern. It supports 5 built-in patterns which are configured by
+name: "credit_card", "us_social", "us_social_nodashes", "email", and
+"us_phone" as well as user defined regular expressions of the
+Hyperscan dialect (see https://intel.github.io/hyperscan/
+dev-reference/compilation.html#pattern-support).
sd_pattern:"credit_card";
When configured, Snort will replace the pattern credit_card with the
-built in pattern. In addition to pattern matching, Snort will
+built-in pattern. In addition to pattern matching, Snort will
validate that the matched digits will pass the Luhn-check algorithm.
-Currently the only pattern that performs extra verification.
sd_pattern:"us_social";
sd_pattern:"us_social_nodashes";
-These special patterns will also be replaced with a built in pattern.
+These special patterns will also be replaced with a built-in pattern.
Naturally, "us_social" is a pattern of 9 digits separated by -'s in
-the canonical form.
+the canonical form. For this pattern, some validation of compliance
+with the Social Security Numbers randomization rules is also
+performed.
+
+sd_pattern:"email";
+
+This pattern will be replaced with a built-in pattern created to
+match email. The regex implements the “preferred” syntax from RFC
+1035 which is one of the recommendations in RFC 5322.
+
+sd_pattern:"us_phone";
+
+This pattern will match U.S. phone numbers in different formats with
+or without country code.
sd_pattern:"\b\w+@ourdomain\.com\b"
5.17.2.2. Threshold
-Threshold is an optional parameter allowing you to change built in
+Threshold is an optional parameter allowing you to change built-in
default value (default value is 1). The following two instances are
identical. The first will assume the default value of 1 the second
declaration explicitly sets the threshold to 1.
literal" to qualify as a positive match. That is, if the string only
occurred 299 times in a packet, you will not see an event.
-5.17.2.3. Obfuscating Credit Cards and Social Security Numbers
+5.17.2.3. Obfuscating built-in patterns
-Snort provides discreet logging for the built in patterns
-"credit_card", "us_social" and "us_social_nodashes". Enabling
-ips.obfuscate_pii makes Snort obfuscate the suspect packet payload
-which was matched by the patterns. This configuration is disabled by
-default.
+Snort provides discreet logging for the built-in patterns
+"credit_card", "us_social", "us_social_nodashes", "us_phone" and
+"email". Enabling ips.obfuscate_pii makes Snort obfuscate the suspect
+packet payload which was matched by the patterns. This configuration
+is disabled by default.
ips =
{
2. Log obfuscation is only applicable to CMG and Unified2 logging
formats.
3. Log obfuscation doesn’t support user defined PII patterns. It is
- currently only supported for the built in patterns for Credit
- Cards and US Social Security numbers.
+ currently only supported for the built-in patterns for Credit
+ Cards and U.S. Social Security numbers.
4. Log obfuscation doesn’t work with stream rebuilt packet payloads.
(This is a known bug).