Benjamin Rupp
12/11/2025, 4:10 PMBenjamin Rupp
12/11/2025, 4:10 PM{
"policies": [
{
"apiVersion": "api.cerbos.dev/v1",
"metadata": {
"hash": "13999133081537641005",
"storeIdentifer": "resource./api/v1/stitchit/networkassets/_id.vdefault",
"storeIdentifier": "resource./api/v1/stitchit/networkassets/_id.vdefault",
"sourceAttributes": {
"attributes": {
"driver": "postgres",
"update_ts": "2025-12-11T14:47:02Z"
}
}
},
"resourcePolicy": {
"resource": "/api/v1/stitchit/networkassets/_id",
"version": "default",
"rules": [
{
"actions": [
"GET"
],
"roles": [
"inventory_sessions_read",
"tenant-admin",
"tenant-contributor",
"tenant-user",
"tenant-portal"
],
"effect": "EFFECT_ALLOW",
"name": "get.api.v1.stitchit.networkassets.id"
},
{
"actions": [
"DATA"
],
"roles": [
"data_access"
],
"effect": "EFFECT_ALLOW",
"name": "data.api.v1.stitchit.networkassets.id"
}
]
}
}
]
}
The intend is that specific roles have access to GET, but at specific enforcement points, DATA access might be further restricted.
User can have a role policy like the following, to further restrict DATA access based on criteria:
{
"policies": [
{
"apiVersion": "api.cerbos.dev/v1",
"description": "Vancouver access 2",
"metadata": {
"hash": "10364997532867708535",
"storeIdentifer": "role.ug_fd6cd5840631409abe3d347ea947ffca/bcaa9a67-5600-47a8-8bef-006a7105f974.data",
"storeIdentifier": "role.ug_fd6cd5840631409abe3d347ea947ffca/bcaa9a67-5600-47a8-8bef-006a7105f974.data",
"sourceAttributes": {
"attributes": {
"driver": "postgres",
"update_ts": "2025-12-11T15:13:27Z"
}
}
},
"rolePolicy": {
"role": "ug_fd6cd5840631409abe3d347ea947ffca",
"parentRoles": [
"data_access"
],
"scope": "bcaa9a67-5600-47a8-8bef-006a7105f974.data",
"rules": [
{
"resource": "*",
"allowActions": [
"*"
],
"condition": {
"match": {
"all": {
"of": [
{
"expr": "request.resource.attr.city in [\"vancouver\"]"
}
]
}
}
}
}
]
}
}
]
}
I send the following PlanResources requestBenjamin Rupp
12/11/2025, 4:10 PMcurl <http://localhost:3592/api/plan/resources?pretty> -d '{
"requestId": "test01",
"actions": ["GET", "DATA"],
"resource": {
"policyVersion": "default",
"kind": "/api/v1/stitchit/networkassets/_id",
"scope" : "bcaa9a67-5600-47a8-8bef-006a7105f974.data"
},
"principal": {
"id": "Ben",
"roles": ["tenant-admin","ug_fd6cd5840631409abe3d347ea947ffca"]
},
"includeMeta": true
}'
In 0.46.0 I get the following response
{
"requestId": "test01",
"actions": [
"GET",
"DATA"
],
"resourceKind": "/api/v1/stitchit/networkassets/_id",
"policyVersion": "default",
"filter": {
"kind": "KIND_CONDITIONAL",
"condition": {
"expression": {
"operator": "eq",
"operands": [
{
"variable": "request.resource.attr.city"
},
{
"value": "vancouver"
}
]
}
}
},
"meta": {
"filterDebug": "(eq request.resource.attr.city \"vancouver\")",
"matchedScopes": {
"DATA": "",
"GET": ""
}
},
"cerbosCallId": "01KC72P6CP8FXVEV5W5SHP8S1Z"
}
But now in 0.49.0 I get a different response
{
"requestId": "test01",
"actions": [
"GET",
"DATA"
],
"resourceKind": "/api/v1/stitchit/networkassets/_id",
"policyVersion": "default",
"filter": {
"kind": "KIND_ALWAYS_ALLOWED"
},
"meta": {
"filterDebug": "(true)",
"matchedScopes": {
"DATA": "",
"GET": ""
}
},
"cerbosCallId": "01KC72SB6RCGM5AZBYKHPRBN58"
}
The condition is not restricting any longer?Sam Lock (Cerbos)
12/11/2025, 6:28 PMBilly Bolton
12/11/2025, 7:07 PMBenjamin Rupp
12/11/2025, 7:23 PMSam Lock (Cerbos)
12/12/2025, 11:49 AM(not(and(not(eq), not(eq)))) is now back at (or(eq, eq)) where it rightfully belongs 👀Billy Bolton
12/12/2025, 1:23 PMSam Lock (Cerbos)
12/12/2025, 1:24 PMSam Lock (Cerbos)
12/12/2025, 1:25 PMSam Lock (Cerbos)
12/12/2025, 3:44 PM