IP anonymization enrichment

The IP anonymization enrichment lets you anonymize the IP addresses found in the user_ipaddress field by replacing a certain number of octets with “x”s. For example, anonymizing one octet would change the address 255.255.255.255 to 255.255.255.x, and anonymizing three octets would change it to 255.x.x.x.

{
    "schema": "iglu:com.snowplowanalytics.snowplow/anon_ip/jsonschema/1-0-0",

    "data": {

        "name": "anon_ip",
        "vendor": "com.snowplowanalytics.snowplow",
        "enabled": true,
        "parameters": {
            "anonOctets": 2
        }
    }
}

The anonOctets field is set to two, so the last two octets of each IP address will be obscured.

The input value for the enrichment comes from ip parameter which is mapped to user_ipaddress field in atomic.events table.

This enrichment algorithm is straightforward. The value of anonOctets set in JSON indicates how many octets of the IPv4 address are to be masked with xs starting from the last octet. The value of the ip parameter is masked accordingly.

The masked (anonymized) value of the IP address will be recorded in user_ipaddress field of atomic.events table.