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"
}
.email
Nested object:
{
"user": {
"profile": {
"ssn": "123-45-6789"
}
}
}
.user.profile.ssn
Array elements:
{
"employees": [
{"name": "Alice", "salary": 50000},
{"name": "Bob", "salary": 60000}
]
}
.employees.salary
Conditional filtering (JSONPath):
{
"employees": [
{"name": "Alice", "department": "IT", "salary": 50000},
{"name": "Bob", "department": "HR", "salary": 60000}
]
}
$.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>
/customer/email
Nested elements:
<order>
<customer>
<payment>
<cardNumber>1234-5678-9012-3456</cardNumber>
</payment>
</customer>
</order>
/order/customer/payment/cardNumber
Attributes:
<user id="12345" role="admin">
<name>Alice</name>
</user>
/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>
/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/orlogical 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
- MT message is converted to XML using the Prowide library
- XML paths are applied to the converted structure
- 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
- Test your paths - Verify paths extract the correct data before applying protection
- Use specific paths - Target only the fields that need protection
- Consider nested structures - Account for arrays and nested objects/elements
- Document your paths - Keep a record of which paths protect which data types
- 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