![]() |
|||||
|
openCRX SecurityVersion 1.7.1www.opencrx.orgThe contents of this file are subject to a BSD license (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License here
Chapter 1. About this BookThis book describes the concept of role-based security as it is implemented by openCRX. What do you need to understand this bookThis book assumes a basic knowledge of security-related concepts and terms, including identity, authentication, and authorization. It is also helpful if you are familiar with openCRX accounts and user homepages (UserHomes). Chapter 2. PrerequisitesThe first few chapters of this book deal with concepts only, i.e. there are no prerequisites in terms of installing openCRX. It is helpful to have a basic knowledge of security-related concepts and terms, including identity, authentication, and authorization. With regard to the Real World Example, however, having access to an openCRX installation would obviously be an advantage as you could duplicate the setup and investigate your own tweaks to the security configuration. Chapter 3. Introduction to role-based securityIt is the main goal of the security concept of openCRX to control who is allowed to browse/delete/update which information. On the one hand this requires some infrastructure to manage identity data (e.g. principals, users), authentication data (e.g. passwords, certificates) and authorization data (e.g. permissions, roles), on the other hand the rules defined by the various permissions granted to principals must be enforced to ensure that no principal can take an action without being granted permission to do so. openCRX implements a state-of-the-art role-based security concept which utilizes the concepts of Principals and Roles, similar to the implementation of security in many current operating systems. While role-based security may be overkill in trivial settings (e.g. SOHO with two users who both are allowed to browse/delete/update all objects) it is an extremely powerful tool to get a handle on complex environments (e.g. ASP managing tens of thousands of customers/companies). Apart from these two extreme settings (SOHO, ASP), role-based security is also very useful in many typical company settings where various sales teams, customer service teams, and maybe accounting teams need to browse/delete/update customer-related data (e.g. sales orders, invoices, payments, support requests) while at the same time permissions on such data may vary depending on the function of the employee (imagine what would happen if accounting staff could enter/change sales orders or a customer service rep could alter customer payments). The following explanations are hopefully helpful to understand the role-based security concept as it is implemented by openCRX. Please be aware that the goal of this documentation is to explain the concepts used in openCRX - if you are interested in details and the formally correct and complete specifications you should refer to the openCRX UML models. The following figure shows the main ingredients of role-based security: At the core of role-based security is the concept of collecting Permissions in Roles, which can be granted to Principals (a Principal corresponds to a Login). For example, imagine a Principal admin-Standard who is granted the Role OpenCrxAdministrator which comes with all the Permissions required for a segment administrator to do his work, or a Principal salesrep1 who is granted the Role SalesRep which comes with all the Permissions required for a sales representative to do his work. For better manageability several Principals can be collected in a PrincipalGroup and Roles can be directly attached to PrincipalGroups. Users (e.g. human beings like Joe, Mary, Jeff) can be assigned multiple Principals to reflect the fact that some users connect to the system in different roles depending on the tasks at hand. For example, User joe might be assigned the Principal head-Sales (because Joe is head of sales) as well as the Principal admin-Standard (because Joe is also segment administrator). If Joe wants to work as segment administrator he logs in as Principal admin-Standard, if Joe wants to work as head of sales he logs in as Principal head-Sales. Credentials (like passwords, certificates, SecurIDs) are attached to Users. Like this it is possible to let Joe connect to the system with the same password, regardless of whether he acts as segment administrator or head of accounting. For better manageability several Users can be collected in a UserGroup. The term Subject is commonly used to refer to Users and UserGroups. In addition to this standard setup of role-based security openCRX allows you to relate Users to Contacts. Furthermore, each Principal is related (automatically) to an openCRX UserHome (this is how openCRX can easily maintain two different histories for Principal admin-Standard and Principal head-Sales; one history keeps track of Joe's actions when he is logged in as segment administrator, the other history keeps track of his actions when he is logged in as head of sales). These openCRX extensions to role-based security are shown in the following figure: Please note that the above figure represents a high-level view of the implemented security concept - refer to the openCRX UML models for detailed and formally correct and complete specifications. Chapter 4. PermissionsWith the openCRX security framework permissions can be granted with the following two methods:
Ownership PermissionsOwnership permissions are used to control browse/delete/update access to openCRX objects by Users and UserGroups. Ownership access control has been implemented since openCRX v1.4.0. Every openCRX object is a SecureObject. The following figure shows an extract from the UML model (if you are interested in all the details and the formally correct and complete specifications you should refer to the openCRX UML models): The most important security attributes of an object X are discussed below (and an example is shown in Figure 4-2):
The following access levels are available to control which users / user groups are granted permission to browse/delete/update a particular object X:
* a supergroup of an owning group G is a group of which G is a member of (recursively) ** a subgroup of an owning group G is a group which is member of G (recursively) Security Setting of New ObjectsNew objects are by default created with the following security settings:
If you see N/P in a field instead of a more meaningful value you probably do not have browse access to the respective object (N/P stands for No Permission). Security ExampleIn this chapter we discuss security for an example security organization (see Figure 4-3) and then show what individual users are allowed to do on example data (see Figure 4-4). Please note that this example security organization has educational value but it is not well suited for the real world. See chapter Real World Example for a more realistic setup. The example organization consists of 4 User Groups (Administrators, Users, Unspecified, and Unassigned) and 1 User (admin-Standard) created by openCRX. In addition, there are 5 User Groups (Sales, SalesTeamA, SalesTeamB, Accounting, and AccountingTeamA) and 8 Users (head-Sales, salesrep1, salesrep2, salesrep3, salesrep4, head-Accounting, accountant1, accountant2) created by the segment administrator: The above chart reads as follows (just to give a few examples, i.e. many more statements could be made about the above chart):
The example data consists of 6 openCRX objects (S, X, Xa, Xb, Y, and Ya): If you, for example, look at object Xa the following security attributes are set:
Similarly, Figure 4-4 contains information about the security attributes of all the other openCRX objects. Next, we will analyze for a few of the example users which objects they are able to browse to, which objects they are allowed to delete, and which objects they have permission to update. The whole discussion is based on the security organization as it was presented in Figure 4-3. Let's start with the user admin-Standard. On the following chart, green indicates that access is granted, red indicates that access is not granted:
Let's now look at the user head-Sales. On the following chart, green indicates that access is granted, red indicates that access is not granted:
On the following chart, green indicates that access is granted to the user salesrep1, red indicates that access is not granted to salesrep1:
On the following chart, green indicates that access is granted to the user salesrep2, red indicates that access is not granted to salesrep2: On the following chart, green indicates that access is granted to the user salesrep2, red indicates that access is not granted to salesrep2: On the following chart, green indicates that access is granted to the user salesrep2, red indicates that access is not granted to salesrep2:
The following figure shows access permissions of the users head-Accounting, accountant1, and accountant2. Green indicates that access is granted, red indicates that access is not granted: Chapter 5. Real World ExampleThis example is built around a small company with several departments. We first configure a basic security setup around the organizational structure of the company following some common sense rules. Later on we will look at a few improvements of the security configuration to implement more advanced access rules. The structure of this chapter is as follows: Sample OrganizationThis example is built around a small company structured as shown in the following organizational chart: The sales department (Sales) features a head of sales (head-sales) and 2 sales teams (SalesTeamA and SalesTeamB). Each sales team consists of 2 sales reps (e.g. SalesTeamA consists of sales-repA1 and sales-repA2). Similarly, there is an accounting department (Accounting) with a head of accounting (head-accounting) and an accountant who is the only member of the team AccountingTeam.The structure of the production department is identical to the structure of the accounting department. The company has a board (Board) with three members: ceo, cfo, and coo. Please note that the above organizational chart does not contain any security-related information, i.e. it does not tell us anything about permissions and such - an org chart is an org chart and nothing more when it comes to security (even though it is probably not wrong to assume that sales-repA1 should not be allowed to see any objects owned by the ceo unless the ceo has granted such permission explicitly). Before we get started with setting up security let us make a few assumptions about the desired "default security settings" of this organization (please note that the following "rules" really are assumptions, i.e. there is nothing in openCRX that would force you to adopt such rules; we just need a set of rules for the sake of this example enabling us to show how security-related rules can be implemented.):
Users and User GroupsLet us now move on to setting up a flexible security organization that allows us to handle/implement all of the above-mentioned rules. The following figure shows the 12 User Groups (blue box white font, e.g. Company, Board, Sales, SalesManagers, etc.) we are going to create. It also shows how we are going to assign Primary user groups to the 12 Users (blue font, e.g. ceo, cfo, coo, head-sales, etc.) we are going to create:
The proposed security organization does not cover/include the User admin-Standard, i.e. this User will not have any access to objects created by any of the 12 Users on the above security organization. Creating PrincipalsConnect to the root provider and login as admin-Root. Create the Principal ceo with the following steps:
If you inspect your newly created Principal ceo you should now see the following: Two important issues to verify are:
Please note that the values of the attributes User and Primary User Group will be assigned later (by executing the operation Create User). Now you can create the following Principals with the same steps (i.e. do not forget to make every Principal member of the Principal Group Users:
You have successfully created all the principals shown in Figure 5-2. Creating ContactsConnect to the standard provider and login as admin-Standard. Use the provider Accounts to create the following 12 Contacts, i.e. one Contact for each User:
To keep it simple, we only entered values into the field Last Name (e.g. the Contact ceo has the last name ceo) as shown in the following figure: Creating Local User GroupsNext we use the provider Security Users / Groups to create several Local User Groups (see also Figure 5-2 for an overview of the User Groups). It is sufficient to enter a reasonable value into the field Description; we typically enter the provider followed by the name, e.g. Standard\\Board or Standard\\Company, but feel free to develop/follow your own pattern. Create the following Local User Groups:
The following figure shows the grid Users / User Groups containing the newly created Local User Groups corresponding to Figure 5-2: Creating UsersNext we navigate to the provider User Homepages and use the Operation Actions | Create User. to create Users. The operation Create User allows us to set the following attributes:
The steps to create the User ceo are as follows:
The figure below shows the operation parameter panel just before clicking the button [OK]: In addition to the User ceo you also need to create 12 Users (in parenthesis you will find the Primary Owning Group you need to assign to the respective User); the Realm name is Default for all Users. You also need to use the lookup inspector to select the matching Contact):
The following figure shows the grid Users / User Groups containing the newly created Users: Back in the root provider (login as admin-Root) you can now inspect the previously created Principals and verify that the operation Create User indeed properly updated the fields User and Primary User Group. For example, if you inspect the Principal ceo you should now see the following: Two important issues to verify are:
Assigning Group MembershipsFinally, we need to assign Users to the appropriate User Groups. The following table shows for each User (left-most column) which User Group (top column) she/he is member of (the acronym PUG stands for Primary User Group; the "PUG membership" is defined at the time the User is created with the operation Create User - the same operation can be used to change the Primary User Group of a User): To add a particular User to a User Group, navigate to the provider Security Users / Groups, locate the respective User in the grid (e.g. Standard\\ceo) and load it into the inspector. Now you can use the lookup inspector of the grid Member of User Groups to locate the desired User Group and click on the respective checkbox. Back in the grid you can use the [+] button to add the User Group to the grid.
The following figure shows the User ceo with all the User Groups she/he is member of (the list must correspond to the row ceo of the matrix in Figure 5-9): Work yourself through the matrix Figure 5-9, i.e. for each User add the checked User Groups to the User's grid Member of User Groups.This completes the setup of the security structure as outline in Figure 5-2 and defined by the rules we assumed at the beginning of this example. Objects created by ceoLogin as User ceo and create a Contact. Navigate to the newly created contact and have a look at the security settings as shown in the figure below: The security settings of the newly created Contact are in line with the rules given in Security Setting of New Objects:
You can easily verify that the User ceo has full access (browse/delete/update) to this object. Let us now verify what the situation is like for other Users. To do so, you need to start a new browser and login - for example - as User cfo. As you will find out, the User cfo also has full access (browse/delete/update) to this Contact. We would not expect it to be any different because that is how we configured our security setup. The following table shows the permissions granted to each User: This corresponds exactly with our intentions as formulated in the section Sample Organization Grant full access to SalesLet us now assume that the User ceo decided to grant the sales department full access (browse/delete/update) to this Contact. This is achieved by adding the User Group Standard\\Sales to the list of Owning Groups of the Contact: You can easily verify that after this change the following Users have full access (browse/delete/update) to this object: ceo, cfo, coo, head-sales, sales-repA1, sales-repA2, sales-repB1, sales-repB2. The remaining users do not have permission to browse/delete/update this Contact.
Make Contact PrivateLet us now assume that the User ceo decided to keep this Contact private, i.e. nobody else is granted access. This is achieved by removing all User Groups from to the list of Owning Groups of the Contact: You can easily verify that, with the exception of the User ceo, no other User has permission to browse/delete/update the Contact. Objects created by sales-repA1Login as User sales-repA1 and create a Contact. Navigate to the newly created contact and have a look at the security settings as shown in the figure below: The security settings of the newly created Contact are in line with the rules given in Security Setting of New Objects:
You can easily verify that the User sales-repA1 has full access (browse/delete/update) to this object. Let us now verify what the situation is like for other Users. To do so, you need to start a new browser and login - for example - as User ceo. As you will find out, the User ceo also has full access (browse/delete/update) to this Contact. Similarly, full access (browse/delete/update) is granted to the other board members and the 2 Users head-sales and sales-repA2. Members of the User Group SalesTeamB are not granted access. Furthermore, our "Chinese walls" are firmly in place: User of the departments production and accounting are not granted access either. We would not expect it to be any different because that is how we configured our security setup. The following table shows the permissions granted for each User: This corresponds exactly with our intentions as formulated in the section Sample Organization Grant full access to SalesLet us now assume that the User sales-repA1 decided to grant the sales department full access (browse/delete/update) to this Contact. This is achieved by adding the User Group Standard\\Sales to the list of Owning Groups of the Contact: You can easily verify that after this change the two Users sales-repB1 and sales-repB2 are also granted full access (browse/delete/update) to this Contact. Selective Readonly SharingInstead of granting mutual full access, one could also imagine a regime where sales teams co-operate on a more selective basis by making some information available to the other sales team on a readonly basis. Hence, let us now assume that in addition to our original assumptions (see Sample Organization) the two sales teams SalesTeamA and SalesTeamB should have the possibility of easily sharing information on a readonly basis, i.e.
This feature request can easily be implemented with openCRX by adding two new User Groups Sales-super and Sales-readonly and then making the two User Groups Sales and Sales-readonly members of the new User Group Sales-super. The following figure shows the new security organization: To implement this change, login as admin-Standard and navigate to the provider Security Users / Groups. Create a new Local User Group Sales-super (enter Standard\\Sales-super into the field Description). Next you create a new Local User Group Sales-readonly (enter Standard\\Sales-readonly into the field Description) and load it into the inspector. In the grid Member of User Groups you can use the lookup inspector (click on the looking glass) to locate the Local User Group Sales-super. Click the checkbox to return to the grid and then click the [+] button to add Standard\\Sales. You should now see the following: Similarly, you also need to make the User Group Sales a member of the User Group Sales-super. To verify the new security configuration, logout and login as sales-repA1 to create a new Contact. The default security settings of this new Contact should correspond to the ones in the following figure: Neither sales-repB1 nor sales-repB2 have access to this Contact, while sales-repA2 has full access (browse/delete/update). Let us now try to share this contact with the SalesTeamB. Logout and login as sales-repA1 and navigate to the Contact you want to share. Click on the Tab [^] to see the Owning Groups. Use the lookup inspector to navigate to the User Group Standard\\Sales-readonly. Click on the checkbox to return to the grid and then click the button [+] to add the User Group to the list of Owning Groups. The security settings should correspond to the ones in the following figure: You can easily verify that in addition to the Users ceo, cfo, coo, head-sales, sales-repA1, and sales-repA2 being granted full access (browse/delete/update), the two Users sales-repB1 and sales-repB2 are now granted browse access (but delete/update access is not granted). This is exactly what we wanted to achieve. The following matrix summarizes permissions on the Contact created by sales-repA1 if the User Group Standard\\Sales-readonly is added to the list of Owning Groups:
One last twist: to remove delete/update access for sales-repA2 you could remove Standard\\SalesTeamA from the Contact's list of Owning Groups. This reduces permissions of the User sales-repA2 to browse access only; sales-repA1 is now the only sales rep which delete/update access. Co-operating Sales TeamsLet us now assume that at some point in time it is decided that in contrast to our original assumptions (see Sample Organization) the two sales teams SalesTeamA and SalesTeamB should be fully co-operating, i.e.
This change is easily accommodated with openCRX by making both User Groups SalesTeamA and SalesTeamB members of the User Group Sales. The following figure shows the new security organization: To implement this change, login as admin-Standard and navigate to the provider Security Users / Groups. Locate the Local User Group SalesTeamA and load it into the inspector. In the grid Member of User Groups you can use the lookup inspector (click on the looking glass) to locate the Local User Group Sales. Click the checkbox to return to the grid and then click the [+] button to add Standard\\Sales. You should now see the following: Similarly, make the User Group SalesTeamB a member of the User Group Sales. To verify the new security configuration, logout and login as sales-repA1 to create a new Contact. The default security settings should correspond to the ones in the following figure: You can easily verify that not only the Users ceo, cfo, coo, head-sales, sales-repA1, and sales-repA2 are granted full access (browse/delete/update), but the two Users sales-repB1 and sales-repB2 are also granted full access (browse/delete/update) to this Contact even though the User Group Standard\\Sales (or Standard\\SalesTeamB) was not explicitly added to the list of Owning Groups of the Contact (this is what we did in section Grant full access to Sales to grant access to the other sales team). The following matrix summarizes permissions on the Contact created by sales-repA1: Bibliography |
||||