Skip to main content
Version: 97.1

Dynamic data policies

Dynamic data policies build data masking rules extracted from metadata in your Kafka schemas.

You write dataset mapping rules once per schema registry. Factor House applies them to every subject in that registry and masks the matching fields on the topics associated with each schema.

When schemas are added or modified, the policies are updated to match.

For example, a field in your Avro schema might have a dataset facet named classification. You could create a rule that redacts this field when a schema has set its value set to pii:


{
"name": "customer_name",
"type": "string",
"data_catalog": {
"classification": "pii"
}
}

Factor House checks these rules against every subject in the registry. It works out which topics each subject is written to, from its naming strategy and any Confluent topic-subject associations. It then masks the matching key and value fields whenever those topics are viewed in data inspect.

This feature works alongside any existing file-based policy definitions. Factor House combines them with dynamic policies, and any topic exclusions apply to both.

All Kafka search functionality provided by Factor House (such as Kpow's data inspect and kREPL, estate data inspect, API and MCP) will evaluate dynamic data policies for all queries performed.

Configuration​

To enable this feature you must first set ENABLE_DATASET_POLICIES=true.

Next, you can edit any Schema Registry mappings you have defined, and define redaction rules for any column-level mappings you have configured:

Editing a dataset mapping to include data policies in Factor House

Once you have configured redaction policies, you can see which data policies are active on each individual dataset, along with their associated topics, by viewing a dataset and navigating to the 'Data' tab:

Viewing a dataset and seeing their applied data policies

For all datasets where Factor House has failed to make a topic association (see Supported naming strategies), Factor House will present a dataset quality issue named Unresolved topic symlink at Error level:

Viewing data quality issues matching the 'Unresolved topic symlink' issue

Considerations​

Dynamic policies are built the same way as the rest of Factor House: by observing resources in your estate.

Factor House observes your schema registries and Kafka topic configuration, checks your column mappings against each schema, and keeps the policies up to date.

When schemas evolve, new subjects are registered or rules are edited, the policies update with them.

This model is eventually consistent, so any changes to downstream data sources may take up to a minute to resolve as data policies.

From Factor House's main menu, you can always navigate to 'Governance' -> 'Data policies' to see all active data policies in the system:

Factor House's data policies administration UI

Scope​

  • Dynamic policies apply to the key and value of Kafka records. They don't cover record headers, ksqlDB, or Iceberg tables.
  • Only Avro and JSON Schema subjects are currently supported
  • AWS Glue schema registries are currently not supported
  • All dynamic policies apply Full redaction. Partial redactions such as ShowLast4 and SHAHash are only available in static policies
  • Policies from a schema registry apply only to topics on the Kafka cluster that registry is configured with. If several clusters share one registry, configure it on each cluster with its own resource ID.

Supported naming strategies​

  • TopicNameStrategy and TopicRecordNameStrategy subjects are supported.
  • RecordNameStrategy subjects require explicit Confluent topic-subject association (AssociatedNameStrategy). Visit the Confluent documentation for more information.
    • Note: a topic which carries more than one schema type is not supported.

Schema versions​

Dynamic data policies are built from the latest version of each subject. Fields are masked by name, so records written with older schema versions are masked as long as each masked field has the same name in the latest version.

Fields that have since been removed or renamed are not masked in older records.

For example, if ssn is renamed to tax_id, records written before the rename still contain ssn, and it won't be masked. In this scenario, in order to keep masking older records you must use static data policies.