-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High level RBAC API/manager #598
Comments
That article is an awesome explanation of what is needed and the current limitation of Keto. As discussed on Slack, I am still not satiesfied about the following point:
By looking at https://gruchalski.com/posts/2021-05-15-rbac-with-ory-keto/#fry-has-fried-the-production the proposed solution does indeed require manual removal of the bindings from all objects. This means that if I have 100.000 objects where I assigned the role
Or did I actually miss something?I belive that |
I think you are right, revoking a permission for a role does require iterating. But this could either be done by the high level RBAC solution proposed here, or enabling bulk deletion by providing partial relation tuples. I will open another issue for that idea, as it might be useful for other cases as well (think "purge user/object from everywhere"). |
Bulk deletion could be a working solution, but then again there would be no solution for the opposite operation: addition. In RBAC I must have a way to both add and delete permissions from a role. Ideally this operation shouldn't require touching thousands or million of tuples as performance and consistency would probably be hard to guarantee. It is my understanding that if user rewrites were available no high-level RBAC API would be required, am I correct? Would RBAC work out of the box with user rewrites? |
Actually, I think we can circumvent that limitation right now, if we fully ditch the object id. So basically everything from the blog post, but remove the first step. In this case it would not be related to specific objects anymore, but the permission itself is the object.
Revoking the create permission for all I now finally fully understand the problem you have @christian-roggia 😅 What I don't understand is do you want to add a new permissions to all objects in the system, or to a subset (might be large)? How would you solve the later case with other authorization systems? Because if it is not a global |
What I've found to be the easiest to reason about the individual person membership was not to explicitly make the individual persons a member. If I know that Bender is a I mean, this mapping has to exist somewhere. Otherwise how do you know the user has certain mapping assigned. There's no magical method to have a mapping without the info in the fact storage. This boils down to a cross reference: for any role Bender holds, is any of these roles allowed to execute this action on an object. The higher level tool is definitely able to update this consistently across large number of objects. I also think it's not uncommon to expect this kind of update to happen over millions of objects. You'll have to have the trade off somewhere: either when inserting / updating the permissions or during the query. I'd expect the trade off to be on the create / update step because the query must be as fast as possible. |
Just a terminology thing, a
So instead of a single user, you refer to a set of users defined by "everybody who has this permission". This part is already implemented in Keto, but we are missing the "rewrites", which allow you to basically define relation tuples globally with kind of variables. One good example is indirect permission on a file through permission on the parent directory. Currently you have to explicitly say that Therefore, you don't have to get all the roles of a specific user to check if any of the roles is allowed to do something, but you can instead if you have these tuples:
check if |
Thanks, that does explain things better. The higher level tool would definitely make things easier as thinking in tuples over multiple relationships is a bit of a mind bender. But then, this isn’t a Keto (Zanzibar) problem, rather a business domain complexity. |
Haha my brain thinks only in tuples since I worked so much on Keto 😂
This is a good point, we have to decide where the line between Keto and your business logic is. It seems that there are some steps that are always required for RBAC, and in that case it does make sense to add a high level abstraction for that. It would just be a shortcut and all the decisions will still be made through the ACLs. |
Hey @zepatrik, there is another problem with the queries: curl --silent 'http://localhost:4466/expand?namespace=default-namespace&subject=Fry&relation=member&max-depth=2' | jq '.' returns {
"type": "union",
"subject": "default-namespace:#member",
"children": [
{
"type": "leaf",
"subject": "Bender"
},
{
"type": "leaf",
"subject": "Fry"
},
{
"type": "leaf",
"subject": "Hermes"
},
{
"type": "leaf",
"subject": "default-namespace:it-director#member"
},
{
"type": "leaf",
"subject": "default-namespace:it-director#member"
},
{
"type": "leaf",
"subject": "default-namespace:dev-director#member"
},
{
"type": "leaf",
"subject": "default-namespace:it-director#member"
}
]
} this is completely not what the logic suggests the result should be. |
Abstract implementationThe following is a complete model that we previously implemented through a graph database (dgraph) that fully supported RBAC:
This is an example of the inheritance of policies from the most generic to the most granular. NOTE: Policies can be global or attached to a specific object. Hard requirementsWhat I would expect from an RBAC implementation is the following:
Practical examplesI have 3 users in a Google Cloud project called
The role
The project owns a Being Additionally, the user The role
Finally, the project owns a Being Additionally, all users have been granted read-only access to the The role
After an accident, it is decided that members of the The role is therefore changed to reflect the new decision:
This change must be reflected globally and retroactively. |
Hello contributors! I am marking this issue as stale as it has not received any engagement from the community or maintainers a year. That does not imply that the issue has no merit! If you feel strongly about this issue
Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic. Unfortunately, burnout has become a topic of concern amongst open-source projects. It can lead to severe personal and health issues as well as opening catastrophic attack vectors. The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone. If this issue was marked as stale erroneous you can exempt it by adding the Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you! Thank you 🙏✌️ |
Is there an anticipated timeline for when native RBAC support will go live? :) |
#877 ;) |
Truly native support as tracked in this issue is currently not being worked on actively. |
As I said, truly native support as tracked in this issue is currently not being worked on actively. Maybe you want to add your use-case and solution proposal? |
Hi, maybe I am wrong but isn't the More specifically what is missing for (H) RBAC to be usable? |
Yes, you can build RBAC using OPL, and configure it as needed. This issue is rather about having an "official" way to do RBAC. With the OPL, the new option of using dependencies and building authz libraries opened up. Instead of everyone defining their own (probably very similar) flavor of RBAC, we could provide something similar to import { Namespace } from "@ory/keto-namespace-types"
import { Role } from "@ory/rbac"
class User implements Namespace {...}
class File implements Namespace {...}
class FileRole extends Role {
// possibility to customize the role behavior
} But maybe this also is too much complexity and it makes more sense to just have everyone implement their own RBAC? Maybe we could collect some definitions here to see if it makes sense? |
It would be very nice to have a complete (and more complex, real life use case) RBAC-like example in the examples folder of this repo with best practices / common models. I think it would greatly benefit users coming into Keto like me |
Hello contributors! I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue
Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic. Unfortunately, burnout has become a topic of concern amongst open-source projects. It can lead to severe personal and health issues as well as opening catastrophic attack vectors. The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone. If this issue was marked as stale erroneously you can exempt it by adding the Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you! Thank you 🙏✌️ |
Is your feature request related to a problem? Please describe.
Implementing RBAC currently is possible, but requires a lot of thought and workarounds. A current solution is described in https://gruchalski.com/posts/2021-05-15-rbac-with-ory-keto/
Describe the solution you'd like
From that post:
Describe alternatives you've considered
cc @radekg @christian-roggia
The text was updated successfully, but these errors were encountered: