Pattern 3: Encrypting Location Data
This pattern demonstrates how to protect precise location information, like a street address, while preserving less sensitive geographic data (like a city or state) for regional analytics.
The Pattern
For any object containing a physical address:
- Encrypt the fields that provide precise location, such as
streetand the fullzipcode. - Extract and Preserve fields that are useful for analytics but do not identify an individual, such as
city,state,country, and thezip_prefix(the first 3 digits of a US zip code). - Delete the original, plaintext sensitive fields.
Implementation
You can add this logic to the same mapping processor you've been building in the previous steps.
-
Start with your Pipeline: Open the
encrypt-pii.yamlfile from Step 2. -
Inspect the maintained mapping: Review the selected fields, key lookup, and plaintext removal in the linked reference before adapting the processor.
See the complete configuration for the maintained encryption mapping and its ciphertext fields.
Note: Use the key variable names from the configuration you are adapting.
Verification
When you run data through the updated pipeline, the billing_address object will now be protected. The street and zip fields will be gone, replaced by their encrypted versions and the safe zip_prefix. City and state are preserved for your analytics needs. This same pattern can be applied to a shipping_address or any other location-based object.