Skip to content

As a user I want to be able to mask only the nested field of a message but not all fields #4361

@SamsadSajid

Description

@SamsadSajid

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

No response

Describe the feature you're interested in

Issue 1

The data masking document describes how to mask data but the examples contain linear field names. However, the document says that

Note: if target field's value is object, then replacement applied to all its fields recursively (see example).

The given example in the document was:

- type: REPLACE
  fields: [ "id", "name" ]
  replacement: "***"  #optional, "***DATA_MASKED***" by default

which results in

{ "id": 1234, "name": { "first": "James", "last": "Bond" }, "age": 30 } 
 ->
{ "id": "***", "name": { "first": "***", "last": "***" }, "age": 30 } 

But this should not be the desired behaviour. A nested object can contain multiple fields. Those fields can be tremendously helpful to view from Kafka-ui. But with the current version of Kafka-ui, this is not achievable as Kafka-ui masks all internal fields.

The desired behaviour should be:

- type: REPLACE
  fields: [ "id", "name.first" ] // or some other config
  replacement: "***"  #optional, "***DATA_MASKED***" by default

which should result in

{ "id": 1234, "name": { "first": "James", "last": "Bond" }, "age": 30 } 
 ->
{ "id": "***", "name": { "first": "***", "last": "Bond" }, "age": 30 } 

Issue 2

If there are multiple fields with the same name present in a message, all fields are masked.

Example:

name: "test",
id: 1
meta: {
  id: 2,
  ...
}

Say, I want to mask only the meta.id field. But if I mention id in the fields list, it masks all fields with the name id. So the above message becomes:

name: "test",
id: ****
meta: {
  id: ****,
  ...
}

Summary

Combining the above two issues, as a user of Kafka-UI, it would be great to have config settings where I can say exactly what fields in a message I want to mask.

Describe alternatives you've considered

No response

Version you're running

0.7.1

Additional context

I have proto models serde to deserialize the messages in Kafka-ui

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions