Mads Baadsmand
07/16/2024, 8:49 PMmake lint
it complains about missing types in some role-policy related files
• When i run make build
it complains about something with docker-format for generate-api-docs
.
• When i run make build
(commenting out documentation, and linting) it fails several tests
• When i run make build
(commenting out above plus testing) I get a docker image I can run.
◦ it recognizes a rolePolicy document, but I cannot make it return an EFFECT_ALLOW
I'm sure i'm missing something in my process. Can anyone enlighten me?Mads Baadsmand
07/16/2024, 8:58 PM---
apiVersion: api.cerbos.dev/v1
rolePolicy:
role: myrole
rules:
- permissibleActions:
- comment
resource: "myresource"
my check request payload looks like this:
{
"actions": ["comment"],
"principal": {
"id": "bugs_bunny",
"roles": ["myrole"],
},
"resource": {
"kind": "myresource",
"instances": {
"one":{
"attr": {}
}
}
},
"requestId": "quickstart",
}
The response:
{
"requestId": "quickstart",
"resourceInstances": {
"one": {
"actions": {
"comment": "EFFECT_DENY"
}
}
}
}
Mads Baadsmand
07/16/2024, 9:01 PMAlex Olivier (Cerbos)
Mads Baadsmand
07/17/2024, 9:42 AMMads Baadsmand
07/17/2024, 2:08 PMMads Baadsmand
07/17/2024, 2:10 PMno match
under policy, the update and view have not_allowed_by_role_policies
Sam Lock (Cerbos)
07/18/2024, 6:34 AMNOT_ALLOWED_BY_ROLE_POLICIES
is communicating that a resource/action mapping was not defined in the role policy, hence implicitly is a DENY.Mads Baadsmand
07/18/2024, 8:38 AMMads Baadsmand
07/18/2024, 8:49 AMapiVersion: api.cerbos.dev/v1
resourcePolicy:
version: "default"
resource: "roleresource"
rules:
- actions: [ 'comment' ]
effect: EFFECT_ALLOW
roles: [ "myrole" ]
and then define
apiVersion: api.cerbos.dev/v1
rolePolicy:
role: myrole
rules:
- resource: "roleresource"
permissibleActions: [ "none" ]
then I get a DENY for myrole. Because while the resource policy allows the role policy doesn't explicitly allow.
But changing the permissableAction to "comment":
apiVersion: api.cerbos.dev/v1
rolePolicy:
role: myrole
rules:
- resource: "roleresource"
permissibleActions: [ "comment" ]
Makes it an ALLOW.Sam Lock (Cerbos)
07/18/2024, 4:39 PM