Classification and masking
Describe what each topic holds, who owns it and how sensitive it is, and hide personal data from everyone who browses it in KCM.
Topic metadata
Open a topic and its metadata tab to record:
- a description, labels (key and value) and tags, used to filter the topic list;
- ownership, SLA and lifecycle;
- the contract of the topic (schemas, including JSON Schema), its producers and consumers;
- the classification below.
Editing metadata needs a cluster EDITOR or ADMIN role, or a topic grant with ALTER; reading it needs
VIEWER or DESCRIBE. Metadata can be locked against changes.
Classification
| Field | Values |
|---|---|
| Data sensitivity | PUBLIC, INTERNAL, CONFIDENTIAL,
RESTRICTED |
| Contents | Contains PII, PCI, PHI or secrets; in GDPR scope |
| Requirements | Masking required, encryption required |
| Legal basis | Consent, contract, legitimate interest, legal obligation, vital interest, public task |
| Residency and retention | Data residency constraint, retention policy, duration and justification |
| PII fields | The fields to mask, see below |
Masking
Masking is on for a topic when Masking required is checked and at least one PII
field is listed. Each masked value is replaced with <ANONYMIZED>, whatever its type (text,
number, boolean, object or array), and the message stays valid JSON.
PII fields syntax
| Entry | Masks |
|---|---|
email | Every JSON field named exactly email, at any depth, inside arrays
too (backup_email is not matched). |
customer.address.street | That path from the root of the value. Arrays on the way are traversed. |
$.phones[*].number | Same as phones.number: a leading $.
and [*], [] or [0] are accepted. An index masks every element. |
$key | The whole message key. |
- Entries are case insensitive.
- Each entry also masks the message headers with that name.
- For text that is not JSON, KCM masks
"name": valuepairs on a best effort basis. - Binary values (Protobuf or undecodable data) are left as is, except with
$key; in the consumer page they are not sent at all for a masked topic.
Where masking applies
- The consumer page, before any filter, and therefore its CSV and JSON exports.
- Message samples (for example when building templates or test scenarios).
- Test scenario reports: assertions run on the real messages, but the values and field differences shown in the report are masked.
Masking applies to every user, global administrators included: KCM has no permission to see masked values.
Masking protects what KCM displays. It does not change the data in Kafka. Replaying a message by its offset re-produces the original record, and ksqlDB or Flink SQL results are not masked. Restrict those features with roles on sensitive clusters.