Skip to content

⚙️ Advanced Settings – Data Type Obfuscation Rules

In a Data Type definition, the Advanced Settings section contains three fields that define how and when to apply obfuscation to values in structured or semi-structured data.


1. 📦 JSON Definition

This field allows you to define obfuscation rules for specific properties in JSON responses using a structured JSON query format.

🔍 Purpose

Use it to match keys, values, arrays, and nested objects. You can also apply conditional logic and regular expressions to determine whether to obfuscate a value. Regex fields use Go RE2 syntax (no look-around or back-references).

✅ Example 1 – Obfuscate all description fields

{
  "Search": {
    "Object": {
      "Key": {
        "Value": "description"
      }
    }
  }
}

✅ Example 2 – Obfuscate title only when pricing is "paid"

{
  "Search": {
    "Object": {
      "Condition": {
        "HasKey": {
          "Value": "pricing"
        },
        "HasValue": {
          "Value": "paid"
        }
      },
      "Key": {
        "Value": "title"
      }
    }
  }
}

✅ Example 3 – Obfuscate values in listingCategories array that start with "C"

{
  "Search": {
    "Object": {
      "Key": {
        "Value": "listingCategories"
      },
      "Value": {
        "Array": {
          "Value": {
            "String": {
              "Regex": "(?i)^C.+"
            }
          }
        }
      }
    }
  }
}

2. 🌐 HTML Definition

This field accepts an XPath string used to extract values from HTML documents. You can combine this with a regex (defined separately) to detect sensitive data.

✅ Example

HTML Definition (XPath only):

 //a/@href

Regex (configured separately):

(?:(?:ASIA|AKIA|AROA|AIDA|ABIA|ACCA)(?:[A-Z0-9]{16}))

CheckBoundaries:

true

This setup extracts all href attributes from anchor tags and applies a regex to detect access key patterns. With CheckBoundaries: true, the match must not be embedded inside other tokens.


3. 🎯 Value Group Index

If the regex includes capture groups, this numeric field defines which group should be obfuscated.

✅ Example

Regex:

user:([a-zA-Z0-9_]+)@domain.com

Value Group Index:

1

Effect:
Only the capture group ([a-zA-Z0-9_]+) — i.e., the username — will be obfuscated. The domain part remains visible.

If this field is omitted or set to 0, the entire match is obfuscated.


📌 Summary

Field Name Type Description
JSON Definition JSON Declarative rule set for selecting and obfuscating fields in JSON
HTML Definition string XPath selector for extracting HTML elements or attributes
Value Group Index integer Optional: index of the capture group to obfuscate in regex-based matches

Use these fields to precisely control which parts of the data should be obfuscated and under what conditions.