Michael
06/02/2023, 10:25 AMexpr: P.attr.foo = env["FOO"]
?Roman Levytskyi
06/02/2023, 11:57 AM{
"log.level": "error",
"@timestamp": "2023-06-02T11:50:25.391Z",
"log.logger": "cerbos.git.store",
"message": "Failed to check for updates",
"dir": "/work",
"error": "failed to pull from remote: worktree contains unstaged changes"
}
This is happening when I’m running tests in parallel:
1. constantly pushing random number of policies, both modified and new
2. constantly running process calling isAllowed
method on SDK
What could it be?
I’m afraid that when a policy is being modified and authz request is being received at the same time, the check could fail.
Also sometimes pod crashes and is being restarted with normal Shutting down
message, althought k8s resources are not limited.Dmitry Meyerson
06/02/2023, 10:03 PMVladyslav Ishchenko
06/05/2023, 6:26 PMConor Downey
06/05/2023, 6:32 PMDung Truong
06/05/2023, 7:04 PMderivedRoles
.
In this case, it's about too much responsibilities in Cerbos.
My expectation is, those deriveRoles
is normal role
, but it's determined via the request
object instead. Could this simplify the system ? So i could send the role
directly via request
.Dung Truong
06/05/2023, 7:04 PMNorberto Cáceres
06/06/2023, 7:37 PMLuis Diaz
06/07/2023, 8:38 AMLuis Diaz
06/07/2023, 10:59 AMMatthew Ebeweber
06/07/2023, 5:10 PMDmitry Meyerson
06/12/2023, 6:46 PMDmitry Meyerson
06/12/2023, 9:36 PMBen Hall
06/13/2023, 12:25 PMDavid Nilsdotter
06/15/2023, 12:45 PMapiVersion: api.cerbos.dev/v1
resourcePolicy:
version: default
resource: feature
scope: A
importDerivedRoles:
- derived_roles
rules:
- actions:
- feature:**
effect: EFFECT_ALLOW
derivedRoles:
- ADMIN
- USER
In the default scope I setup all effects to DENY, to switch them on for the child scopes. This scope, A
currently has access to all features if you are associated with the project.
But now we have a single feature that we would like to disable based on condition (something like this)
- actions:
- feature:viewer:toolbar:design
effect: EFFECT_DENY
derivedRoles:
- ADMIN
- USER
condition:
match:
expr: P.attr.projects.filter(t, t.id == R.attr.projectId).all(t, t.hasDesignSeat == false)
But that generates contradicting rules, and it returns ALLOW for the action feature:viewer:toolbar:design
I understand where it comes from, but how do I a address this? I see two options, both with the same issue. Either I define all of the actions instead of using wildcards except feature:viewer:toolbar:design
for the standard case, which would make the ALLOW list quite large.
Or I swap the default scope to ALLOW instead of DENY, which would allow me to just DENY feature:viewer:toolbar:design
in this scope (and the rest is allowed in the default scope. But that introduces the issues in the other scopes, where I would need to block all the action not allowed there, which also ends up being quite a lot of action lists. And logically, (in our case at least) it is easier to grasp the access scope when listing allowed actions instead of the blocked.
Is there a way to prioritize actions? One suggestion would be to make more specific actions trump loosely defined actions (a:b:c
> a:b:*
), within the same scope, if that could be possible.Owen Cummings
06/15/2023, 6:58 PMcompile.cacheDuration
setting. Is there a way to set this to infinite? They default value is 1 minutes, does this mean that Cerbos is recompiling my policies every minute? The way I am using Cerbos is building a Docker image with my policies in the image and using the disk driver, so they never change unless I redeploy a new version of the image. Would there be any performance benefit to caching forever?Dmitry Meyerson
06/15/2023, 9:16 PMRafael Szuminski
06/17/2023, 11:43 PMconst cerbos = new HTTP(`192.168.0.17:3592}`);
const result = await cerbos.checkResources({
principal: principal,
resources: resources
});
Like I said, this works on Chrome but blows up on Fierfox with CORS Missing Allow Origin
I tested default docker image and custom config where I specify CORS, both results are same
---
server:
httpListenAddr: ":3592"
grpcListenAddr: ":3593"
engine:
defaultPolicyVersion: "default"
auxData:
jwt:
disableVerification: true
storage:
driver: "disk"
disk:
directory: "/policies"
watchForChanges: true
cors: # CORS defines the CORS configuration for the server.
allowedHeaders: ['content-type'] # AllowedHeaders is the contents of the allowed-headers header.
allowedOrigins: ['*'] # AllowedOrigins is the contents of the allowed-origins header.
disabled: false # Disabled sets whether CORS is disabled.
maxAge: 10s # MaxAge is the max age of the CORS preflight check.
Rafael Szuminski
06/17/2023, 11:43 PMRafael Szuminski
06/17/2023, 11:57 PMCarl Bäckström
06/19/2023, 3:05 PMcar_tire
?Logan
06/19/2023, 8:27 PMQuery Planner API
, but I'm curious if there are any examples on how it's used?
A bit more about our setup below:
• node
+ graphql
+ mongodb w/ mongoose
backend
• We have businesses
with users
and orders
attached to them
◦ business
<-> user
is an n:m
relation
◦ business
<-> order
is a 1:n
relation
• Users are assigned roles on a business by business basis
◦ viewer
-> can read
all business orders
◦ owner
-> can read
and update
all business orders
◦ contractor
-> can read
some business orders (contractors are granted read permissions to a specific set of orders on a case by case basis)
Authorizing standard CRUD operations on a single order
resource has been straightforward, but I'm not exactly sure how we should go about fetching and paginating a list of orders the a user
can view
for a given business
Any insight would be helpful!Rasmus Dencker
06/19/2023, 9:36 PMakkaratanapatT
06/20/2023, 11:52 AMconst cerbos = new Cerbos("my_domain", { tls: true });
It's working well and I do want to do it in Rust
let options =
CerbosClientOptions::new(CerbosEndpoint::HostPort("my_domain", 3592));
let mut client = CerbosAsyncClient::new(options).await?;
it said CheckResources call failed, i'm not sure that it because I add 3592 or not, butI add it due to CerbosEndpoint require it.
May you direct me to the right way?Brandon Choe
06/20/2023, 6:01 PMANILA SOMAN
06/21/2023, 6:22 AMfunc (a Adapter) DeletePolicy(ctx context.Context, in *cerbospb.DeletePolicyPayload) (*cerbospb.DeletePolicyResponse, error) {
_, err := a.cerbosClient.CerbosAdminClient.DisablePolicy(context.Background(), in.Id)
if err != nil {
log.Printf("failed to disable policy: %s", err)
if statusError, ok := status.FromError(err); ok {
// Extract gRPC status information
return nil, status.Errorf(statusError.Code(), "failed to disable policy: %s", statusError.Message())
}
return nil, status.Errorf(codes.Internal, "failed to disable policy: %s", err)
}
return &cerbospb.DeletePolicyResponse{
Success: true,
}, nil
}
Norberto Cáceres
06/21/2023, 4:55 PMisAllowed
as part of the principal's attributes and treating the team itself as the resource, to check in a derived role condition if the team's id is present in the teams array with a role of "Admin"?Norberto Cáceres
06/21/2023, 5:14 PMjimmy mc
06/22/2023, 4:36 AMRasmus Dencker
06/22/2023, 8:05 AM