LDAP security
To use Lightweight Directory Access Protocol (LDAP) for user security, you must switch from the default Pentaho security to LDAP, then you must configure LDAP.
Switch to LDAP
To connect to your LDAP server, you must import the certificate into the JRE's truststore/keystore used by the Pentaho Server (java/lib/security/cacerts
).
From the User Console Home menu, click Administration, then select Authentication from the left.
The Authentication interface appears. Local - Use basic Pentaho Authentication is selected by default.
Select the External - Use LDAP / Active Directory server option.
User console authentication set to external The LDAP Server Connection fields populate with a default URL, user name, and password.
Change the Server URL, User Name, and Password as needed.
Click Test Server Connection to verify the connection to your LDAP server and to complete the set up.
Click the node to select the Pentaho System Administrator user and role to match your LDAP configuration, then click OK.
Note: The Admin user is required for all system-related operations, including the creation of user folders. The Administrator Role is required for mapping a third-party admin role to the Pentaho admin role (Administrator).
Select your LDAP Provider from the drop-down menu.
Configure the LDAP connection as explained in LDAP properties.
Stop the Pentaho Server.
See the Install Pentaho Data Integration and Analytics document for instructions on starting and stopping the Pentaho Server.
Delete the
server/pentaho-server/pentaho-solutions/system/karaf/caches
folder.Restart the Pentaho Server and test the LDAP functionality.
See the Install Pentaho Data Integration and Analytics document for instructions on starting and stopping the Pentaho Server.
The Pentaho Server is now configured to authenticate users against your LDAP directory server.
Manual configuration
You must have a working LDAP server with an established configuration before continuing. Follow the instructions below to manually switch from Pentaho default security to LDAP security.
Stop the Pentaho Server.
Edit the
security.properties
file located in theserver/pentaho-server/pentaho-solutions/system
folder.Change provider=jackrabbit to provider=ldap
Save and close the file.
Edit the
server/pentaho-server/pentaho-solutions/system/applicationContext-security-ldap.properties
file.Modify the settings to match your LDAP configuration.
userSearch.searchBase=OU\=YourDomainCustomerCareUsers,DC\=YourDomainCustomerCare,DC\=com allAuthoritiesSearch.roleAttribute=cn allAuthoritiesSearch.searchBase=OU\=YourDomainCustomerCareGroups,DC\=YourDomainCustomerCare,DC\=com userSearch.searchFilter=(sAMAccountName\={0}) allUsernamesSearch.searchFilter=objectClass\=Person allAuthoritiesSearch.searchFilter= (objectClass\=group) providerType=ldapCustomConfiguration [email protected] populator.rolePrefix= allUsernamesSearch.searchBase=OU\=YourDomainCustomerCareUsers,DC\=YourDomainCustomerCare,DC\=com adminUser=CN\=YourAdminUserDN,OU\=OrlandoFL,OU\=NAMER,OU\=Support,OU\=YourDomainCustomerCareUsers,DC\=YourDomainCustomerCare,DC\=com adminRole=CN\=YourAdminRole,OU\=YourDomainCustomerCareGroups,DC\=YourDomainCustomerCare,DC\=com populator.groupSearchBase=OU\=YourDomainCustomerCareGroups,DC\=YourDomainCustomerCare,DC\=com populator.convertToUpperCase=false populator.searchSubtree=false allUsernamesSearch.usernameAttribute=sAMAccountName populator.groupRoleAttribute=cn contextSource.providerUrl=ldap\://10.100.7.17\:389 contextSource.password=******** populator.groupSearchFilter=(member\={0})
Save and close the file.
Edit the
server/pentaho-server/pentaho-solutions/system/repository.spring.properties
file.Replace admin in the following line:
singleTenanatAdminUserName=admin
with the value of the adminUser’ssAMAccountName as defined in theapplicationContext-security-ldap.properties
file.Save and close the file.
Delete the following directory:
server/pentaho-server/pentaho-solutions/system/jackrabbit/repository
CAUTION:
Do not delete the
repository.xml
file, which is also located in the following directory:server/pentaho-server/pentaho-solutions/system/jackrabbit
Delete the
server/pentaho-server/pentaho-solutions/system/karaf/caches
folder.Restart the Pentaho Server and test the LDAP functionality.
The Pentaho Server is now configured to authenticate users against your directory server. The LDAP properties reference article contains supplemental information for LDAP values.
Configure LDAP security caching
If you are using Lightweight Directory Access Protocol (LDAP) security for your Pentaho environment, the Pentaho Data Integration and Analytics products actively communicate with your LDAP server. Configuring Pentaho to cache access to your LDAP server could improve access speed for this active communication.
To configure Pentaho to cache LDAP security communication, you must update Pentaho spring security to initialize caching, associate the spring security caching with LDAP, then configure the properties of the cache. Perform the following steps to configure Pentaho for LDAP security caching.
Open the
pentaho-server/pentaho-solutions/system/applicationContext-spring-security-ldap.xml
file with a text editor.Change
authenticator
tocachingAuthenticator
andpopulator
tocachingPopulator
in theldapAuthenticationProvider
bean entry to initialize caching, as shown in the following example:<bean id="ldapAuthenticationProvider" class="org.pentaho.platform.plugin.services.security.userrole.ldap.DefaultLdapAuthenticationProvider"> <constructor-arg> <ref bean="cachingAuthenticator" /> </constructor-arg> <constructor-arg> <ref bean="cachingPopulator" /> </constructor-arg> <constructor-arg> <ref bean="ldapRoleMapper" /> </constructor-arg> </bean>
Verify the following
constructor
entries are commented out in theapplicationContext-spring-security-ldap.xml
file:<bean id="cachingAuthenticator" class="org.pentaho.platform.plugin.services.security.userrole.ldap.PentahoCachingLdapAuthenticator"> <constructor-arg ref="authenticator" /> <property name="cacheRegionName" value="ldapAuthenticatorCache" /> <property name="passwordHashMethod" value="SHA-256" /> </bean> <bean id="cachingPopulator" class="org.pentaho.platform.plugin.services.security.userrole.ldap.PentahoCachingLdapAuthoritiesPopulator"> <constructor-arg ref="populator" /> <property name="cacheRegionName" value="ldapPopulatorCache" /> </bean>
Uncomment the
constructor
entries or add them if they do not appear in theapplicationContext-spring-security-ldap.xml
file to associate the spring security caching with LDAP.Save and close the
applicationContext-spring-security-ldap.xml
file.Open the
pentaho-server/tomcat/webapp/WEB-INF/classes/ehcache.xml
file with a text editor.Verify the following
cache
entries are commented out in thepentaho-server/tomcat/webapp/WEB-INF/classes/ehcache.xml
file:<cache name="ldapPopulatorCache" maxEntriesLocalHeap="2000" eternal="false" overflowToDisk="false" timeToIdleSeconds="300" timeToLiveSeconds="600" diskPersistent="false"/> <cache name="ldapAuthenticatorCache" maxEntriesLocalHeap="2000" eternal="false" overflowToDisk="false" timeToIdleSeconds="300" timeToLiveSeconds="600" diskPersistent="false"/>
Uncomment the
cache
entries or add them if they do not appear in thepentaho-server/tomcat/webapp/WEB-INF/classes/ehcache.xml
file to configure the properties of the cache.Save and close the
applicationContext-spring-security-ldap.xml
file.
Your LDAP server connection to Pentaho Data Integration and Analytics is now cached.
Use nested roles
It is possible to nest user roles such that one role includes all of the users of another role. Doing this external to the core LDAP structure prevents recursive directory queries to find all parents of a given child role. Follow the directions below to modify the Pentaho Server to support nested roles for LDAP and MSAD authentication types.
Stop the Pentaho Server or service.
sh /usr/local/pentaho/server/pentaho-server/stop-pentaho.sh
Open the
/pentaho/server/pentaho-server/pentaho-solutions/system/applicationContext-spring-security-ldap.xml
file with a text editor.In the
populator
bean definition, replace DefaultLdapAuthoritiesPopulator with: NestedLdapAuthoritiesPopulator<bean id="populator" class="org.pentaho.platform.plugin.services.security.userrole.ldap.NestedLdapAuthoritiesPopulator">
Save the file, then edit
/pentaho/server/pentaho-server/pentaho-solutions/system/applicationContext-pentaho-security-ldap.xml
.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.
Add an
extraRoles
bean to the list of transformers in theChainedTransformers
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>
Save the file, close your text editor, and start the Pentaho Server.
sh /usr/local/pentaho/server/pentaho-server/start-pentaho.sh
The Pentaho Server can now handle nested roles with LDAP or Active Directory authentication.
LDAP properties
You can configure LDAP values by editing the /pentaho-solutions/system/applicationContext-security-ldap.properties
file in your Pentaho Server folder.
Connection information (context)
These entries define connections involving LDAP users (typically administrators) that can execute folder searches.
context.Source.providerUrl
LDAP connection URL
contextSource.providerUrl=ldap://holly:389/DC=Valyant,DC=local
contextSource.userDn
Distinguished name of a user with read access to directory
contextSource.userDn=CN= Administrator, CN=Users,DC=Valyant,DC=local
contextSource.password
Password for the specified user
contextSource.password=secret
Users
These options control how the LDAP server is searched for user names that are entered in the Pentaho login dialog box.
Note: The {0}
token will be replaced by the user name from the login dialog box.
Note: The example above defines DC=Valyant,DC=local
in contextSource.providerURL. Given that definition, you would not need to repeat that in userSearch.searchBase below because it will be appended automatically to the defined value here.
userSearch.searchBase
Base (by user name) for user searches
userSearch.searchBase=CN=Users
userSearch.searchFilter
Filter (by user name) for user searches. The attribute you specify here must contain the value that you want your users to log into Pentaho with. Active Directory user names are represented by sAMAccountName; full names are represented by displayName.
userSearch.searchFilter=(sAMAccountName={0})
Populator
The populator matches fully distinguished user names from userSearch to distinguished role names for roles those users belong to.
Note: The {0}
token will be replaced with the user DN found during a user search; the {1}
token is replaced with the user name entered in the login screen.
populator.convertToUpperCase
Indicates whether or not retrieved role names are converted to uppercase
populator.convertToUpperCase=false
populator.groupRoleAttribute
The attribute to get role names from
populator.groupRoleAttribute=cn
populator.groupSearchBase
Base (by user DN or user name) for role searches.
populator.groupSearchBase=ou= Pentaho
populator.groupSearchFilter
The special nested group filter for Active Directory is shown in the example; this will not work with non-MSAD directory servers.
populator.groupSearchFilter= (memberof:1.2.840.113556.1.4.1941: =({0}))
populator.rolePrefix
A prefix to add to the beginning of the role name found in the group role attribute; the value can be an empty string.
populator.rolePrefix=
populator.searchSubtree
Indicates whether or not the search must include the current object and all children. If set to false
, the search must include the current object only.
populator.searchSubtree=true
All authorities search
These entries populate the Pentaho Server Access Control List (ACL) roles. These should be similar or identical to the populator entries.
allAuthoritiesSearch.roleAttribute
The attribute used for role values
allAuthoritiesSearch.roleAttribute=cn
allAuthoritiesSearch.searchBase
Base for "all roles" searches
allAuthoritiesSearch.searchBase=ou= Pentaho
allAuthoritiesSearch.searchFilter
Filter for "all roles" searches. Active Directory requires that theobjectClass value be set to group.
allAuthoritiesSearch.searchFilter= (objectClass=group)
All user name search
These entries populate the Pentaho Server ACL users.
allUsernamesSearch.username Attribute
The attribute used for user values
allUsernamesSearch.username Attribute= sAMAccountName
allUsernamesSearch.searchBase
Base for "all users" searches
allUsernamesSearch.searchBase= CN=users
allUsernamesSearch.searchFilter
Filter for "all users" searches
allUsernamesSearch.searchFilter= objectClass=person
Last updated
Was this helpful?