Member since
04-09-2019
254
Posts
140
Kudos Received
34
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2089 | 05-22-2018 08:32 PM | |
14282 | 03-15-2018 02:28 AM | |
3802 | 08-07-2017 07:23 PM | |
4596 | 07-27-2017 05:22 PM | |
2595 | 07-27-2017 05:16 PM |
12-08-2016
06:26 PM
8 Kudos
This article applies to HDP 2.5.x and below. For HDP 2.6, please check new article.
Zeppelin can be configured to leverage an organization's Active Directory infrastructure for user authentication. By doing this, the existing Active Directory users can login to Zeppelin UI using their Active Directory credentials. This article discuss how to configure this kind of setup.
Environment Setup:
HDP 2.5 cluster / Sandbox
- I'm using HDP 2.5 Sandbox on VirtualBox. Get one from here !
Ambari 2.4+
- I'm using Ambari 2.4.0.0 which comes with HDP 2.5 Sandbox
'Zeppelin Notebook' Service installed in Ambari
- With HDP 2.5 Sandbox, it will be Zeppelin version 0.6.0
- If you don't have Zeppelin installed, it can be installed via 'Add Service' option in Ambari
Active Directory
- I'm using Active Directory 2012 R2 version
- Make sure that you have 'working' Active Directory details handy like URI, bind DN/password, search base etc.
Configuration Steps:
1. From Ambari Dashboard, navigate to Zeppelin Notebook > Configs > Advanced zeppelin-config section.
2. Locate & set property "zeppelin.anonymous.allowed=false". By default, this is set to true so that any user can login to Zeppelin UI as anonymous user.
3. On the same Ambari page, navigate to next section called "Advanced zeppelin-env".
4. Locate a property called "shiro_ini_content". It contains an Apache Shiro configuration which Zeppelin uses to perform LDAP/AD authentication and authorization. Make the following changes to configure Zeppelin for Active Directory:
Add following Active Directory related information in the [main] section -
activeDirectoryRealm = org.apache.zeppelin.server.ActiveDirectoryGroupRealm
activeDirectoryRealm.systemUsername = cn=ldap-reader,ou=ServiceUsers,dc=lab,dc=hortonworks,dc=net
activeDirectoryRealm.systemPassword = badPassword
#activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/etc/zeppelin/conf/zeppelin.jceks
activeDirectoryRealm.searchBase = dc=lab,dc=hortonworks,dc=net
activeDirectoryRealm.url = ldap://ad.example.net:389
activeDirectoryRealm.authorizationCachingEnabled = false
Tip: For the above section, any working Shiro configuration would work (For example, Shiro configuration used by Knox). If you have a working Knox configuration, you can consider referring that here.
Another working Shiro configuration could be:
contextFactory = org.apache.shiro.realm.ldap.JndiLdapContextFactory
contextFactory.url = ldap://ad.example.net:389
contextFactory.systemUsername = cn=ldap-reader,ou=ServiceUsers,dc=lab,dc=hortonworks,dc=net
contextFactory.systemPassword = badPassword
contextFactory.authenticationMechanism = SIMPLE
activeDirectoryRealm = org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm
activeDirectoryRealm.ldapContextFactory = $contextFactory
activeDirectoryRealm.searchBase = dc=lab,dc=hortonworks,dc=net
Uncomment sessionManager lines and add "securityManager.realms" line.
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.realms = $activeDirectoryRealm
Under [urls] section, comment out "/** = anon" line and un-comment "/** = authc" line.
The final shiro_ini_content should look like this:
[users]
# List of users with their password allowed to access Zeppelin.
# To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections
#admin = password1
#user1 = password2, role1, role2
#user2 = password3, role3
#user3 = password4, role2
# Sample LDAP configuration, for user Authentication, currently tested for single Realm
[main]
activeDirectoryRealm = org.apache.zeppelin.server.ActiveDirectoryGroupRealm
activeDirectoryRealm.systemUsername = cn=ldap-reader,ou=ServiceUsers,dc=lab,dc=hortonworks,dc=net
activeDirectoryRealm.systemPassword = badPassword
#activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://user/zeppelin/conf/zeppelin.jceks
activeDirectoryRealm.searchBase = dc=lab,dc=hortonworks,dc=net
activeDirectoryRealm.url = ldap://ad.example.net:389
activeDirectoryRealm.authorizationCachingEnabled = false
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.realms = $activeDirectoryRealm
# 86,400,000 milliseconds = 24 hour
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login
[urls]
# anon means the access is anonymous.
# authcBasic means Basic Auth Security
# To enfore security, comment the line below and uncomment the next one
/api/version = anon
#/** = anon
/** = authc
5. Save the configuration changes and restart Zeppelin Notebook service.
6. If something goes wrong, check Troubleshooting section at the end.
Test the configuration:
1. Once Zeppelin service is restarted, open the Zeppelin UI in a new browser tab by typing http://zeppelin-hostname:9995. Since I'm using HDP 2.5 Sandbox, for me it is http://127.0.0.1:9995
2. Click on "Login" button in the top right corner.
3. Specify any valid Active Directory username and password in the Login window. Make sure to provide the fully qualified user name like "ad-username@AD.DOMAIN.COM", a short username like "ad-username" will give an error (check next section).
If everything goes fine, user will be able to login using their Active Directory credentials. At the same time, the log file will show a success message like this:
WARN [2016-11-26 01:06:27,563] ({qtp627185331-13 - /api/login} LoginRestApi.java[postLogin]:111) - {"status":"OK","message":"","body":{"principal":"hr1@EXAMPLE.NET","ticket":"cc231146-293a-4f5e-8045-aea4b0fea37a","roles":"[]"}}
Troubleshooting:
In case of any error during service restart after configuration changes, most probably it will be due to incorrect / incomplete configuration. Zeppelin log file can be found at /var/log/zeppelin/zeppelin-zeppelin-sandbox.hortonworks.com.log location on the Zeppelin host. Please check log file for error(s).
Common Issues & Resolution:
1. Incorrect Realm class name
- Upon restart, Zeppelin service will die and while there will be no logs in /var/log/zeppelin/zeppelin-zeppelin-sandbox.hortonworks.com.log, but the /var/log/zeppelin/zeppelin-zeppelin-sandbox.hortonworks.com.out will have an error saying ClassNotFoundException for Realm class.
- Make sure that Realm class name is spelled correctly. Valid realm class names are:
org.apache.zeppelin.server.ActiveDirectoryGroupRealm
org.apache.shiro.realm.activedirectory.ActiveDirectoryRealm
Please note that based on the Realm class used, the Shiro configuration properties might change slightly. So check the relevant documentation before using.
2. "The username and password that you entered don't match."
- At the time of login, if user get this message in UI then check the log file. If it has a line,
"Caused by: javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903C8, comment: AcceptSecurityContext error, data 52e, v2580^@]"
This means that username or password specified at Login window is not correct. Make sure to use the fully qualified username with domain name and right password.
... View more
Labels:
12-07-2016
09:46 AM
@Krishna Pandey , any idea on this?
... View more
12-03-2016
02:54 PM
Hello @Vikram, I looked into Oozie workflow spefification here and source code here to check how this URL is handled. As mentioned in the documentation, Oozie just makes a get request to "oozie.wf.workflow.notification.url" URL. This means, as long as you can specify a fully qualified URL with required basic authentication info (maybe via query-string and token), Oozie should be able to deliver that. Hope this helps.
... View more
11-24-2016
10:59 AM
1 Kudo
Hello @jzhang, This problem used be there with old HDP 2.5 Sandbox image. Can you please verify the MD5 checksum of the HDP 2.5 sandbox images that you are using for this page? For example, for virtualbox image file (the .ova file) of HDP 2.5 sandbox, the MD5 sum should be : MD5 : d42a9bd11f29775cc5b804ce82a72efd Please confirm this. If checksums are not matching, then download the correct image from above link. Hope this helps.
... View more
11-15-2016
09:44 AM
Hello @Ram D, There are several advantages with Kerberos over LDAP. The most prominent one is - Kerberos is more secured when compared to LDAP. Here's how: 1. Kerberos is conceptualized and implemented as authentication protocol from the beginning where the protecting the user's credential is given utmost importance. Whereas LDAP is actually a directory access protocol (a la telephone directory) and not meant for authentication originally. 2. User's password *never* travels over wire when using Kerberos. Of course, you can secure LDAP communication with SSL but then it is 'encrypted password' which is traveling over wire. There are couple of reasons why Kerberos has been chosen by Hadoop world as de fecto authentication standard. Hope this helps.
... View more
11-05-2016
10:21 AM
Hello @Rishi, If you are using Ambari, then there is no direct way to enable/disable Kerberos for specific component. You can disable Kerberos from component specific configuration change but think about what would happen when a non-Kerberized service wants to talk to a Kerberized service or vice versa. Wondering what is the use case here? Do let us know. Hope this helps !
... View more
11-05-2016
05:33 AM
Hello @Kent Brodie, Please try to enable Ranger debug logging via Ambari. Go to Ranger > Configs > Advanced > Advanced admin-log4j section. And change the rootlogger level from warn to debug. Restart Ranger Admin and that should give debug log in xa_portal.log. Let us know what error / stack trace you see there. Best of luck !
... View more
11-04-2016
11:19 AM
3 Kudos
Hello @Raffi Abberbock , If an LDAP user is coming in via Knox, the user need not have a directory in HDFS. Instead, the LDAP user needs to have permision to access the HDFS objects. Thanks.
... View more
10-12-2016
02:01 PM
Thank you @Rahul Buragohain for letting us know. Please select any best answer for the others to follow how this problem was fixed. Thanks.
... View more