json-masker's People
json-masker's Issues
Allow Blacklisting also
Is there any way to allow blacklisting instead of whitelisting, so we will mention the fields name to be masked and remaining fields will not be masked.
whitelisting
Problem
Despite json-masker library is pretty good with masking sensitive data in general case, it masks too much in some situations. For example, we have to hide sensitive data in an array of patch instructions.
Thus,
[
{"op": "replace", "path": "customer/customerIdentity/firstName", "value": "the_new_customer_name"},
{"op": "replace", "path": "customer/customerIdentifier/sourceMarket", "value": "GB"}
]
will be transformed to something like:
[
{"op": "xxxxxxx", "path": "xxxxxxxxxx/xxxxxxx/xxxXxx", "value": "XxxxxxxXxxx*"},
{"op": "xxxxxxx", "path": "xxxxxxxxxx/xxxxxxx/xxxXxxx", "value": "XxxxxxxXxxx*"}
]
We are 100% sure that "op" and "path" fields never contain sensitive info, but the values of those fields could be useful for debug purpose. The solution might be whitelisting of exact fields.
Possible solutions
- by array of keys
For example, we can say that ['op', 'path'] values should never be masked no matter where we find these keys in json structure. This solution is the simplest but as a drawback, there is a chance to unmask something that we didn't want to. However, from my point of view, the probability of such problem is very low. - by exact keys (full path in json)
This is the most secure variant, but it also has a drawback. It could be hard to cover the case from the problem description as it is not clear, how to deal with arrays. - by regexp
This is the most flexible solution, but we still can accidentally unmask something unwanted. Moreover, it could cause the performance issue which is bad for lightweight logging related library. - mix of all previous
Could contain all the problems from all solutions and have a too complex configuration.
I propose to start with the first variant, at least to begin with. @shumsky what do you think?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.