Custom classifier JSON fields and Python regular expressions

You can import custom classifiers by using a JSON file. In the JSON file, specify the values that are needed to create the custom classifer.

JSON name/value pairs for custom classifier

The following table lists the JSON name/value pairs in the derived-custom-classifer-template.json or underived-custom-classifer-template.json file. You can define the custom classifer by using a Python regular expression or by using an existing classifer.

Name

Value

entity_regex

The Python regular expression syntax that defines the new type of personally identifiable information (PII) in the content.

For example, to add an entity type for a custom ID number comprised of two upper-case alphabet characters followed by four digits (as in AB1234), enter [A-Z]{2}[0-9]{4}.

For information about non-capturing groups and backslash characters, see Python regular expressions for custom classifiers. For more information about Python regular expressions, go to the Python documentation.

keywords

Keywords that must appear within close proximity to the entity. To define multiple keywords, separate the keywords with a comma:

"entityXML":{"keywords":"employment,start"},

DSSensitivityType

The sensitivity level for the custom classifier.

Valid values are:

  • 1, NON_SENSITIVE

  • 2, INTERNAL

  • 3, SENSITIVE

  • 4, RESTRICTED

SecurityConfigRiskCategory

The data category to which the custom classifier belongs.

Valid values are PCI, PII, PHI, OPERATIONAL, FINANCIAL, CUSTOM, PII_LINKABLE, and SECRETS

parentEntityName

An existing entity type to base the custom entity on. For a list of classifiers that you can use, see Classifiers and data categories in Data Posture 360.

For example, to create an entity for employment start date, select the Date classifier and add keywords such as "employment" and "start". Only dates that have those keywords in close proximity in the content are identified as potential matches.

{
"regularExpression":{},
"entityXML":{"keywords":"employment,start"},
"flags":1,
"parentEntityName":"Date",
"entityName":"Employment Start Date"
}

entityName

The name of the custom entity.

Python regular expressions for custom classifiers

When you create the regular expression for your custom classifier, use the Python regular expression syntax. The following contains information about using Python regular expressions for custom classifiers.

Escape backslash characters

If the Python regular expression contains a backslash character, then replace each backslash character with two backslashes. For example, given a custom classifier books\books, you would create the Python regular expression, books[\\]books.

Non-Capturing Groups

If you want to use parentheses () in your regular expression, use the non-capturing version (?:). Capturing contents of a group is not supported. Review the following example:

Correct - non-capturing version includes the question mark and colon (?:).

\s(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?!\.)\b

Incorrect - original version does not include the question mark and colon (?:).

\s((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?!\.)\b
×

Loading...