-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
allow custom masking of fields #2379
Comments
Thanks for filing this @daniel-garcia ! Just adding a note here that another similar use case would be additive changes like appending a signature based on the some fields (or all fields) in the decision log to ensure integrity. |
Any suggestions on where/how to start picking up this work? I see most of the logic is contained in |
@dkiser most (or all) of the logic is implemented inside of the decision log plugin like you found. I would start by figuring out the interface we want to expose to admins configuring OPA. Currently admins can implement a rule/decision that defines a set of paths in the decision log event to remove. The paths must be prefixed with package system.log
mask["/input/ssn"] # mask out the ssn field in the input document The decision path is configurable and it defaults to A few thoughts:
I propose we extend the implementation to support structured values in the mask set. For example: mask[{"op": "remove", "path": "/input/ssn"}]
mask[{"op": "upsert", "path": "/input/decision_signature", "value": x}] {
# logic to compute signature value
} This way the mask can generate a set of instructions for OPA. Each instruction specifies Internally, I'd modify the implementation to map old mask strings into the structure above and then refactor the rest of the implementation accordingly. |
Something like this has been on my wish list for a while, so thanks for picking it up! I could see it being valuable to create new fields in the decision log outside of |
@timothyhinrichs Maybe we can talk through this on our call today, and we'll take a stab at knocking this one out! |
…erase masking feature. This feature adds the ability to mutate decision logs in addition to the default behavior of erasing object paths. A new upsert command was added to a structured way to define mask rules in a backwards compatible manner. Fixes: open-policy-agent#2379 Signed-off-by: Domingo Kiser <[email protected]>
…erase masking feature. This feature adds the ability to mutate decision logs in addition to the default behavior of erasing object paths. A new upsert command was added to a structured way to define mask rules in a backwards compatible manner. Fixes: #2379 Signed-off-by: Domingo Kiser <[email protected]>
Expected Behavior
Masking sensitive fields should allow the field to be mutated instead of just dropped.
Actual Behavior
Masking only allows sensitive fields to be dropped.
Steps to Reproduce the Problem
https://www.openpolicyagent.org/docs/v0.13.5/decision-logs/#masking-sensitive-data
Not possible to modify a field... only drop it.
Additional Info
My use case is:
I am passing the entire JWT and other information to evaluate a decision. The JWT contains a signature that is being verified in OPA. The decision logs, however, expose the entire JWT which can be used in a playblack attack. If I drop the field, i don't have the entire context that was using for evaluating the decision. What I really want to do is just drop the JWT signature.
The text was updated successfully, but these errors were encountered: