Configuring External Authentication and Authorization for Cloudera Manager
Required Role: Full Administrator
Cloudera Manager supports user authentication against an internal database and against an external service. The following sections describe how to configure the supported external services.
Configuring Authentication Using Active Directory
- Log in to Cloudera Manager Admin Console.
- Select .
- Select External Authentication for the Category filter to display the settings.
- For Authentication Backend Order, select the order in which Cloudera Manager should look up authentication credentials for login attempts.
- For External Authentication Type, select Active Directory.
- In the LDAP URL property, provide the URL of the Active Directory server.
- In the Active Directory Domain property, provide the domain to authenticate against.
LDAP URL and Active Directory are the only settings required to allow anyone in Active Directory to log in to Cloudera Manager.
For example, if you set LDAP URL to ldap://adserver.example.com and the Active Directory Domain to ADREALM.EXAMPLE.COM, users can log into Cloudera Manager using just their username, such as sampleuser. They no longer require the complete string: sampleuser@ADREALM.EXAMPLE.COM.
- Restart the Cloudera Manager Server.
After you configure authentication for Cloudera Manager, configure authorization for the authenticated users. This is done by mapping the authenticated users to Cloudera Manager user roles. For more information, see Cloudera Manager User Roles.
Configuring Authentication Using an LDAP-compliant Identity Service
- Use a single Distinguished Name (DN) as a base and provide a pattern (Distinguished Name Pattern) for matching user names in the directory, or
- Search filter options let you search for a particular user based on somewhat broader search criteria – for example Cloudera Manager users could be members of different groups or organizational units (OUs), so a single pattern does not find all those users. Search filter options also let you find all the groups to which a user belongs, to help determine if that user should have login or admin access.
- Log in to Cloudera Manager Admin Console.
- Select .
- Select External Authentication for the Category filter to display the settings.
- For Authentication Backend Order, select the order in which Cloudera Manager should look up authentication credentials for login attempts.
- For External Authentication Type, select LDAP.
- In the LDAP URL property, provide the URL of the LDAP server and (optionally) the base Distinguished Name (DN) (the search base) as part of the URL — for example ldap://ldap-server.corp.com/dc=corp,dc=com.
- If your server does not allow anonymous binding, provide the user DN and password to be used to bind to the directory. These are the LDAP Bind User Distinguished Name and LDAP Bind Password properties. By default, Cloudera Manager assumes anonymous binding.
- Use one of the following methods to search for users and groups:
- You can search using User or Group search filters, using the LDAP User Search Base, LDAP User Search Filter, LDAP Group Search Base and LDAP Group Search Filter settings. These allow you to combine a base DN with a search filter to allow a greater range of
search targets.
For example, if you want to authenticate users who may be in one of multiple OUs, the search filter mechanism will allow this. You can specify the User Search Base DN as dc=corp,dc=com and the user search filter as uid={0}. Then Cloudera Manager will search for the user anywhere in the tree starting from the Base DN. Suppose you have two OUs—ou=Engineering and ou=Operations—Cloudera Manager will find User "foo" if it exists in either of these OUs, that is, uid=foo,ou=Engineering,dc=corp,dc=com or uid=foo,ou=Operations,dc=corp,dc=com.
You can use a user search filter along with a DN pattern, so that the search filter provides a fallback if the DN pattern search fails.
The Groups filters let you search to determine if a DN or username is a member of a target group. In this case, the filter you provide can be something like member={0} where {0} will be replaced with the DN of the user you are authenticating. For a filter requiring the username, {1} may be used, as memberUid={1}. This will return a list of groups the user belongs to, which will be compared to the list in the group properties discussed in
- Alternatively, specify a single base Distinguished Name (DN) and then provide a "Distinguished Name Pattern" in the LDAP Distinguished Name Pattern
property.
Use {0} in the pattern to indicate where the username should go. For example, to search for a distinguished name where the uid attribute is the username, you might provide a pattern similar to uid={0},ou=People,dc=corp,dc=com. Cloudera Manager substitutes the name provided at login into this pattern and performs a search for that specific user. So if a user provides the username "foo" at the Cloudera Manager login page, Cloudera Manager will search for the DN uid=foo,ou=People,dc=corp,dc=com.
If you provided a base DN along with the URL, the pattern only needs to specify the rest of the DN pattern. For example, if the URL you provide is ldap://ldap-server.corp.com/dc=corp,dc=com, and the pattern is uid={0},ou=People, then the search DN will be uid=foo,ou=People,dc=corp,dc=com.
- You can search using User or Group search filters, using the LDAP User Search Base, LDAP User Search Filter, LDAP Group Search Base and LDAP Group Search Filter settings. These allow you to combine a base DN with a search filter to allow a greater range of
search targets.
- Restart the Cloudera Manager Server.
Configuring Cloudera Manager to Use LDAPS
- Copy the CA certificate file to the Cloudera Manager Server host.
- Import the CA certificate(s) from the CA certificate file to the local truststore. The default truststore is located in the $JAVA_HOME/jre/lib/security/cacerts file. This contains the default CA information shipped with the JDK. Create an alternate default file called jssecacerts in the same location as the cacerts file. You can now safely append CA certificates for any private or public CAs not present in the
default cacerts file, while keeping the original file intact.
For our example, we will follow this recommendation by copying the default cacerts file into the new jssecacerts file, and then importing the CA certificate to this alternate truststore.
cp $JAVA_HOME/jre/lib/security/cacerts $JAVA_HOME/jre/lib/security/jssecacerts
$ /usr/java/latest/bin/keytool -import -alias nt_domain_name -keystore /usr/java/latest/jre/lib/security/jssecacerts -file path_to_CA_cert
Alternatively, you can use the Java options: javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword. Open the /etc/default/cloudera-scm-server file and add the following options:
export CMF_JAVA_OPTS="-Xmx2G -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djavax.net.ssl.trustStore=/usr/java/default/jre/lib/security/jssecacerts -Djavax.net.ssl.trustStorePassword=changeit"
- Configure the LDAP URL property to use ldaps://ldap_server instead of ldap://ldap_server.
- Restart the Cloudera Manager Server.
Configuring Authentication Using an External Program
Cloudera Manager can use a custom external authentication program,. Typically, this may be a custom script that interacts with a custom authentication service. Cloudera Manager will call the external program with the username as the first command line argument. The password is passed over stdin. Each positive value exit code can be mapped to Cloudera Manager user roles. A negative value is returned for failure to authenticate. Valid values for the exit code are between 0 and 127.
and a negative value is returned for a failure to authenticate.
- Log in to Cloudera Manager Admin Console.
- Select .
- Select External Authentication for the Category filter to display the settings.
- For External Authentication Type, select External Program.
- Provide a path to the external program in the External Authentication Program Path property.
After you configure authentication for Cloudera Manager, configure authorization for the authenticated users. This is done by mapping the authenticated users to Cloudera Manager user roles. For more information, see Cloudera Manager User Roles.
Configuring Authentication Using SAML
Cloudera Manager supports the Security Assertion Markup Language (SAML), an XML-based open standard data format for exchanging authentication and authorization data between parties, in particular, between an identity provider (IDP) and a service provider (SP). The SAML specification defines three roles: the principal (typically a user), the IDP, and the SP. In the use case addressed by SAML, the principal (user agent) requests a service from the service provider. The service provider requests and obtains an identity assertion from the IDP. On the basis of this assertion, the SP can make an access control decision—in other words it can decide whether to perform some service for the connected principal.
The primary SAML use case is called web browser single sign-on (SSO). A user wielding a user agent (usually a web browser) requests a web resource protected by a SAML SP. The SP, wanting to know the identity of the requesting user, issues an authentication request to a SAML IDP through the user agent. In the context of this terminology, Cloudera Manager operates as a SP. This topic discusses the Cloudera Manager part of the configuration process; it assumes that you are familiar with SAML and SAML configuration in a general sense, and that you have a functioning IDP already deployed.
Setting up Cloudera Manager to use SAML requires the following steps.
Preparing Files
- A Java keystore containing a private key for Cloudera Manager to use to sign/encrypt SAML messages. For guidance on creating Java keystores, see Understanding Keystores and Truststores.
- The SAML metadata XML file from your IDP. This file must contain the public certificates needed to verify the sign/encrypt key used by your IDP per the SAML Metadata Interoperability Profile. For example, if you are using the Shibboleth IdP, the metadata file is available at: https://<IdPHOST>:8080/idp/shibboleth.
- The entity ID that should be used to identify the Cloudera Manager instance
- How the user ID is passed in the SAML authentication response:
- As an attribute. If so, what identifier is used.
- As the NameID.
- The method by which the Cloudera Manager role will be established:
- From an attribute in the authentication response:
- What identifier will be used for the attribute
- What values will be passed to indicate each role
- From an external script that will be called for each use:
- The script takes user ID as $1
- The script sets an exit code to reflect successful authentication. Valid values for the exit codes are between 0 and 127, and a negative value is returned for a failure to authenticate. These values are used in Cloudera Manager to map authenticated users to user roles within Cloudera Manager.
- From an attribute in the authentication response:
Configuring Cloudera Manager
- Log in to Cloudera Manager Admin Console.
- Select .
- Select External Authentication for the Category filter to display the settings.
- Set the External Authentication Type property to SAML (the Authentication Backend Order property is ignored for SAML).
- Set the Path to SAML IDP Metadata File property to point to the IDP metadata file.
- Set the Path to SAML Keystore File property to point to the Java keystore prepared earlier.
- In the SAML Keystore Password property, set the keystore password.
- In the Alias of SAML Sign/Encrypt Private Key property, set the alias used to identify the private key for Cloudera Manager to use.
- In the SAML Sign/Encrypt Private Key Password property, set the private key password.
- Set the SAML Entity ID property if:
- There is more than one Cloudera Manager instance being used with the same IDP (each instance needs a different entity ID).
- Entity IDs are assigned by organizational policy.
- In the Source of User ID in SAML Response property, set whether the user ID will be obtained from an attribute or the NameID.
If an attribute will be used, set the attribute name in the SAML attribute identifier for user ID property. The default value is the normal OID used for user IDs and so may not need to be changed.
- In the SAML Role assignment mechanism property, set whether the role assignment will be done from an attribute or an external script.
- If an attribute will be used:
- In the SAML attribute identifier for user role property, set the attribute name if necessary. The default value is the normal OID used for OrganizationalUnits and so may not need to be changed.
- If an external script will be used, set the path to that script in the Path to SAML Role Assignment Script property. Make sure that the script is executable (an executable binary is fine - it does not need to be a shell script).
- If an attribute will be used:
- Save the changes. Cloudera Manager will run a set of validations that ensure it can find the metadata XML and the keystore, and that the passwords are correct. If you see a validation error, correct the problem before proceeding.
- Restart the Cloudera Manager Server.
After you configure authentication for Cloudera Manager, configure authorization for the authenticated users. This is done by mapping the authenticated users to Cloudera Manager user roles. For more information, see Cloudera Manager User Roles.
Configuring the IDP
- Download the Cloudera Manager’s SAML metadata XML file from http://hostname:7180/saml/metadata.
- Inspect the metadata file and ensure that any URLs contained in the file can be resolved by users’ web browsers. The IDP will redirect web browsers to these URLs at various points in the process. If the browser cannot resolve them, authentication will fail. If the URLs are incorrect, you can manually fix the XML file or set the Entity Base URL in the CM configuration to the right value, and then re-download the file.
- Provide this metadata file to your IDP using whatever mechanism your IDP provides.
- Ensure that the IDP has access to whatever public certificates are necessary to validate the private key that was provided to Cloudera Manager earlier.
- Ensure that the IDP is configured to provide the User ID and Role using the attribute names that Cloudera Manager was configured to expect, if relevant.
- Ensure the changes to the IDP configuration have taken effect (a restart may be necessary).
Verifying Authentication and Authorization
- Return to the Cloudera Manager Admin Console and refresh the login page.
- Attempt to log in with credentials for a user that is entitled. The authentication should complete and you should see the tab.
- If authentication fails, you will see an IDP provided error message. Cloudera Manager is not involved in this part of the process, and you must ensure the IDP is working correctly to complete the authentication.
- If authentication succeeds but the user is not authorized to use Cloudera Manager, they will be taken to an error page by Cloudera Manager that explains the situation. If an user who should be authorized sees this error, then you will need to verify their role configuration, and ensure that it is being properly communicated to Cloudera Manager, whether by attribute or external script. The Cloudera Manager log will provide details on failures to establish a user’s role. If any errors occur during role mapping, Cloudera Manager will assume the user is unauthorized.