Skip to end of metadata
Go to start of metadata

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

Compare with Current View Version History

« Previous Version 37 Next »

Note: There have been recent changes to the Permissions Editor that are reflected in this document. See #ACL Management for updates.

Protecting Action Sequences

In a software system, you can secure elements of that system at different levels, depending on your needs. In a web application, you can secure specific URLs. Deeper in the application you might want to secure specific service method calls. And finally, you might want to secure particular instances of objects. This page talks about the last type of security. Users of the Pentaho platform might wish to have a very precise level of control over objects in their solution repository. The Pentaho BI Platform provides this control.

Note: This page describes key security classes in the Pentaho BI Platform. Unless otherwise noted, these classes can be found in org.pentaho.platform.engine.security. Class packages will be omitted in the discussion below.

Security in the platform is based in part on the Acegi Security System for Spring. Classes that are part of Acegi Security are marked with Acegi.

SecurityHelper

SecurityHelper is an important class because it shields client code from the complexity of the security implementation (e.g. voters, ACL holders, etc). Below is a class diagram along with the two clients that use SecurityHelper for authorization purposes.

SecurityHelper along with its major clients

Access Control Lists

In the Pentaho BI Platform, objects in the solution repository (e.g. files and directories) can be secured using access control lists (ACLs). You can have any number of entries in an ACL--each specifying a different recipient.

ACL Entries

An entry in an access control list consists of a recipient, permissions, a reference to the object to which the ACL entry applies, and optionally the parent of the object to which the ACL entry applies. The default ACL entry type in Pentaho is PentahoAclEntry. This class extends AbstractBasicAclEntry Acegi.

Recipients

PentahoAclEntry stores a recipient as an Object. In practice, recipients can be of two types: a String containing a username or a GrantedAuthority containing a granted authority.

Permissions

PentahoAclEntry stores permissions using bit masks.

Objects and Parents

PentahoAclEntry stores an object (and its parent) as a AclObjectIdentity Acegi.

ACL Holders

An IAclHolder does exactly what its name implies--it holds or contains an access control list. An ACL is implemented in the platform using a java.util.List. Inside this list are implementations of AclEntry Acegi

IAclHolder Hierarchy


Solution Repository Objects

Once you have a container for an ACL, how is it associated with objects in the solution repository? That is where the interface IAclSolutionFile comes in. This interface extends IAclHolder and is implemented by com.pentaho.repository.dbbased.solution.RepositoryFile. RepositoryFile also implements AclObjectIdentity. So not only does a RepositoryFile store an ACL (since it implements IAclHolder), it also is a securable object (since it implements AclObjectIdentity).

Persistence

The Pentaho BI Platform uses Hibernate for reading and writing to the db-based repository. The PRO_FILES table contains solution repository objects while the PRO_ACLS_LIST table contains ACL entries associated with those objects. Below are (incomplete) listings of the columns of each of these tables.

PRO_FILES Table

FILE_ID

PARENT

FILENAME

FULLPATH

DATA

DIRECTORY

LASTMODIFIED

FILE_ID is the primary key. PARENT is a reference (by file id) to the object's parent. DIRECTORY is a boolean that is true if this object is a directory and false if this object is a file.

PRO_ACLS_LIST Table

ACL_ID

ACL_MASK

RECIPIENT

Technically, rows in this table represent ACL entries, not ACLs. An ACL for an object can be created by querying for all rows sharing the same ACL_ID. ACL_ID is a foreign key that references PRO_FILES.FILE_ID. ACL_MASK is the decimal representation of the bit mask that represents the permissions in this ACL entry. And RECIPIENT is the username or granted authority that is the recipient of this ACL entry.

Voters

For every domain object, there is exactly one access control list. Add to that a user that wants to perform some operation on that object and that adds up to three inputs: a recipient, an operation, and an ACL. But what makes the "access granted" or "access denied" decision given these three pieces of information? The answer to that question is an IAclVoter. An instance of IAclVoter contains an all-important hasAccess method. It takes the three aforementioned inputs and returns a boolean result: true meaning access granted and false meaning access denied. An ACL voter is a singleton; there is only one instance per Java virtual machine.

One might ask: How many ways can a voter arrive at a decision? Assume that user sally has the following granted authorities: ROLE_DEV and ROLE_MGR. Also assume that the ACL for a particular object contains the following entries: (sally, read), (ROLE_DEV, readwrite). Both ACL entries are applicable to sally since the first specifies sally (and she is sally) and the second specifies ROLE_DEV (and she has been granted the ROLE_DEV authority). Should the voter grant or deny a request to write to the object associated with this ACL? This is where extensibility of the voting system comes in. The Pentaho BI Platform provides multiple implementations of IAclVoter that each make different decisions in this situation! As the user of the platform, you decide how access decisions are made through your choice of IAclVoter. For more information about IAclVoter implementations, see 12. IAclVoter Node.

IAclVoter Hierarchy

ACL Management

Administrators can manage ACLs using a graphical interface available through the Admin menu. Once inside Admin, click Permissions to start the manager. To access the Permissions Editor, you must be logged in as an administrator to the platform. Also, ACLs are available only if you are using the RDBMS solution repository. This feature is not available for the file-based solution repository implementation.

Existing Repositories Behavior With the New Permissions

Before changes were introduced, the Admin Permissions UI exposed a set of permissions, allowing the administrator to set these permissions for individual domain objects. Note that there were three options: Execute, Subscribe and Write. How those three options map to the actual permissions in the platform is demonstrated below:

Subscribe

==>

Subscribe

Execute

==>

Execute

Write

==>

Create Update Delete Subscribe Execute

Now that the share action sequence (xaction) feature has been implemented, changes have been made to the Admin Permissions UI related to what permissions are "exposed" and how they are set. The new Permissions UI has the following set of permissions:

Subscribe

==>

Subscribe

Execute

==>

Execute

Update

==>

Update

Create

==>

Create

Delete

==>

Delete

Grant Permisions

==>

Grant Permissions

All

==>

Create Update Delete Subscribe Execute Grant Permissions ... All

Any domain object / user that was previously assigned the Write permission now has the Create, Update, Delete, Subscribe, and Execute permissions assigned. This effectively is the same access level they had previously, only displayed separately rather than through the combined permission of "Write."

By default, on startup of an existing repository with a platform that supports the share feature, no one will have Grant Permissions, so no one will be able to share. The Administrator must go through the Admin Permissions UI to grant the ability to share.

Permissions Editor

In the sample page above, the tree on the left represents all of the solution repository objects in your solution repository. You can set permissions on any level in the solution repository object tree. Setting permissions on lower level objects in the tree overrides permission settings higher in the tree. Conversely, if you set a permission on a solution repository object that has children, and the children do not have specific permissions set, they inherit the permissions settings from their parent. So, for example, if you set Execute permissions for JoeUser on the analysis object, then the query1.xaction object inherits that Execute permission; however, if you then set Create and Execute permission on the query1.xaction for JoeUser, these permissions are honored for that object, but other children of the analysis object would still only have their parent's (analysis) Execute permission.

For greater clarity, the following permissions now replace the Write permission: Subscribe, Update, Create, Delete, Manage, and All. When a user or role is assigned an "All" permission, every permission, those existing currently, and future permissions are granted. This creates a change when setting default ACLs. Default ACLs that are assigned all permissions now receive full control, including any future permissions. The Admin and cto roles are given all permissions.

The Execute permission allows the assigned user or role to edit the solution repository object, currently enforced through the platform client tools (Report Design Wizard, Report Designer and Cube Designer). Execute permission also allows the user or role to execute the solution repository object, applicable to action sequences.

Each solution repository object can have any number of permission-role or permission-user combinations set. The middle panel in the sample page above lists the access control list entries defined for the solution repository object selected in the tree. You can modify the permissions for the roles or users that are defined in the existing access control list entries:

  1. Next to the role or user you want a change to be applied, enable or disable the check box for the permission you want to grant or remove.
  2. Click Update... to submit the change.
  3. Click Reset to reverse changes that have not yet been submitted.

Follow the steps below to add a new access control list entry:

  1. Click Add under the access control list entry table. You see a new list appear on the right that lists all roles and users available to the system.
  2. Select the roles and/or users that you want to grant permissions to, and then select the permissions that you would like them to receive.
  3. Click Add at the bottom of the New Permission panel to add your newly defined access control list entries.

    Handy Hint

    If your organization has many users and/or you want to create ACL entries using roles only, you can increase performance by adjusting the settings contained in the access-ui node in pentaho.xml file.

ACL Publishing

The db-based solution repository is refreshed from the file system. In other words, solution repository objects are created as files on the filesystem and those objects are refreshed (published) in the db-based solution repository. In the files ystem, solution repository objects have no associated ACLs--at least as far as the platform is concerned. But once solution repository objects are published to the db-based repository, they do have associated ACLs. So how did the objects get their ACLs? The answer is an IAclPublisher. There is only one IAclPublisher instance per JVM and the type of that instance is specified in pentaho.xml. For more information about IAclPublisher implementations, see 13. IAclPublisher Node.

Note that an IAclPublisher is only responsible for the initial publishing of ACLs. After the file system is initially published, the Admin > Permissions interface should be used to tweak permissions.

  • No labels