Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
SamsadSajid opened this issue Jan 15, 2024 · 2 comments
Open
2 tasks done
Labels
status/triage Issues pending maintainers triage type/feature A new feature

Comments

@SamsadSajid
Copy link

SamsadSajid commented Jan 15, 2024

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

@SamsadSajid SamsadSajid added status/triage Issues pending maintainers triage type/feature A new feature labels Jan 15, 2024
Copy link

Hello there SamsadSajid! 👋

Thank you and congratulations 🎉 for opening your very first issue in this project! 💖

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. 👀

@SamsadSajid
Copy link
Author

I am thinking out loud here: since Kafka-ui is doing the deserialisation with the Proto serde, it should know the structure of the message i.e., fields and its nested structure. In that case, can't Kafka-ui use this context to mask only the required fields? i.e., if I mention only fields: [ "id", "name.first" ], can't Kafka-ui use the proto-model structure to only mask the first field of name field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage Issues pending maintainers triage type/feature A new feature
Projects
None yet
Development

No branches or pull requests

1 participant