You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

This page contains topics supporting ongoing discussion at dev@syncope.apache.org.

Tracked as SYNCOPE-119.

This topic dates very early in Syncope's history (the mail thread referenced in the issue mentioned above was started in 2011, even before entering the incubator).

Fundamentally, it is intended as a proper replacement for the current authorization mechanism, which is in place since almost the beginning, based on the concept of role entitlement.

The idea is to introduce the concept of realm - widely employed elsewhere as a mean to define security constraints in order to restrict access to shared 'resources'.

Entity changes

  1. Create the new Realm entity, with the following characteristics:
    1. has a name and a parent realm (except for the pre-defined root realm, which is named '/');
    2. will be either leaf or root of a sub-tree of realms;
    3. is uniquely identified by the path from root realm, e.g. /a/b/c identifies the sub-realm 'c' in the sub-tree rooted at 'b', having in turn 'a' as parent realm, directly under root realm;
    4. optionally refers to account or password policies.
  2. Rename the Role entity to Group and
    1. remove inheritance;
    2. remove references to account or password policies;
    3. remove references to entitlements;
    4. adding reference to a realm: each group of a sub-realm will also be group of its parent realm;
  3. Rename all ROLE_* entitlements to GROUP_*
  4. Create the new Role entity, with the following characteristics:
    1. has multiple references to entitlements;
    2. has multiple reference to realms: selected entitlements will be associated to the given realms.
  5. Update the User entity by
    1. adding reference to a realm: each user of a sub-realm will also be user of its parent realm.
  6. There won't be global account or password policies any more, but simply account / password policies for the root realm; account and password policies can be optionally defined for a given sub-realm: in this case the resulting policy to be applied will be the composition of all defined policies for ancestor realms up to root realm.

REST API changes

beforeafterdescription
 

GET /realms

GET /realms/a/b

list realms starting at given root:
all realms in the former case, realms rooted at /a/b in the latter case
 GET /realms/a/b/cread realm /a/b/c
 POST /realms/a/bcreate realm under /a/b
 PUT /realms/a/b/c/d

update realm /a/b/c/d

 DELETE /realms/a/bdelete realm /a/b (and all sub-realms)
GET /usersGET /users
GET /users;realm=/a/b 
list users under the given realm (e.g. assigned to given realm and related sub-realms):
all users in the former case, users in realm /a/b (all all sub-realms) in the latter case
POST /usersPOST /users
POST /users?realm=/a/b 
create user under the given realm:
root realm in the former case, /a/b in the latter case 
 PUT /users/{userId}?realm=/a/bmove user with id {userId} under realm /a/b
GET /users/searchGET /users/search
GET /users/search;realm=/a/b 
search users under the given realm:
root realm in the former case, /a/b in the latter case
GET /rolesGET /groups
GET /groups;realm=/a/b 
see users
POST /roles

POST /groups
POST /groups?realm=/a/b

see users
 PUT /groups/{groupId}?realm=/a/bmove group with id {groupId} under realm /a/b
GET /roles/searchGET /groups/search
GET /groups/search;realm=/a/b 
see users
GET /roles/{roleId}/parent  
GET /roles/{roleId}/children  

New security model

This is a direct replacement of current security model.

The idea is that any user U assigned to a role R, which provides entitlements E1...En for realms Re1...Rek can exercise Ei on entities (users or groups, depending on the type of Ei) under any Rej or related sub-realms.

Example

Let's rephrase the sample used for current security model:

Let's suppose that we want to implement the following scenario:
Administrator A can create users under realm R5 but not under realm R7, administrator B can update users under realm R6 and R8, administrator C can update groups under realm R8.

As default, Syncope will have defined the following entitlements, among others:

  • USER_CREATEUSER_UPDATE, GROUP_UPDATE

Here it follows how entitlements should be assigned (via roles) to administrators in order to implement the scenario above:

  • A: USER_CREATE on R5
  • B: USER_UPDATE on R6 and R8
  • C: GROUP_UPDATE on R8
  • No labels