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

Mask data in decision log, but not /v1/data response. #2752

Closed
gshively11 opened this issue Oct 6, 2020 · 1 comment · Fixed by #2808
Closed

Mask data in decision log, but not /v1/data response. #2752

gshively11 opened this issue Oct 6, 2020 · 1 comment · Fixed by #2808
Labels

Comments

@gshively11
Copy link
Contributor

Expected Behavior

When input/result is masked, e.g. mask["/result/something_sensitive"], it should be removed from the decision logs, but not from the /v1/data API response (optionally?). Decision logs tend to be shipped centrally, and sensitive data should be removed from those, but the /v1/data API response should still contain that data so that calling apps can use it as needed.

Actual Behavior

When mask is used, it impacts both the decision logs and the /v1/data API response.

Steps to Reproduce the Problem

OPA version: 0.24.0-dev

@tsandall
Copy link
Member

tsandall commented Oct 6, 2020

This sounds like a bug. The result sent to the caller should not be mutated by the decision log mask--the decision logger will need to make a deep copy of the result before applying the mask (if the mask doesn't refer to the result, we can avoid the copy for performance.)

@tsandall tsandall added the bug label Oct 6, 2020
tsandall pushed a commit that referenced this issue Oct 27, 2020
When mask rules targeted /result, it was modifying both the result
in the decision logs (intended) and the result in the API
response (unintended). Added a step to deep copy the result only once, if
there is at least one mask rule targeting the result.

Fixes #2752
Signed-off-by: Grant Shively <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants