Jonah Eisen
12/16/2024, 8:20 PMoguzhan
rule
activated the output
. This is because outputs
are defined per rule
.
As an example, given a policy such as this:
---
apiVersion: api.cerbos.dev/v1
resourcePolicy:
version: "default"
resource: "system_access"
rules:
- name: working-hours-only
actions: ['*']
effect: EFFECT_DENY
roles: ['*']
condition:
match:
expr: now().getHours() > 18 || now().getHours() < 8
output:
when:
ruleActivated: |-
{"principal": P.id, "resource": R.id, "timestamp": now(), "message": "System can only be accessed between 0800 and 1800"}
conditionNotMet: |-
{"principal": P.id, "resource": R.id, "timestamp": now(), "message": "System can be accessed at this time"}
There is only one rule defined and it's working-hours-only
.
If the rule is activated the response would include outputs
field like this:
[
{
"src": "resource.system_access.vdefault#working-hours-only",
"val": {
"message": "System can only be accessed between 0800 and 1800",
"principal": "john",
"resource": "bastion_002",
"timestamp": "2023-06-02T21:53:58.319506543+01:00"
}
}
]
it is possible to see the rule after #
in the src
field.Jonah Eisen
12/16/2024, 9:12 PMDennis (Cerbos)
Jonah Eisen
12/16/2024, 10:57 PMDennis (Cerbos)
Dennis (Cerbos)
Jonah Eisen
12/16/2024, 11:42 PMmeta
block?Jonah Eisen
12/16/2024, 11:43 PMCheckResourcesResult
object in the python client doesn't have the meta
field...Jonah Eisen
12/16/2024, 11:47 PM