Mask

Overview

Use the Mask Snap to hide sensitive information in your dataset before you export the dataset for analytics. You can protect sensitive data using masking algorithms that the Snap provides out of the box.


Mask Snap Overview

Prerequisites

None.

Limitations and known issues

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has exactly one document input view. It processes a dataset containing sensitive data to be masked.
Output This Snap has exactly one document output view. It outputs the dataset with the specified fields masked based on the defined policies.
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Account configuration.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Mask

Example: Mask Credit Card Data

Mask Policy

Required. Enables you to specify the policies for masking data in the input dataset.

Field String/Suggestion

The field/parent field in the input dataset that contains the data to be masked.

Default value: N/A

Example: credit_card_number

Search Mode String/Suggestion

Select the mode to search sensitive data. Options:

  • Exact Path
  • Recursive

Default value: N/A

Example: Exact Path

Match Field String/Suggestion
The type of field in the input data to be matched. Select from the following options:
  • Key: Select if the data to be matched is the field name.
  • Value: Select if the data to be matched is the field value.

Default value: N/A

Example: Key

Mask Method String/Suggestion

Select the method to mask sensitive information:

  • Replace
  • Shuffle
  • Remove
  • Random

Default value: N/A

Example: Replace

Mask Condition String/Suggestion

The value that replaces sensitive information. Applicable only when the Mask Method is Replace.

Default value: N/A

Example: Equals

Match Pattern String/Expression The expression of the information pattern to be matched in the input dataset. This is applicable only when the Match Condition is Regex Match or Date (Text).

Default value: N/A

Example: VIP

Mask Field String/Suggestion
The field that contains sensitive data and will be masked if the matching conditions are met. Select from the following options:
  • Key: Select if the data to be masked is the key.
  • Value: Select if the data to be masked is the value.
Note: The Snap fails to validate if the Match Field is Key and the Mask Field is also Key. In such a case, select Value as the Mask Field.

Default value: N/A

Example: Value

Mask Method String/Suggestion
The method to use to mask sensitive information. Select from the following options:
  • Replace: Replaces the matched Value with the value you enter in Mask Value.
  • Shuffle: Shuffles the matched data Value randomly.
  • Remove: Removes the matched Key or Value.
Note: If the Mask Field is Value, the Snap returns null as the new value. If the Mask Field is Key, the Snap removes the whole Key-Value pair.

With arrays and Recursive Search Mode, if the Mask Field is Value, the value is removed from the array. If all values are removed, the Snap returns an empty array. However, if the Mask Field is Key and the Snap removes the array along with the key.

  • Random: Replaces the matched Value with a new random value. The Snap derives the random value based on the data type of the matched value and behaves as described below:
    • Text: Randomly replaces the value with alphanumeric characters having the same length as the original data.
    • Integer: Randomly replaces the value with an integer value in the range between 0 to an integer of the same digit as the actual data. The new value is always different from the original value. For example, if the original data is 120, the possible replacement value is between 0 to 999, except for 120.
    • Decimal: Randomly replaces the value with a value that is based on the precision of the original value from 0 to the precision on the same digit. For example, if the original value is 0.023, the possible replacement value is between 0.000 to 0.099, except for 0.023.
    • Boolean: Randomly replaces the value with either true or false.
  • Start of Month: Replaces the matched Value with the first day of the month. If the value is a text, the Snap converts the text to date using the same way as the Auto mode in the Type Converter Snap. In this mode, the Snap automatically converts text to Date.
  • Start of Year: Replaces the matched Value with the first day of the same year. If the value is a text, the Snap converts the text to date using the same way as the Auto mode in the Type Converter Snap. In this mode, the Snap automatically converts text to Date.

Default value: N/A

Example: Replace

Mask Value String/Expression The value that must replace the sensitive information in the input dataset. You can enter either a fixed value or an expression. This is applicable only when the Mask Method is Replace.

Default value: N/A

Example: Number

Snap execution Dropdown list
Select one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only