Conditional Masking

Apply masking transformations selectively based on conditions.

Overview

Conditional masking allows you to mask data based on specific criteria. This is useful when you need to:

  • Mask only certain rows (e.g., European customers for GDPR)

  • Apply different transformations based on data values

  • Preserve some data while masking others

Basic Conditional Masking

Use the where parameter to specify conditions:

transformations:
  - columns: ["email"]
    params:
      type: person_generator
      column_templates: ["${email}"]
    where: "country = 'DE'"  # Only mask German customers

Multiple Conditions

Combine conditions using SQL syntax:

transformations:
  - columns: ["ssn"]
    params:
      type: finance_generator
      column_templates: ["${us_routing_number}"]
    where: "age > 18 AND country IN ('US', 'CA')"