Skip to content

Dataset Protection Guide

This guide explains how to define paths for protecting sensitive data in JSON, XML, and MT (SWIFT) message formats.

Overview

Dataset protection allows you to specify which fields in your data should be protected (encrypted, masked, pseudonymized, etc.). The key to effective protection is correctly defining the path to each sensitive field.


JSON Format

Path Syntax

JSON paths use dot notation to navigate through the structure:

.field1.field2.field3

Examples

Simple field:

{
  "name": "John Doe",
  "email": "john@example.com"
}
Path to email: .email

Nested object:

{
  "user": {
    "profile": {
      "ssn": "123-45-6789"
    }
  }
}
Path to SSN: .user.profile.ssn

Array elements:

{
  "employees": [
    {"name": "Alice", "salary": 50000},
    {"name": "Bob", "salary": 60000}
  ]
}
Path to all salaries: .employees.salary

Conditional filtering (JSONPath):

{
  "employees": [
    {"name": "Alice", "department": "IT", "salary": 50000},
    {"name": "Bob", "department": "HR", "salary": 60000}
  ]
}
Path to IT department salaries: $.employees[?(@.department=='IT')].salary

Key Points

  • Use a dot (.) as a prefix and to separate path segments
  • Arrays are automatically traversed - no special syntax needed for simple cases
  • For complex filtering, use JSONPath syntax with $ prefix
  • Supports nested objects and arrays of any depth

XML Format

Path Syntax

XML paths use forward slashes similar to XPath:

/element1/element2/element3

Examples

Simple element:

<customer>
  <name>John Doe</name>
  <email>john@example.com</email>
</customer>
Path to email: /customer/email

Nested elements:

<order>
  <customer>
    <payment>
      <cardNumber>1234-5678-9012-3456</cardNumber>
    </payment>
  </customer>
</order>
Path to card number: /order/customer/payment/cardNumber

Attributes:

<user id="12345" role="admin">
  <name>Alice</name>
</user>
Path to id attribute: /user/@id

Conditional selection:

<employees>
  <employee department="IT">
    <name>Alice</name>
    <salary>50000</salary>
  </employee>
  <employee department="HR">
    <name>Bob</name>
    <salary>60000</salary>
  </employee>
</employees>
Path to IT employee salaries: /employees/employee[@department='IT']/salary

Supported Operators

  • = - Equal to
  • > - Greater than
  • < - Less than
  • >= - Greater than or equal to
  • <= - Less than or equal to

Key Points

  • Use @ prefix for attributes
  • Square brackets [] for conditional filtering
  • Supports and/or logical operators in conditions
  • Elements and attributes can be combined in conditions

MT (SWIFT) Format

Path Syntax

MT messages are converted to XML internally, then XML path syntax is used:

/message/block/field

How It Works

  1. MT message is converted to XML using the Prowide library
  2. XML paths are applied to the converted structure
  3. Protected data is converted back to MT format

Example

Original MT message:

{1:F01BANKBEBBAXXX0000000000}
{2:I103BANKDEFFXXXXN}
{4:
:20:REFERENCE123
:32A:210115EUR1000,00
:50K:/12345678
JOHN DOE
123 MAIN STREET
:59:/98765432
JANE SMITH
456 OAK AVENUE
-}

After XML conversion, you can protect: - Field 50K (Ordering Customer): /message/block4/field50K - Field 59 (Beneficiary): /message/block4/field59 - Amount in field 32A: /message/block4/field32A/amount

Key Points

  • MT messages are automatically converted to XML
  • Use XML path syntax to reference fields
  • Field tags (like :20:, :50K:) become XML elements
  • Subfields within a field can be accessed using nested paths
  • The protected XML is converted back to valid MT format

Best Practices

  1. Test your paths - Verify paths extract the correct data before applying protection
  2. Use specific paths - Target only the fields that need protection
  3. Consider nested structures - Account for arrays and nested objects/elements
  4. Document your paths - Keep a record of which paths protect which data types
  5. Validate after protection - Ensure the protected data maintains the correct format

Common Patterns

Protecting Multiple Fields

Define separate paths for each field that needs protection: - JSON: .user.email, .user.phone - XML: /customer/email, /customer/phone

Protecting All Array Elements

The system automatically traverses arrays: - JSON: .users.ssn (protects SSN for all users) - XML: /employees/employee/ssn (protects SSN for all employees)

Conditional Protection

Use filtering to protect only specific records: - JSON: $.users[?(@.country=='US')].ssn (only US users) - XML: /employees/employee[@country='US']/ssn (only US employees)


Need Help?

If you're unsure about the correct path syntax: 1. Check your data structure carefully 2. Start with simple paths and test incrementally 3. Use the system's path validation features if available