Mask sensitive data #265
-
I want to mask the password in my Open Policy Agent (OPA) logs. This is my input data:
My OPA mask rule:
But when OPA checks the request, the sensitive data won't be masked with the new text. Any idea?! I checked the rule in the The Rego Playground (https://play.openpolicyagent.org/) which was fine... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hi @fkunzmann 👋 I've answered the same on StackOverflow, but posting here as well for posterity. From the OPA docs on the topic, you'll see that the original input attribute may be referenced under package system.log
mask["/input/password"] {
# OPA provides the entire decision log event as input to the masking policy.
# Refer to the original input document under input.input.
input.input.resource == "user"
} Changing |
Beta Was this translation helpful? Give feedback.
Hi @fkunzmann 👋
I've answered the same on StackOverflow, but posting here as well for posterity.
From the OPA docs on the topic, you'll see that the original input attribute may be referenced under
input.input
(i.e. not justinput
, as that's the input attribute for the masking policy itself).Changing
input.attributes.request.http.body
toinput.input.attributes.request.http.body
should do it.