Can we add additional fields to decision log from the policy rego #567
-
I am using the Istio and OPA sidecar model for traffic authorization. I also have a decision log drop rego file, in which I want to drop the log in the case it was made by a particular allow rule. Wondering if I can inject an additional field in the decision log indicating this or is there some other way this can be done? I can execute the same logic in the drop log rego file again to check if this was allowed by that particular rule, but this feels too heavy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
In a sketch:
result["_meta"] := true if is_special_rule
Does that help? Let me know if you get stuck in the process! |
Beta Was this translation helpful? Give feedback.
Yes.
this indicates that you're not using the document response variant (above, (1.)).
You'll need to adapt your policy to be like
and adjust your config to query, in this example,
envoy/authz/result
, notenvoy/authz/allow
.