Skip to content

Identifier

Filter

This filter identifies custom text based on a given regular expression.

The Identifier filter accepts a list of regular expression-based identifiers. See the policy at the bottom of this page for an example.

Note that backslashes in the regular expression will need to be escaped for the policy to be valid JSON.

Required Parameters

This filter has no required parameters.

Optional Parameters

Parameter Description Default Value
enabled When set to false, the filter will be disabled and not applied true
ignored A list of terms to be ignored by the filter. None
caseSensitive When set to true, the regular expression will be case sensitive. true
classification Used to apply an arbitrary label to the identifier, such as "patient-id", or "account-number." "custom-identifier"
pattern A regular expression for the identifier. Note that backslashes will need to be escaped. \b[A-Z0-9_-]{6,}\b
groupNumber The regex capture group to use as the identifier. 0 is the entire match. 0
validator A built-in validator a match must pass to be kept: luhn, bic-structural, de-personalausweis, de-steuerid, mod11, mod97, mod23-letter, or es-cif. Either the name as a string or an object with name and params. An unknown name is a policy error. None

Filter Strategies

The filter may have zero or more filter strategies. When no filter strategy is given the default strategy of REDACT is used. When multiple filter strategies are given, they are evaluated in the order listed and only the first one whose condition is satisfied, or that has no condition, is applied. See Filter Strategies for details.

Strategy Description
REDACT Replace the sensitive text with a placeholder.
RANDOM_REPLACE Replace the sensitive text with a similar, random value.
STATIC_REPLACE Replace the sensitive text with a given value.
CRYPTO_REPLACE Replace the sensitive text with its encrypted value.
HASH_SHA256_REPLACE Replace the sensitive text with its SHA256 hash value.
LAST_4 Replace the sensitive text with just the last four characters of the text.

Conditions

Each filter strategy may have one condition. See Conditions for details.

Conditional Description Operators
TOKEN Compares the value of the sensitive text. ==, !=, startswith
CONTEXT Compares the filtering context. == , !=
CONFIDENCE Compares the confidence in the sensitive text against a threshold value. < , <=, > , >=, ==, !=

Example Policy

{
  "identifiers": {
    "identifiers": [
      {
        "pattern": "[A-Z]{9}",
        "caseSensitive": false,
        "classification": "custom-identifier",
        "enabled": true,
        "identifierFilterStrategies": [
          {
            "strategy": "REDACT",
            "redactionFormat": "{{{REDACTED-%t}}}"
          }
        ]        
      }
    ]
  }
}