[keycloak-dev] roles vs. groups

Pedro Igor Silva psilva at redhat.com
Wed Nov 4 07:46:41 EST 2015


> 
> Let's supose, you have a group called "GroupA", that group have roles
> "Create invoice" this has 13 permisions, "Remove invoice" this has 5
> permisions, "Update invoice" this has 19 permisions...
> 
> I asign 25 users to Group A, but 2 users, should not have 3 permisions
> that are different in both users, should I need to create "GroupB" and
> "GroupC" with the exact permissions, just to handle this 3 permisions
> exclusions?
> 
> It probably can be a little overkill, but IHMO is more flexible than
> an all or nothing approach.
> 

I see your point. However, IMO, when you start to use negatives you may end up with something more complicate and hard to follow.

What I meant by positive logic is not an all or nothing approach, but use positives permissions and play with them to match your requirements.

For instance, we are developing some additional authorization features to Keycloak. There you can define a set of policies that rule access to your resources based on different type of access control mechanisms: rbac, contextual/risk-based, abac, user-based, etc.

Policies can be applied to a resource type, resource instance, a specific scope (eg.: create, remove, delete, etc) or a combination of them. Policies are also independent of each other and can be reused and combined in different ways to actually define and enforce authorization for a given resource/scope.

Considering you scenario, you would have something like that:

    - Only Group A Policy (defines that all members of Group A can *do something*)
    - Resource X Policy (here we are telling what Group A can do. In this case, access Resource X and any of its scopes)
      - Applies Only Group A Policy

You can also have something like:

    - Only Group A Policy (defines that all members of Group A can *do something*)
    - Create Invoice Policy (here we're telling that Group A can access a specific scope.)
      - Applies Only Group A Policy

Now, if you want specific policies for some of your users, you can do something like:

    - Exceptional Y Policy (which can define a specific user, role, group, any contextual information like current time or authentication method)
    - Create Invoice Policy
      - Applies Only Group A Policy
      - Applies Exceptional Y Policy

That will provide flexible policies, make them more meaningful and easy to follow/understand. We are considering protect resources as important assets within an organization, which should be ruled by a set of policies that must be applied before accessing them.

I would appreciate if you could provide some more info about your use case. Right now I'm writing some examples and would be nice to check how your requirements can be addressed (or not :)) with what we did so far.

Thanks.
Pedro Igor


      


More information about the keycloak-dev mailing list