Obfuscations Reference
Detailed reference information for the Obfuscations API.
Field Validation
Name
| Field | Constraints |
|---|---|
| Length | 1-64 characters |
| Format | Any printable characters |
Description
| Field | Constraints |
|---|---|
| Length | 0-128 characters |
| Format | Any printable characters |
Filter Conditions
Obfuscations can use contextual filters to apply masking conditionally based on surrounding data.
Number Condition
Match numeric values with comparison operators.
Operators: equal, notEqual, greaterThan, lessThan, greaterThanOrEqual, lessThanOrEqual
String Condition
Match string values with text operators.
Operators: equal, notEqual, contains, notContains, startsWith, endsWith
Date Condition
Match date values with temporal operators.
Operators: before, after, between
Filter Types
| ID | Name | Description |
|---|---|---|
0 |
Sibling | Match field at same level |
1 |
Parent | Match field in parent object |
2 |
Ancestor | Match field in ancestor object |
Mask Format Types
Common mask formats available in Shield:
| Format | Description | Example |
|---|---|---|
| Asterisk | Replace with asterisks | ***-**-1234 |
| Hash | One-way SHA256 hash | a3f8b9c2d1e0f4a5... |
| Last 4 | Show only last 4 characters | ****1234 |
| First 4 | Show only first 4 characters | 1234**** |
| Redact | Replace with placeholder | [REDACTED] |
| Tokenize | Replace with reversible token | tok_a3f8b9c2 |
| Email Mask | Mask email preserving domain | u***@example.com |
Query available formats: GET /api/maskformats
Store Original Value
When to Enable
Enable storeOriginalValue when:
- De-obfuscation is required for authorized users
- Audit trails need original values
- Compliance requires retaining original data
- Analytics need access to real values
When to Disable
Disable storeOriginalValue when:
- Data is permanently masked
- Storage efficiency is critical
- Compliance prohibits retention
- No de-obfuscation needed
Security Implications
When enabled:
- Original values are encrypted before storage
- Encryption keys are managed by Shield
- Access requires proper authorization
- Storage size increases proportionally
Whitelist Best Practices
Test Data
Exclude known test values:
Placeholder Values
Exclude placeholder or example values:
System Values
Exclude system-generated values that aren't sensitive:
Filter Examples
High-Value Transaction Filter
Only mask when amount exceeds threshold:
Example
Environment-Based Filter
Mask in production, not in development:
Response Format
Date Range Filter
Only mask recent transactions:
Response Format
Best Practices
- Store originals carefully - Only enable
storeOriginalValuewhen de-obfuscation is required - Use whitelists for test data - Exclude known test values from masking
- Name descriptively - Indicate which data types and formats are used
- Test filters thoroughly - Contextual filters can be complex - verify with real data
- Group related types - Combine multiple data types in one obfuscation when they share the same mask format
- Document filters - Use description field to explain complex filter logic
- Monitor performance - Complex filters may impact scanning performance
Related Topics
- Create Obfuscation - Create new obfuscation configurations
- Data Types API - Define data types to obfuscate
- Rules API - Apply obfuscations via rules
- Data Scanning API - Test obfuscation behavior
- Activities API - Query obfuscated data in activities