In Zeppelin LDAP Authentication with OpenLDAP and How to Set Up OpenLDAP we've shown how to use LDAP Authentication with Zeppelin. In this article, we'll harden that configuration by ensuring that Zeppelin and OpenLDAP communicate over LDAPS.
LDAPS is a secure protocol that uses TLS to assure authenticity, confidentiality, and integrity of communications. This prevents man-in-the-middle attacks that sniff traffic to discover LDAP credentials communicated in plaintext, which could compromise the security of the cluster.
The first step is to modify the configuration of the OpenLDAP server, as root, to expose LDAPS connectivity, we'll need to modify /etc/openldap/ldap.conf. Please recall that we created /etc/openldap/certs/myldap.field.hortonworks.com.cert in the How to Set Up OpenLDAP article
#TLS_CACERTDIR /etc/openldap/certs TLS_CACERT /etc/openldap/certs/myldap.field.hortonworks.com.cert URI ldaps://myldap.field.hortonworks.com ldap://myldap.field.hortonworks.com BASE dc=field,dc=hortonworks,dc=com
We also need to modify /etc/sysconfig/slapd :
SLAPD_URLS="ldapi:/// ldap:/// ldaps:///"
Then restart slapd:
systemctl restart slapd
You can confirm that slapd is listening on 636:
netstat -anp | grep 636
Finally, confirm TLS connectivity and secure ldapsearch (with the appropriate bind user and password from the previous articles):
# should succeed openssl s_client -connect myldap.field.hortonworks.com:636 </dev/null # should succeed ldapsearch -H ldaps://myldap.field.hortonworks.com:636 -D cn=ldapadm,dc=field,dc=hortonworks,dc=com -w $password -b "ou=People,dc=field,dc=hortonworks,dc=com"
The next step is the client-side configuration changes. Since we are using a self-signed certificate for the OpenLDAP server, we need to import this into the Java truststore, called cacerts, which is in /etc/pki/ca-trust/extracted/java on my CentOS 7 system.
Copy the myldap.field.hortonworks.com.cert file from the OpenLDAP server to the Zeppelin server (this file does not contain sensitive key material, only public keys), and run (making sure you set this certificate to be trusted):
keytool -import -alias myldap -file /etc/security/certificates/myldap.field.hortonworks.com.cert -keystore cacerts
Otherwise, you will see errors like
Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed
Lastly, in Ambari, we just need to make one small change to the shiro.ini configuration in Zeppelin > Config > Advanced zeppelin-env > shiro_ini_content :
ldapRealm.contextFactory.url = ldaps://myldap.field.hortonworks.com:636
Note the protocol change to LDAPS and the port number change to 636.
To test, restart the Zeppelin service and confirm that users can still log in to the Zeppelin UI.
HDF-2.0 LDAP User Authentication with Ambari
Demystify Knox, LDAP, SSL, CA Cert integration
How to configure zeppelin livy interpreter for secure HDP cluster
Steps to remove a LDAP group from Ambari and still have the group in LDAP
How to configure Zeppelin for Active Directory user authentication
How to enable Knox proxying for Zeppelin
How to limit the LDAP users that can log into the ranger admin user interface.
HCC Guidelines | HCC FAQs | HCC Privacy Policy
© 2011-2017 Hortonworks Inc. All Rights Reserved.
Hadoop, Falcon, Atlas, Sqoop, Flume, Kafka, Pig, Hive, HBase, Accumulo, Storm, Solr, Spark, Ranger, Knox, Ambari, ZooKeeper, Oozie and the Hadoop elephant logo are trademarks of the Apache Software Foundation.
Privacy Policy |
Terms of Service
HCC Guidelines | HCC FAQs | HCC Privacy Policy | Privacy Policy | Terms of Service
© 2011-2018 Hortonworks Inc. All Rights Reserved.
Hadoop, Falcon, Atlas, Sqoop, Flume, Kafka, Pig, Hive, HBase, Accumulo, Storm, Solr, Spark, Ranger, Knox, Ambari, ZooKeeper, Oozie and the Hadoop elephant logo are trademarks of the Apache Software Foundation.