The Pentaho BI Platform Security Guide
The Pentaho BI Platform Security Guide
This document is copyright 2011 Pentaho Corporation. No part may be reprinted without written permission from Pentaho Corporation. All trademarks are the property of their respective owners.
Trademarks
Pentaho (TM) and the Pentaho logo are registered trademarks of Pentaho Corporation. All other trademarks are the property of their respective owners. Trademarked names may appear throughout this document. Rather than list the names and entities that own the trademarks or insert a trademark symbol with each mention of the trademarked name, Pentaho states that it is using the names for editorial purposes only and to the benefit of the trademark owner, with no intention of infringing upon that trademark.
Company Information
Pentaho Corporation Citadel International, Suite 340 5950 Hazeltine National Drive Orlando, FL 32822 Phone: +1 407 812-OPEN (6736) Fax: +1 407 517-4575 http://www.pentaho.com E-mail: [email protected] Sales Inquiries: [email protected] Documentation Suggestions: [email protected] Sign-up for our newsletter: http://community.pentaho.com/newsletter/
Contents
Configuring Security.................................................................................................................. 5
Supported Technologies...............................................................................................................................5
Authorization............................................................................................................................16
Managing Users and Roles in the Pentaho Enterprise Console.................................................................16 Adding Users................................................................................................................................... 16 Editing User Information.................................................................................................................. 16 Deleting Users................................................................................................................................. 16 Adding Roles....................................................................................................................................17 Editing Roles....................................................................................................................................17 Deleting Roles..................................................................................................................................17 Assigning Users to Roles.................................................................................................................17 How to Change the Administrator Role............................................................................................18 Implementing Nested Roles in LDAP...............................................................................................18 Resetting or Creating a new Pentaho Enterprise Console User......................................................19 Adding Web Resource Authentication........................................................................................................ 20 Domain Object Authorization...................................................................................................................... 20 Reapplying the Default Access Control Lists..............................................................................................21 Configuring SQL Filters for Dashboards.....................................................................................................22 Assigning Data Source Permissions for the Pentaho User Console.......................................................... 23
Metadata Security....................................................................................................................32
Configuring the Security Service................................................................................................................ 32 Adding Column-Level Security Constraints................................................................................................ 32 Adding Global Row-Level Security Constraints.......................................................................................... 33 MQL Formula Syntax For Global Constraints.................................................................................. 33 Adding User or Role Row-Level Security Constraints................................................................................ 34 MQL Formula Syntax For User and Role Row-Level Constraints................................................... 35 Restricting Metadata Models to Specific Client Tools.................................................................................35
Using Security Information In Action Sequences.....................................................................37 Mondrian Role Mapping in the BI Server.................................................................................38
| TOC | 3
Removing Security...................................................................................................................39
Switching the Metadata Domain Repository...............................................................................................40 Switching to a File-Based Solution Repository........................................................................................... 40
Troubleshooting....................................................................................................................... 42
Increasing Security Log Levels in the BI Platform...................................................................................... 42 Enabling Extra LDAP Security Logging........................................................................................... 43 Log Output Analysis....................................................................................................................................44 Miscellaneous Troubleshooting Tips.......................................................................................................... 45
4 | | TOC
Configuring Security
This guide helps system administrators configure the Pentaho BI Platform to work with their existing security systems. The Pentaho BI Platform supports common user authentication and access/authorization technologies. All Pentaho administrators will have to establish users and roles that match their organizational hierarchy, but few will need to change the method of user authentication. To fully grasp the concepts and tasks involved in configuring security, you should be aware of a few technical terms: Authentication: The process of confirming that the user requesting access is the user that they claim to be. This is often done by presenting a user identifier (a username) paired with a secret known only to that user (a password), but can sometimes involve certificates or other means of establishing identity. In this documentation, authentication is synonymous with login. Authorization: The process of deciding if the authenticated user is allowed to access the information or functionality he is requesting. A software system can protect itself at multiple levels. In the Pentaho BI Platform, pages in the Web-based user interface can be protected. In addition, objects within the Pentaho solution repository, such as folders and action sequences, can be protected using access control lists (ACLs). Security backend: A repository of usernames, passwords, and roles. The repository can be a flat file, an RDBMS accessed via JDBC, or a directory server accessed via JNDI. Security data access object (DAO): A method of accessing the security backend. Examples of a security data access object are JDBC, Pentaho (Hibernate-based), and LDAP. (Both JDBC and Pentaho security data access objects talk to an RDMBS security backend, although they go about it in slightly different ways.)
Supported Technologies
The Pentaho BI Platform uses the Spring Security infrastructure, which can work with several common security backends: Flat file Active Directory, LDAP, or other directory server RDBMS (security tables in an existing database)
Pentaho's default security backend is an RDBMS, and its Hibernate-based security data access object is referred to as Pentaho. The security tables and access control lists are installed by default with the BI Platform, and can be easily configured through the Pentaho Enterprise Console's graphical user interface. This is a tested, reasonably secure method of managing resource authorization and user authentication, so there should be no reason to change to another security backend unless you've already deployed one. Note: Switching to a non-default security backend means that you will have to hand-edit some BI Platform configuration files in order to change the security data access object. It also means that you will be unable to use the Pentaho Enterprise Console to manage users and roles.
Step 3
Step 4
Step 10
Authentication
By default, the BI Platform establishes roles, users, and initializes a basic configuration for the built-in Pentaho security data access object. You will almost certainly want to customize the roles and delete or modify the default users and add your own; at most, you will want to use your own LDAP, JDBC, or CAS (single sign-on) authentication mechanism with the BI Platform. This section explains these tasks in detail. Note: Before you proceed with any instructions in this section, you should ensure that your BI Platform instance is working on a basic level. This initial verification will make it easier for you to retrace your steps later if you end up with a non-working configuration. You should also back up your BI Suite or BI Server directory (if you installed via the graphical installation utility, or unpacked pre-configured archive packages), or your Pentaho WAR, and your pentaho-solutions, and enterprise-console directories (if you built the Pentaho WAR and performed a manual deployment to an existing application server).
Pentaho (Default)
The Pentaho security data access object is a custom Hibernate-based user/password DAO that reads and writes usernames, passwords, and roles to a relational database via Hibernate object-relational mapping. You do not have to do anything to initialize the Pentaho data access object; it is enabled by default. However, you will almost certainly need to establish roles and users to match your organizational structure. Instructions for creating and modifying roles and users are in the Authorization subsection below.
Switching to LDAP
You must have a working directory server before continuing. Follow the below instructions to switch from the Pentaho data access object to LDAP. 1. Log onto the Pentaho Enterprise Console. 2. Configure the Pentaho LDAP connection by following the directions in the LDAP Configuration in the Pentaho Enterprise Console Utilities section. 3. Go to Configuration > Web Settings. 4. Under Authentication select LDAP Based from the drop-down list and click Submit. The BI Platform should restart automatically. The BI Platform is now configured to authenticate users against your directory server.
Binding MSAD allows you to uniquely specify users in two ways, in addition to the standard DN. If you're not having luck with the standard DN, try one of the two below. Each of the following examples is shown in the context of the userDn property of the Spring Security DefaultSpringSecurityContextSource bean. Note: The examples in this section use DefaultSpringSecurityContextSource. Be aware that you may need to use the same notation (Kerberos or Windows domain) in all of your DN patterns. Kerberos notation example for [email protected]:
File: applicationContext-security-ldap.properties contextSource.providerUrl=ldap\://mycompany\:389 [email protected] contextSource.password=omitted Windows domain notation example for MYCOMPANY\pentahoadmin: File: applicationContext-security-ldap.properties contextSource.providerUrl=ldap\://mycompany\:389 contextSource.userDn=MYCOMPANY\pentahoadmin contextSource.password=omitted Referrals If more than one Active Directory instance is serving directory information, it may be necessary to enable referral following. This is accomplished by modifying the DefaultSpringSecurityContextSource bean. <bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"> <constructor-arg value="${contextSource.providerUrl}"/> <property name="userDn" value="${contextSource.userDn}"/> <property name="password" value="${contextSource.password}"/> <property name="referral" value="follow" /> </bean> User DN Patterns vs. User Searches In the LdapAuthenticator implementations provided by Spring Security (BindAuthenticator for instance), you must either specify a userDnPatterns, or a userSearch, or both. If you're using the Kerberos or Windows domain notation, you should use userDnPatterns exclusively in your LdapAuthenticator. Note: The reason for suggesting userDnPatterns when using Kerberos or Windows domain notation is that the LdapUserSearch implementations do not give the control over the DN that userDnPatterns does. (The LdapUserSearch implementations try to derive the DN in the standard format, which might not work in Active Directory.) Note, however, that LdapUserDetailsService requires an LdapUserSearch for its constructor. User DN Pattern example: <bean id="authenticator" class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator"> <constructor-arg> <ref local="contextSource"/> </constructor-arg> <propertyname="userDnPatterns"> <list> <value>{0}@mycompany.com </value> <!-- and/or --> <value>domain\{0}</value> </list> </property> </bean> In user searches, the sAMAccountName attribute should be used as the username. The searchSubtree property (which influences the SearchControls) should most likely be true. Otherwise, it searches the specified base plus one level down. User Search example: <bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch"> <constructor-arg index="0" value="DC=mycompany,DC=com" /> <constructor-arg index="1"> <value>(sAMAccountName={0})</value> </constructor-arg> <constructor-arg index="2"> <ref local="contextSource" /> </constructor-arg> <property name="searchSubtree" value="true"/> 8 | Pentaho BI Suite Official Documentation | Authentication
</bean>
Directory Connection Property Name User DN Password Provider URL User Search Property Name Search Base Search Filter Description Base for user (by user name) searches ou=users Filter for user (by user name) (cn={0}) searches; the token {0} is replaced with the user name given at logon Example Value Description Distinguished name of user with read access to directory User password URL used to connect to directory Example Value uid=admin,ou=system secret ldap://localhost: 10389/ou=system
Authorities Search Property Name Role Attribute Roles Search Base Roles Search Filter Populator Property Name Convert to Upper Case Description Example Value Yes indicates that any retrieved role No names are converted to uppercase; No indicates no conversion The name of the attribute whose value cn is used as the role name Base for roles granted to a user (by ou=roles user DN or user name) searches. Filter for roles granted to a user (by (roleOccupant={0}) user DN or user name) searches. The token {0} is replaced with the user DN found during user search and the token {1} is replaced with the user name given at logon A prefix to concatenate to the n/a beginning of the role name found in the group role attribute; the value can be an empty string. Yes indicates that the search must No include the current object and all children; No indicates that the search must include the current object only. Description Example Value The name of the attribute whose value cn is used as the role name. Base for roles (all roles) search. ou=roles Filter for roles (all roles) search. (objectClass= organizationalRole)
Role Prefix
Search Subtree
Setting LDAP Property Values for the Pentaho Data Integration Server
Follow the instructions below to set LDAP-related property values for Pentaho Data Integration. Note: Important! LDAP-related property value settings in the Pentaho Enterprise Console are strictly for BI server support and cannot be used to manage LDAP for the Pentaho Data Integration server. 10 | Pentaho BI Suite Official Documentation | Authentication
1. Open the file, applicationContext-security-ldap.properties, located at ...\data-integration-server \pentaho-solutions\system. 2. Edit the file as needed. The property tables below provide you with sample values. Directory Connection Property Name contextSource.userDn contextSource. password contextSource. providerUrl User Search Property Name userSearch. searchBase userSearch. searchFilter Description Base for user (by user name) searches Filter for user (by user name) searches; the token {0} is replaced with the user name given at logon Example Value ou=users (cn={0}) Description Example Value Distinguished name of user with read uid=admin,ou=system access to directory User password secret URL used to connect to directory ldap://localhost: 10389/ou=system
Authorities Search Property Name Description allAuthoritiesSearch. roleAttribute The name of the attribute whose value is used as the role name. allAuthoritiesSearch. searchBase Base for roles (all roles) search. allAuthoritiesSearch. searchFilter Filter for roles (all roles) search. Populator Property Name populator.convertTo UpperCase Description True indicates that any retrieved role names are converted to uppercase; False indicates no conversion The name of the attribute whose value is used as the role name Base for roles granted to a user (by user DN or user name) searches. Filter for roles granted to a user (by user DN or user name) searches. The token {0} is replaced with the user DN found during user search and the token {1} is replaced with the user name given at logon A prefix to concatenate to the beginning of the role name found in the group role attribute; the value can be an empty string. True indicates that the search must include the current object and all children; False indicates that the search must include the current object only. Example Value False Example Value cn ou=roles (objectClass= organizationalRole)
cn ou=roles (roleOccupant={0})
populator.rolePrefix
n/a
populator.search Subtree
False
Switching to JDBC
You must have existing security tables in a relational database in order to proceed with this task. Pentaho BI Suite Official Documentation | Authentication | 11
Follow the below process to switch from the Pentaho data access object to the JDBC DAO that will allow you to use your own security tables. Note: If you choose to switch to a JDBC security data access object, you will no longer be able to use the role and user administration settings in the Pentaho Enterprise Console. 1. Stop the BI Platform server by running the stop-pentaho script. 2. Open the /pentaho-solutions/system/pentaho-spring-beans.xml file with a text editor. 3. Find the following two adjacent lines, and change the hibernate to JDBC in each: <import resource="applicationContext-spring-security-jdbc.xml" /> <import resource="applicationContext-pentaho-security-jdbc.xml" /> 4. Save the file and close the editor. 5. Open both of the above-mentioned files and verify that the SQL statements are the correct syntax for your database, and that they reference the correct tables, roles, and actions. 6. Start the BI Platform server by running the start-pentaho script. The BI Platform is now configured to authenticate users against the specified database.
Property cas.authn.provider
cas.base.url
Description Required. Security back-end that CAS should use. Valid values are memory, jdbc, or ldap Required. CAS login URL. Required. CAS ticket validator URL. Required. CAS logout URL. A service.logout.url will be appended to this URL. URL under which all CAS services reside.
Example ldap
https://localhost:8443/cas
Pentaho Properties These are service URLs that serve as callbacks from the CAS server into the BI Platform: Property pentaho.service.url pentaho.service.logout.url pentaho.service.solutions.system.dir pentaho.service.lib.dir pentaho.service.web.xml pentaho.service.appctx.cas.xml Description Required. Processes CAS callback. Required. URL to go to after CAS logout. Path to pentaho-solutions/system. Path to webapp lib directory. Path (including filename) of webapp's web.xml. Path (including filename) of new applicationContext-spring-securitycas.xml. Path to directory containing webapp's JSPs. Path (including filename) of pentahospring-beans.xml. Service base URL. Webapp exploded WAR directory. Path to webapp's WEB-INF directory. Example ${_pentaho.service.base.url}/ j_spring_cas_security_check ${_pentaho.service.base.url}/Home /usr/local/pentaho/server/biserver-ee/ pentaho-solutions/system/ /usr/local/tomcat/common/lib/ /usr/local/tomcat/conf/web.xml /usr/local/pentaho/server/biserveree/pentaho-solutions/system/ applicationContext-spring-securitycas.xml /usr/local/tomcat/webapps/pentaho/jsp/ /usr/local/pentaho/server/biserver-ee/ pentaho-solutions/system/pentahosping-beans.xml http://localhost:8080/pentaho /usr/local/tomcat/webapps/pentaho/ /usr/local/tomcat/webapps/pentaho/ WEB-INF/
pentaho.service.jsp.dir pentaho.service.spring.beans.xml
Follow the directions below to switch to Integrated Windows Authentication in the BI Server. 1. Stop the BI Server, DI Server, and Pentaho Enterprise Console processes. 2. In the IIS configuration, disable anonymous authentication and enable Windows authentication for the site you are serving. 3. Edit the /WEB-INF/web.xml file inside of the deployed Pentaho WAR, and change the value of fully-qualifiedserver-url to the URL served by IIS, then save and close the file.
4. Edit the /tomcat/conf/server.xml file and set tomcatAuthentication to false in the Connector element. tomcatAuthentication="false" 5. Change the filterChainProxy filters to this: httpSessionContextIntegrationFilter,httpSessionReuseDetectionFilter, logoutFilter,preAuthenticatedProcessingFilter, authenticationProcessingFilter,basicProcessingFilter, requestParameterProcessingFilter,anonymousProcessingFilter, securityContextHolderAwareRequestFilter, pentahoSecurityStartupFilter,exceptionTranslationFilter,filterInvocationInterceptor 6. Add the following two bean definitions:
<bean id="preAuthenticatedProcessingFilter" class="org.pentaho.platform.web.http.security.UsernameSubstringPreAuthenticatedProcessingF <property name="authenticationManager"> <ref local="authenticationManager" /> </property> <property name="regex" value=".+\\(.+)" /> </bean> <bean id="preAuthAuthenticationProvider"
class=org.springframework.security.providers.preauth.PreAuthenticatedAuthenticationProvide <property name="preAuthenticatedUserDetailsService"> <bean id="userDetailsServiceWrapper" class="org.springframework.security.userdetails.UserDetailsByNameServiceWrapper"> <property name="userDetailsService" ref="userDetailsService"/> </bean> </property> </bean> 7. Find the authenticationManager providers list and add this line to the beginning of it: <ref bean="preAuthAuthenticationProvider" /> 8. Replace the authenticationProcessingFilterEntryPoint bean definition with the following: <bean id="preAuthenticatedProcessingFilterEntryPoint"
class="org.springframework.security.ui.preauth.PreAuthenticatedProcessingFilterEntryPoint" > 9. Find the exceptionTranslationFilter bean and replace its authenticationEntryPoint ref with: <ref local="preAuthenticatedProcessingFilterEntryPoint" /> 10.Ensure that you have configured Active Directory integration properly. Refer to your Active Directory documentation and Microsoft Active Directory Configuration on page 7 for more information. 11.Save and close the server.xml file. 12.Configure Internet Explorer such that your IIS server is in the local intranet security zone. 13.Start the BI Server. 14.Access the BI Server through Internet Explorer and ensure that it automatically logs in with the local user account. Your system should now be configured to sign into the BI Server using local user account credentials.
5. In the Select User or Role window, click on the user or role you want to set permissions for, then click OK 6. In the Users and Roles list, click the user or role you want to set permissions for, then click the checkboxes in the Permissions list that you want to adjust. 7. Repeat the above steps as necessary for other users or roles. When you're finished, click OK The permissions actions you just performed will take effect the next time the specified users log into the Pentaho User Console. See also Domain Object Authorization.
Permissions Settings
Permission All Permissions Create Update Effect Assigns all permissions (explained below) to the specified user or role Allows a user or role to create reports, analysis views, and dashboards Allows a user or role to modify an existing report, analysis view, or dashboard Allows a user or role to execute or run any content in the solution repository (reports, analysis views, dashboards, but may also include links or other executable content) Allows a user or role to delete content from the solution repository Allows a user or role to share content with other Pentaho User Console users; essentially, this enables the Share tab in the Properties dialogue as shown in the screen shot below If a user or role has been given access to scheduling functions through the Pentaho Enterprise Console, then this setting in the Pentaho User Console will enable that user or role to arrange for reports or analysis views to be executed at given intervals
Execute
Schedule
Inheritance When assigned to a directory, all of the properties listed above will apply to files contained in that directory, including any subdirectories.
Authorization
The BI Platform regulates user- and role-level access to two types of resources: Web Resources and Domain Objects. Web Resources are URLs accessible from the Pentaho User Console; Domain Objects refer to files in the solution repository that make up your BI artifacts (reports, analysis views, dashboards, etc.). This section explains how to modify these access controls according to your preferences.
Adding Users
You must be logged into the Pentaho Enterprise Console as an administrator user. To add users in the Pentaho Enterprise Console, follow the directions below. 1. In the Pentaho Enterprise Console, go to the Administration section, then click the Users & Roles tab. 2. Click the Users icon to switch to Users mode. 3. Click the plus sign (+) next to Users. The Add Users dialog box appears. 4. In the Add Users dialog box, enter the new user's User Name, Password, Password Confirmation (the same password typed in a second time), and Description. 5. Click OK The specified user account is active, and will appear in the user list.
Deleting Users
You must be logged into the Pentaho Enterprise Console as an administrator user. To delete in the Pentaho Enterprise Console, follow the directions below. 1. In the Pentaho Enterprise Console, go to the Administration section, then click on the Users & Roles tab. 2. Select the user or users you want to delete from the Users list. Note: The user list Filter allows you to find specific users in the list. To find a user, type in the first few letters of the user's name in the text box, and a list of names matching your entry appears. 3. Click (Remove) next to Users. The Delete Users confirmation dialog box appears. 4. Click OK to delete the user(s) and refresh the user list
Adding Roles
You must be logged into the Pentaho Enterprise Console as an administrator user. To add roles in the Pentaho Enterprise Console, follow the directions below. 1. In the Pentaho Enterprise Console, go to the Administration section, then click the Users & Roles tab. 2. Click the Roles icon to switch to Roles mode. 3. Click the plus sign (+) next to Roles. The Add Role dialog box appears. 4. In the Add Role dialog box, enter the Role Name and Description. 5. Click OK The new role name appears in the list of roles. The specified role has been created and is ready to be associated with user accounts.
Editing Roles
You must be logged into the Pentaho Enterprise Console as an administrator user. To edit roles in the Pentaho Enterprise Console, follow the directions below. 1. In the Pentaho Enterprise Console, go to the Administration section, then click the Users & Roles tab. 2. Select the role you want to edit. Note: The user list Filter allows you to find specific users in the list. To find a user, type in the first few letters of the user's name in the text box, and a list of names matching your entry appears. 3. In the right pane of the Roles page, edit the role Description as needed. 4. Click Update. The changes have been applied to the specified role, and will be applied to each user in the group upon their next login.
Deleting Roles
You must be logged into the Pentaho Enterprise Console as an administrator user. To delete roles in the Pentaho Enterprise Console, follow the directions below. 1. In the Pentaho Enterprise Console, go to the Administration section, then click the Users & Roles tab. 2. Click the Roles icon if you are not in Roles mode. 3. Select the role or roles you want to delete from the Users list. Note: The user list Filter allows you to find specific users in the list. To find a user, type in the first few letters of the user's name in the text box, and a list of names matching your entry appears. 4. Click (Remove) next to Roles. The Delete Roles confirmation dialog box appears. 5. Click OK to delete the role(s) and refresh the roles list. The specified role has been deleted, and any user accounts that had been associated with it will no longer list this role.
The Assigned Users dialog box appears. 5. In the Assigned Users dialog box, click the arrows to move users in the list under Available to (and from) the Assigned list. 6. Click OK Users that have been assigned roles appear in Assigned Users box. The specified users are now applied to the specified roles. Alternatively, you can assign roles to users in Users mode using a similar process to the one documented above.
1. Open the /pentaho/server/biserver-ee/pentaho-solutions/system/pentaho.xml file with a text editor. 2. Find the <acl-voter> element, and replace its <admin-role> property with the new administrator role (NewAdmin in the examples in this procedure). <admin-role>NewAdmin</admin-role> 3. Find the <acl-publisher> element, and appropriately replace all instances of Admin in the properties inside of the <default-acls> and <overrides> elements. <acl-entry role="NewAdmin" acl="ADMIN_ALL" /> 4. Save the file, then open applicationContext-spring-security.xml 5. Find the filterInvocationInterceptor bean, and modify its objectDefinitionSource property accordingly. You may need to consult the Spring Security documentation to complete this step. The appropriate documentation is at http://static.springsource.org/spring-security/site/reference.html <property name="objectDefinitionSource"> <value> <![CDATA[ CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON ... \A/admin.*\Z=NewAdmin ... ]]> </value> </property> You have successfully changed the administrator role. In order for this change to take effect, you will have to Reapplying the Default Access Control Lists on page 21. This will also reset any administrator permissions you may have set in the Pentaho Enterprise Console.
This and the next step are only necessary if the roles that serve as "parents" to nested roles cannot be returned by a traditional all authorities search. 5. Add an extraRoles bean to the list of transformers in the ChainedTransformers bean, and set properties for each parent role (represented by example_role below). <bean id="allAuthoritiesSearch" class="org.pentaho.platform.plugin.services .security.userrole.ldap.search.GenericLdapSearch"> <!-- omitted --> <constructor-arg index="2"> <bean class="org.apache.commons.collections.functors.ChainedTransformer"> <constructor-arg index="0"> <list> <bean class="org.pentaho.platform.plugin.services.security. userrole.ldap.transform.SearchResultToAttrValueList"> <!-- omitted --> </bean> <bean class="org.pentaho.platform.plugin.services.security.userrole. ldap.transform.ExtraRoles"> <property name="extraRoles"> <set> <value>example_role</value> </set> </property> </bean> <bean class="org.pentaho.platform.plugin.services.security. userrole.ldap.transform.StringToGrantedAuthority"> <!-- omitted --> </bean> </list> </constructor-arg> </bean> </constructor-arg> </bean> 6. Save the file, close your text editor, and start the BI Platform server or service. sh /usr/local/pentaho/server/biserver-ee/start-pentaho.sh The BI Platform can now efficiently handle nested roles with LDAP or Active Directory authentication.
This password utility takes a plain text password as input and returns obfuscated and encrypted versions of the password using various algorithms. 3. Replace {username} with the user name you want to create or change. 4. Replace {password} with the password you want to generate for the user name that was just created or changed In the example below the user name is admin and the password that is being generated is password. Notice that the utility provides you with three different types of encrypted password options: OBF, MD5 and CRYPT. Use one of the options in the next step.
5. Edit the .\pentaho\server\enterprise-console\resource\config\login.properties file using the information generated by the password encryption utility:
Below is a description of the line in the login.properties file ({username}: {Encryption Type}:{password},{role1}): {username}: the user name used in the password utility in Step 2 {Encryption Type}: the encryption type you are using for your password (OBF, MD5 or CRYPT} {password}: the encrypted password that was generated using the utlity {role}: the role you want the user to have; there is single role, admin, and all users must be granted the admin role.
1. 2. 3. 4. 5.
Ensure that the BI Platform is not currently running; if it is, run the stop-pentaho script. Open a terminal or command prompt window and navigate to the .../pentaho-solutions/system/ directory. Edit the applicationContext-spring-security.xml file with a text editor. Find and examine the following property: <property name="objectDefinitionSource"> Modify the regex patterns to include your roles. The objectDefinitionSource property associates URL patterns with roles. RoleVoter specifies that if any role on the right hand side of the equals sign is granted to the user, the user may view any page that matches that URL pattern. The default roles in this file are not required; you can replace, delete, or change them in any way that suits you.
You should now have coarse-grained permissions established for user roles.
Note: Domain object authorization is only available for database-based solution repositories; file-based solution repositories (an uncommon situation among Pentaho BI Platform 2.x and 3.x deployments) cannot have this level of fine-grained authorization control. Note: ACLs are stored in the PRO_ACL_FILES table in the solution database, and have no presence in the filesystem. There is, however, a third type of domain object that does not store ACLs in that table -- a metadata model. Metadata models store access controls inline in the metadata model's XMI file. You can define other file extensions to control with access lists by editing the <acl-files> entry in the /pentaho-solutions/system/ pentaho.xml configuration file. See also, Assigning Permissions in the Pentaho User Console.
The default ACL will likely not meet your needs, so you may choose to reapply a different default ACL to solution repository objects. To do this, follow the steps below but understand that these steps will remove any ACL management that has been applied in the Pentaho User Console (image on the right). Follow the process below to reapply the default ACL in the Pentaho Enterprise Console. 1. 2. 3. 4. Log into the Pentaho Enterprise Console. Go to the Administration tab. Click Services. In the Solution Repository tab, click Restore.
The access control list will be reapplied with default values you specified.
3. Save your changes to the settings.xml file. 4. Restart the Pentaho User Console.
24 | Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server
6. Change back to the home directory of the user account that starts the BI Server and Pentaho Enterprise Console, and run this command: keytool -list -keystore .keystore 7. Compare the tomcat entry's MD5 sum to the one you generated previously and ensure that they match. If these sums do not match, you've made a mistake someplace in the certificate trust process. Go through the steps again and ensure that you're working with the right user accounts and directories. The BI Server is now configured to allow access via SSL. If you'd like to also enable SSL in the Pentaho Enterprise Console, continue on to Enabling SSL in the Pentaho Enterprise Console on page 25.
2. 3. 4. 5.
console.security.roles.delimeter=, console.security.realm.name=EnterpriseEdition console.security.login.module.name=PropertiesFileLoginModule console.security.auth.config.path=resource/config/login.conf Set console.ssl.enabled to true. Change the values of keystore and trustore appropriately. Change all of the passwords from the example value of changeit to the appropriate values. Change any other values to match your configuration.
The Pentaho Enterprise Console is configured to allow SSL connections. Starting the Pentaho Enterprise Console using SSL To start the console using SSL... 1. Make sure the server is up and running, then open a browser window and type: https://localhost:8143. If you are starting the Pentaho Enterprise Console in secure mode for the first time and you have a self-signed certificate, an error message appears. 2. Click the link labeled Or you can add an exception... 3. Click Add Exception. 4. Click Get Certificate. 5. Click View if you want to see the details of the certificate. 6. Click Confirm Security Exception if you are satisfied with the details of the certificate. You are now using an SSL-enabled console.
An example of each module is described in the sections that follow but first you must understand the relationship between password handling and LoginModules in the Pentaho Enterprise Console. Passwords can be stored in clear text, obfuscated, or checksummed. The class, org.mortbay.util.Password, must be used to generate all varieties of passwords, the output from which can be cut and pasted into property files or entered into database tables. Important: Before running org.mortbay.jetty.security.Password, you must change directory to enterpriseconsole. If you do not do a change directory the Jetty JARs will not be found. > cd enterprise-console > java -cp lib/jetty.jar org.mortbay.jetty.security.Password Usage - java org.mortbay.util.Password [<user>] <password> > java -cp lib/jetty.jar org.mortbay.jetty.security.Password me you you OBF:20771x1b206z MD5:639bae9ac6b3e1a84cebb7b403297b79 CRYPT:me/ks90E221EY JDBCLoginModule The JDBCLoginModule stores user passwords and roles in a database that are accessed through JDBC calls. You can configure the JDBC connection information, as well as the names of the table and columns storing the user name and credentials, and the name of the table and columns storing the roles. Below is an example login module configuration file entry for an HSQLDB driver: jdbc { org.mortbay.jetty.plus.jaas.spi.JDBCLoginModule required debug="true" 26 | Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server
dbUrl="jdbc:hsqldb:." dbUserName="sa" dbDriver="org.hsqldb.jdbcDriver" userTable="myusers" userField="myuser" credentialField="mypassword" userRoleTable="myuserroles" userRoleUserField="myuser" userRoleRoleField="myrole"; }; There is no particular schema required for the database tables storing the authentication and role information. The properties userTable, userField, credentialField, userRoleTable, userRoleUserField, userRoleRoleField configure the names of the tables and the columns within them that are used to format the following queries: select <credentialField> from <userTable> where <userField> =? select <userRoleRoleField> from <userRoleTable> where <userRoleUserField> =? Credential and role information is read from the database when a previously unauthenticated user requests authentication. Note that this information is only cached for the length of the authenticated session. When the user logs out or the session expires, the information is flushed from memory. Note: Passwords can be stored in the database in plain text or encoded formats, using the org.mortbay.jetty.security.Password class. PropertyFileLoginModule With this login module implementation, the authentication and role information is read from a property file: props { org.mortbay.jetty.plus.jaas.spi.PropertyFileLoginModule required debug="true" file="/somewhere/somefile.props"; }; The file parameter is the location of a properties file of the same format as the etc/realm.properties example file as shown below: <username>: <password>[<rolename> ...] Below is an example: admin: OBF:1xmk1w261u9r1w1c1xmq,user,admin superadmin: changeme,user,developer master: MD5:164c88b302622e17050af52c89945d44,user : CRYPT:adpexzg3FUZAk,admin The contents of the file are read and cached in memory the first time a user requests authentication. Editing Security Settings Security settings configuration are stored in the security section of console.properties file: # Management Server Enterprise Console's Jetty Server Settings console.start.port.number=8088 console.hostname=localhost console.stop.port.number=8033 # SSL Section for Enterprise Console console.ssl.enabled=false console.ssl.port.number=8143 keyAlias=jetty keyPassword=changeit keyStore=resource/config/keystore keyStorePassword=changeit trustStore=resource/config/keystore trustStorePassword=changeit wantClientAuth=false needClientAuth=false Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server | 27
# Security Authentication Section for Enterprise Console console.security.enabled=true console.security.roles.allowed=admin console.security.roles.delimiter=, console.security.realm.name=EnterpriseEdition console.security.login.module.name=PropertiesFileLoginModule console.security.auth.config.path=resource/config/login.conf Security is enabled by default. To change the roles you want to allow the application to access you must provide your list of roles in console.security.roles.allowed property. Roles are comma separated by default; you can change that configuration by providing your delimiter in console.security.roles.delimiter property. The login module name must be provided for the property name, console.security.login.module.name. This is the name you gave your login module in the login.conf file. You must provide the location of your login.conf file in console.security.auth.config.path property.
$ cd enterprise-console $ java -cp lib/jetty-6.1.2rc1.jar:lib/jetty-util-6.1.2rc1.jar org.mortbay.jetty.security.Password username password password OBF:1v2j1uum1xtv1zej1zer1xtn1uvk1v1v MD5:5f4dcc3b5aa765d61d8327deb882cf99 CRYPT:usjRS48E8ZADM For Windows use: $ cd enterprise-console $ java -cp lib/jetty-6.1.2rc1.jar;lib/jetty-util-6.1.2rc1.jar org.mortbay.jetty.security.Password username password 2. Go to ...\enterprise-console\resource\config and open the login.properties file. 3. Edit the file using the following format: <username>: OBF:<obfuscated_password>,<role1>,<role2>,<role3>,...
28 | Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server
The org.mortbay.jetty.plus.jaas.spi.AbstractLoginModule implements all of the javax.security.auth.spi.LoginModule methods. All you must do is implement the getUserInfo method to return a org.mortbay.jetty.plus.jaas.UserInfo instance that encapsulates the user name, password and role names (as {{java.lang.String}}s) for a user. Note: The AbstractLoginModule does not support caching. If you want to cache UserInfo (for example, as does the org.mortbay.jetty.plus.jaas.spi.PropertyFileLoginModule) you must provide it yourself.
# Should mod_jk send SSL information to Tomcat (default is On) JkExtractSSL On # What is the indicator for SSL (default is HTTPS) JkHTTPSIndicator HTTPS # What is the indicator for SSL session (default is SSL_SESSION_ID) JkSESSIONIndicator SSL_SESSION_ID # What is the indicator for client SSL cipher suit (default is SSL_CIPHER) JkCIPHERIndicator SSL_CIPHER # What is the indicator for the client SSL certificated (default is SSL_CLIENT_CERT) JkCERTSIndicator SSL_CLIENT_CERT # Where to put jk shared memory # Update this path to match your local state directory or logs directory JkShmFile /var/log/httpd/mod_jk.shm # Where to put jk logs # Update this path to match your logs directory location (put mod_jk.log next to access_log) JkLogFile /var/log/httpd/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # Send everything for context /examples to worker named worker1 (ajp13) # JkOptions indicates to send SSK KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications JkMount /pentaho/* tomcat_pentaho # Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly JkShmFile logs/jk.shm <VirtualHost example.com ServerName example.com JkMount /pentaho default JkMount /pentaho/* default JkMount /sw-style default JkMount /sw-style/* default JkMount /pentaho-style default JkMount /pentaho-style/* default </VirtualHost> 6. In your Apache configuration, ensure that SSL is enabled by uncommenting or adding and modifying the following lines: LoadModule ssl_module modules/mod_ssl.so Include conf/extra/httpd-ssl.conf 7. Save and close the file, then edit /conf/extra/httpd-ssl.conf and properly define the locations for your SSL certificate and key: SSLCertificateFile "conf/ssl/mycert.cert" SSLCertificateKeyFile "conf/ssl/mycert.key" 8. Ensure that your SSL engine options contain these entries: SSLOptions +StdEnvVars +ExportCertData 9. Add these lines to the end of the VirtualHost section: JkMount /pentaho default JkMount /pentaho/* default JkMount /sw-style default JkMount /sw-style/* default JkMount /pentaho-style default JkMount /pentaho-style/* default 10.Save and close the file, then create a workers.properties file in your Apache conf directory. If it already exists, merge it with the example configuration in the next step. 11.Copy the following text into the new workers.properties file, changing the location of Tomcat and Java, and the port numbers and IP addresses to match your configuration:
30 | Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server
workers.tomcat_home=/home/pentaho/pentaho/server/biserver-ee/tomcat/ workers.java_home=/home/pentaho/pentaho/java/ worker.list=tomcat_pentaho worker.tomcat_pentaho.type=ajp13 Apache httpd is now configured to securely and efficiently handle static content for Tomcat. You should now start Tomcat and httpd, then navigate to your domain name or hostname and verify that you can access the Pentaho Web application.
Pentaho BI Suite Official Documentation | Securing the Pentaho Enterprise Console and BI Server | 31
Metadata Security
Most of the security configuration explained thus far has involved using features that are built into the Pentaho User Console or Pentaho Enterprise Console, or involve configuration changes of some kind. However, if you need to restrict access to certain portions of data, the only way to do it is to modify your metadata. The Pentaho metadata model offers table-, column-, and row-level authorization control, so if you need to prevent certain users or roles from accessing it, you can edit the metadata model accordingly.
6.
7. 8. 9.
10.When you are finished, save the metadata configuration as a domain using the Save As button, then publish it to the BI Platform server as an XMI schema by selecting Publish from the File menu.
COALESCE
One or more
DATEMATH
One expression
NOW NOW()
DATE DATE(2008;4;15)
DATEVALUE DATEVALUE("2008-04-15")
CASE CASE( [BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "EuroCars"; "European Cars"; [BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "AsiaCars"; "Asian Cars"; "Unknown Cars" )
DATEMATH DATEMATH("0:ME -1:DS") This expression represents 00:00:00.000 on the day before the last day of the current month.
The Add New Property dialogue will appear. Select Data Constraints, then click OK. Click the new Data Constraints item in the General category. Select Role-Based Constraints option in the right pane. Click the green + icon next to the Selected Users/Groups field in the right pane. A list of users and/or roles (depending on what you selected when configuring the security service earlier) will appear. 7. Click the user or role in the left pane that you want to assign permissions to, then click the right arrow button in the middle of the window. The user or role will move from the Available list on the left to the Assigned list on the right. 8. Click the checkboxes for the permissions that you want to assign to the selected user or role. 9. Repeat this process for other users or roles you want to assign metadata permissions to, then click OK. 10.Change any other relevant metadata options, then click OK to return to the Metadata Editor main window. 11.When you are finished, save the metadata configuration as a domain using the Save As button, then publish it to the BI Platform server as an XMI schema by selecting Publish from the File menu. 3. 4. 5. 6.
1. Start Metadata Editor and open the metadata model you want to restrict. 2. Right-click on the business model, then select Edit from the context menu. The Business Model Properties window will appear. 3. Click the round green + icon to add a new custom property. The Add New Property window will appear. 4. Click Add a custom property, then type visible in the ID field and select String from the Type drop-down box, then click OK. You'll return to the Business Model Properties window. 5. Scroll down to the bottom of the window to see the Value field. Type in one or more of the following restriction values, separated by commas, then click OK: adhoc: removes the model from the list in ad hoc reporting dashboard-filters: prevents this model from appearing in dashboard filters that use metadata queries dashboard-content: prevents this model from being used in dashboard panels interactive-reporting: removes the model from the list in Interactive Reporting Pentaho BI Suite Official Documentation | Metadata Security | 35
manage: removes this model from the "manage data sources" feature of the Pentaho User Console Note: If you leave the Value field blank, the published model will not appear in any Pentaho User Console tools.
6. Re-publish this model to the BI Server. 7. If the BI Server is currently running, restart it. The restrictions you defined should now be in place.
systemUserNames
string-list
The following input section will get the list of the user's roles, and make it available to all the actions in the action sequence: <inputs> <principalRoles type="string-list"> <sources> <security>principalRoles</security> </sources> </principalRoles> </inputs>
The Mondrian-One-To-One-UserRoleMapper
This Mondrian user/role mapper assumes that roles in the BI platform also exist in Mondrian; for example if you have a role called "CTO" in Mondrian and in the BI platform. The Mondrian-One-To-One-UserRoleMapper maps each role in the platform to roles defined in the Mondrian schema by name. <bean id="Mondrian-UserRoleMapper" name="Mondrian-One-To-One-UserRoleMapper" class="org.pentaho.platform.plugin.action.mondrian.mapper. MondrianOneToOneUserRoleListMapper" scope="singleton" />
The Mondrian-SampleLookupMap-UserRoleMapper
This sample mapper assumes that a translator is needed (in the form of a map) to map a BI platform role to a Mondrian role. So the map provides the lookups needed for each role. The lookups take the form of Key = BI platform role, Value = mondrian role. In the sample below, there is a "ceo" role in the BI platform which maps to the "California manager" role in Mondrian. <bean id="Mondrian-UserRoleMapper" name="Mondrian-SampleLookupMap-UserRoleMapper" class="org.pentaho.platform.plugin.action.mondrian.mapper. MondrianLookupMapUserRoleListMapper" scope="singleton"> <property name="lookupMap"> <map> <entry key="ceo" value="California manager" /> <entry key="cto" value="M_CTO" /> <entry key="dev" value="M_DEV" /> </map> </property> </bean>
The Mondrian-SampleUserSession-UserRoleMapper
This sample mapper assumes that all users have Mondrian roles in their session under a named session variable. <bean id="Mondrian-UserRoleMapper" name="Mondrian-SampleUserSession-UserRoleMapper" class="org.pentaho.platform.plugin.action.mondrian.mapper. MondrianUserSessionUserRoleListMapper" scope="singleton"> <property name="sessionProperty" value="MondrianUserRoles" /> </bean>
Removing Security
You cannot remove the security mechanisms built into the BI Platform, but you can bypass them by giving all permissions to anonymous users. The BI Server automatically assigns all unauthenticated users to the anonymousUser account and the Anonymous role. The procedure below will grant full BI Server access to the Anonymous role, thereby never requiring a login. Danger: This process is irreversible! While you can simply back out any configuration file changes you may make, you cannot restore custom ACLs once they've been wiped out; the best you can do is restore the default ACLs and make all of your custom authorization changes by hand again. Before performing the below procedure, you should have a very good reason for bypassing security. 1. Stop the BI Server. sudo /etc/init.d/pentaho stop 2. Open the /pentaho/server/biserver-ee/pentaho-solutions/system/applicationContextspring-security.xml file with a text editor and ensure that a default anonymous role is defined. You may have changed this role, or it may not be properly defined for some other reason. Match your bean definition and property value to the example below. The username does not matter in this particular bean; only the role name. <bean id="anonymousProcessingFilter" class="org.springframework.security.providers.anonymous.AnonymousProcessingFilter"> <!-- omitted --> <property name="userAttribute" value="anonymousUser,Anonymous" /> </bean> 3. Now find the filterSecurityInterceptor bean in the same file, and the objectDefinitionSource property inside of it, and match its contents to the example below: This step allows Pentaho client tools to publish to the BI Platform without having to supply a username and password. <bean id="filterInvocationInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor"> <property name="authenticationManager"> <ref local="authenticationManager" /> </property> <property name="accessDecisionManager"> <ref local="httpRequestAccessDecisionManager" /> </property> <property name="objectDefinitionSource"> <value> <![CDATA[ CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON\A/.* \Z=Anonymous,Authenticated ]]> </value> </property> </bean> 4. Save the file, then open pentahoObjects-spring.xml in the same directory. 5. Change the IAclVoter class to PentahoAllowAnonymousAclVoter <beans> <!-- omitted --> <bean id="IAclVoter" class="org.pentaho.platform.engine.security.acls .voter.PentahoAllowAnonymousAclVoter" scope="singleton" /> <!-- omitted --> </beans> 6. Save the file, then open pentaho.xml in the same directory. 7. In the <anonymous-authentication> part of the <pentaho-system> section, define the anonymous user and role. This is the same user and role you will use when assigning ACLs in the next step. <pentaho-system> <!-- omitted --> <anonymous-authentication> <anonymous-user>anonymousUser</anonymous-user> <anonymous-role>Anonymous</anonymous-role> </anonymous-authentication> <!-- omitted --> </pentaho-system>
8. Using the same anonymous user and role from before, adjust the ACLs accordingly and remove all ACL overrides. <pentaho-system> <!-- omitted --> <acl-publisher> <default-acls> <acl-entry role="Anonymous" acl="ADMIN_ALL" /> <acl-entry role="Authenticated" acl="ADMIN_ALL" /> </default-acls> <!-- remove any active overrides entries --> </acl-publisher> <!-- omitted --> </pentaho-system> 9. Adjust the <acl-voter> properties such that the new anonymous user has administrator privileges. <pentaho-system> <!-- omitted --> <acl-voter> <admin-role>Anonymous</admin-role> </acl-voter> <!-- omitted --> </pentaho-system> 10.Save the file and close the text editor. You've now effectively worked around the security features of the BI Platform. You should now follow the procedures below to remove the security awareness from the metadata domain repository, and switch from a database repository to a file repository; database repositories are only advantageous when you need to assign ACLs to certain resources. Since you no longer need to do that, you can eliminate your solution database to remove the last piece of BI Platform authorization security.
<!-- <bean id="IMetadataDomainRepository" class="org.pentaho.platform.plugin.services.metadata.SecurityAwareMetadataDomainRepository scope="singleton"/> --> <!-- Use this schema factory to disable PMD security --> <bean id="IMetadataDomainRepository" class="org.pentaho.platform.plugin.services.metadata.MetadataDomainRepository" scope="singleton"/> 3. Save and close the file. You've now switched the metadata domain repository to one that is not security-aware. Access controls will no longer be enforced on various metadata objects. You should now continue on to Switching to a File-Based Solution Repository on page 40.
1. Edit the /pentaho-solutions/system/pentahoObjects.spring.xml file. 2. Comment out the current ISolutionRepository line, and uncomment the similar line above it. Alternatively, you can switch the value of ISolutionRepository from org.pentaho.platform.repository.solution.dbbased.DbBasedSolutionRepository to org.pentaho.platform.repository.solution.filebased.FileBasedSolutionRepository. <!-- Uncomment the following line to use a filesystem-based repository. Note: does not support ACLs. --> <bean id="ISolutionRepository" class="org.pentaho.platform.repository.solution.filebased.FileBasedSolutionRepository" scope="session" /> <!-- Uncomment the following line to use a filesystem/db-based repository with meta information stored in a db --> <!-- <bean id="ISolutionRepository" class="org.pentaho.platform.repository.solution.dbbased.DbBasedSolutionRepository" scope="session" /> --> 3. Comment out the IMetadataDomainRepository line, and uncomment the similar line below it. Alternatively, you can switch the value of IMetadataDomainRepository from org.pentaho.platform.plugin.services.metadata.SecurityAwareMetadataDomainRepository to org.pentaho.platform.plugin.services.metadata.MetadataDomainRepository.
<!-- <bean id="IMetadataDomainRepository" class="org.pentaho.platform.plugin.services.metadata.SecurityAwareMetadataDomainRepository scope="singleton"/> --> <!-- Use this schema factory to disable PMD security --> <bean id="IMetadataDomainRepository" class="org.pentaho.platform.plugin.services.metadata.MetadataDomainRepository" scope="singleton"/> 4. Save and close the file. You've now switched over to a file-based solution repository. You can safely restart your BI Server and Pentaho Enterprise Console server.
Troubleshooting
Adjusting authorization and authentication settings will often involve making multiple configuration changes without the benefit of testing each of them individually. Your first attempt at implementing a different security DAO or performing intensive user and role modifications will probably not work perfectly. Below are some tips for adjusting log file output, and examining logs for signs of configuration errors.