<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to restrict specific ActiveDirectory users to access zeppelin in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212422#M60054</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/17092/haaris292.html" nodeid="17092"&gt;@Haaris Khan&lt;/A&gt;&lt;P&gt;In Zeppelin 0.7, HDP2.6 we have new LdapRealm, that allows to specify search filter. With the search filter we can restrict login based on groups. Below is one such example I tested in my lab. Please note that this works only in HDP2.6 or zeppelin 0.7 and above. &lt;/P&gt;&lt;P&gt;In HDP2.5 this was not possible because active directory realm was based on UserPrincipalName attribute and there was no way to filter the users based on groups so login cannot be restricted, but with Authorization(as mentioned by &lt;A rel="user" href="https://community.cloudera.com/users/740/vrathor.html" nodeid="740"&gt;@Vipin Rathor&lt;/A&gt; you can restrict the users accessing specific urls based on group role map)&lt;/P&gt;&lt;PRE&gt;[main]
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm 
ldapADGCRealm.contextFactory.systemUsername = hadoopadmin@lab.hortonworks.net
ldapADGCRealm.contextFactory.systemPassword = &amp;lt;Password&amp;gt;
ldapADGCRealm.searchBase = "dc=lab,dc=hortonworks,dc=net" 
ldapADGCRealm.userSearchBase = "dc=lab,dc=hortonworks,dc=net"
ldapADGCRealm.userSearchFilter=(&amp;amp;(objectclass=user)(sAMAccountName={0})(|(memberOf=CN=hr,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)(memberOf=CN=hadoop-admins,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)(memberOf=CN=sales,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)))
ldapADGCRealm.contextFactory.url = ldap://LdapServer:389 
#ldapADGCRealm.userSearchAttributeName = sAMAccountName 
ldapADGCRealm.contextFactory.authenticationMechanism = simple 
#ldapADGCRealm.userObjectClass = user 
ldapADGCRealm.groupObjectClass = group 
ldapADGCRealm.memberAttribute = member 
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login


&lt;/PRE&gt;</description>
    <pubDate>Sun, 28 May 2017 15:36:43 GMT</pubDate>
    <dc:creator>rguruvannagari</dc:creator>
    <dc:date>2017-05-28T15:36:43Z</dc:date>
    <item>
      <title>How to restrict specific ActiveDirectory users to access zeppelin</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212420#M60052</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to restrict a specific group of ActiveDirectory users to access zeppelin.&lt;/P&gt;&lt;P&gt;My shiro looks something like below, can you please suggest where i have to add the group name or make the changes so that the group of users are not able to login to zeppelin.&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;[users]&lt;/LI&gt;&lt;LI&gt;# List of users with their password allowed to access Zeppelin.&lt;/LI&gt;&lt;LI&gt;# To use a different strategy (LDAP / Database / ...) check the shiro doc at &lt;A href="http://shiro.apache.org/configuration.html#Configuration-INISections"&gt;http://shiro.apache.org/configuration.html#Configuration-INISections&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;#admin = password1&lt;/LI&gt;&lt;LI&gt;#user1 = password2, role1, role2&lt;/LI&gt;&lt;LI&gt;#user2 = password3, role3&lt;/LI&gt;&lt;LI&gt;#user3 = password4, role2&lt;/LI&gt;&lt;LI&gt;# Sample LDAP configuration, for user Authentication, currently tested for single Realm&lt;/LI&gt;&lt;LI&gt;[main]&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm = org.apache.zeppelin.server.ActiveDirectoryGroupRealm&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.systemUsername = cn=ldap-reader,ou=ServiceUsers,dc=lab,dc=hortonworks,dc=net&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.systemPassword = badPassword&lt;/LI&gt;&lt;LI&gt;#activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://user/zeppelin/conf/zeppelin.jceks&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.searchBase = dc=lab,dc=hortonworks,dc=net&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.url = ldap://ad.example.net:389&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.groupRolesMap = "cn=ldap-admin,ou=ServiceUsers,dc=lab,dc=hortonworks,dc=net":"admin"&lt;/LI&gt;&lt;LI&gt;activeDirectoryRealm.authorizationCachingEnabled =false&lt;/LI&gt;&lt;LI&gt;sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager&lt;/LI&gt;&lt;LI&gt;securityManager.sessionManager = $sessionManager&lt;/LI&gt;&lt;LI&gt;securityManager.realms = $activeDirectoryRealm&lt;/LI&gt;&lt;LI&gt;# 86,400,000 milliseconds = 24 hour&lt;/LI&gt;&lt;LI&gt;securityManager.sessionManager.globalSessionTimeout =86400000&lt;/LI&gt;&lt;LI&gt;shiro.loginUrl =/api/login&lt;/LI&gt;&lt;LI&gt;[urls]&lt;/LI&gt;&lt;LI&gt;# anon means the access is anonymous.&lt;/LI&gt;&lt;LI&gt;# authcBasic means Basic Auth Security&lt;/LI&gt;&lt;LI&gt;# To enfore security, comment the line below and uncomment the next one&lt;/LI&gt;&lt;LI&gt;/api/version = anon&lt;/LI&gt;&lt;LI&gt;#/** = anon&lt;/LI&gt;&lt;LI&gt;/api/interpreter/** = authc, roles[admin]&lt;/LI&gt;&lt;LI&gt;/api/configurations/** = authc, roles[admin]&lt;/LI&gt;&lt;LI&gt;/api/credential/** = authc, roles[admin]&lt;/LI&gt;&lt;LI&gt;/** = authc&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Please suggest,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 20:28:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212420#M60052</guid>
      <dc:creator>haaris292</dc:creator>
      <dc:date>2017-04-26T20:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict specific ActiveDirectory users to access zeppelin</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212421#M60053</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://community.cloudera.com/users/17092/haaris292.html" nodeid="17092"&gt;@Haaris Khan&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;The following applied to HDP 2.5.3.0 and above. You can restrict AD groups to access different components of Zeppelin (interpreter, configurations, credentials) like this: &lt;/P&gt;&lt;P&gt;1. Add all your AD groups against some role(s). To do this, you have the following in the [main] section:&lt;/P&gt;&lt;PRE&gt;activeDirectoryRealm.groupRolesMap = "cn=hr,ou=CorpUsers,dc=lab,dc=hortonworks,dc=net":"endusers","cn=legal,ou=CorpUsers,dc=lab,dc=hortonworks,dc=net":"admin","cn=sales,ou=CorpUsers,dc=lab,dc=hortonworks,dc=net":"readonly"&lt;/PRE&gt;&lt;P&gt;Note: You can create roles with any name that you like.&lt;/P&gt;&lt;P&gt;
2. Next, define the access for these roles in the [urls] section:&lt;/P&gt;&lt;PRE&gt;[urls]
/api/version = anon
/api/interpreter/** = authc, roles[endusers,readonly]
/api/configurations/** = authc, roles[readonly]
/api/credential/** = authc, roles[admin]
/** = authc
#/** = anon
&lt;/PRE&gt;&lt;P&gt;
With these two, your LDAP group should be authorized to access the only the specific URLs.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 01:46:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212421#M60053</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2017-04-27T01:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict specific ActiveDirectory users to access zeppelin</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212422#M60054</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/17092/haaris292.html" nodeid="17092"&gt;@Haaris Khan&lt;/A&gt;&lt;P&gt;In Zeppelin 0.7, HDP2.6 we have new LdapRealm, that allows to specify search filter. With the search filter we can restrict login based on groups. Below is one such example I tested in my lab. Please note that this works only in HDP2.6 or zeppelin 0.7 and above. &lt;/P&gt;&lt;P&gt;In HDP2.5 this was not possible because active directory realm was based on UserPrincipalName attribute and there was no way to filter the users based on groups so login cannot be restricted, but with Authorization(as mentioned by &lt;A rel="user" href="https://community.cloudera.com/users/740/vrathor.html" nodeid="740"&gt;@Vipin Rathor&lt;/A&gt; you can restrict the users accessing specific urls based on group role map)&lt;/P&gt;&lt;PRE&gt;[main]
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm 
ldapADGCRealm.contextFactory.systemUsername = hadoopadmin@lab.hortonworks.net
ldapADGCRealm.contextFactory.systemPassword = &amp;lt;Password&amp;gt;
ldapADGCRealm.searchBase = "dc=lab,dc=hortonworks,dc=net" 
ldapADGCRealm.userSearchBase = "dc=lab,dc=hortonworks,dc=net"
ldapADGCRealm.userSearchFilter=(&amp;amp;(objectclass=user)(sAMAccountName={0})(|(memberOf=CN=hr,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)(memberOf=CN=hadoop-admins,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)(memberOf=CN=sales,OU=CorpUsers,DC=lab,DC=hortonworks,DC=net)))
ldapADGCRealm.contextFactory.url = ldap://LdapServer:389 
#ldapADGCRealm.userSearchAttributeName = sAMAccountName 
ldapADGCRealm.contextFactory.authenticationMechanism = simple 
#ldapADGCRealm.userObjectClass = user 
ldapADGCRealm.groupObjectClass = group 
ldapADGCRealm.memberAttribute = member 
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login


&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 May 2017 15:36:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212422#M60054</guid>
      <dc:creator>rguruvannagari</dc:creator>
      <dc:date>2017-05-28T15:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict specific ActiveDirectory users to access zeppelin</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212423#M60055</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/3576/rguruvannagari.html" nodeid="3576"&gt;@rguruvannagari&lt;/A&gt; for the mention. That pushed me to write my pending article. I cover the new LDAP/AD options available in Apache Zeppelin 0.7.0 / HDP 2.6 in &lt;A target="_blank" href="https://community.hortonworks.com/articles/105169/hdp-26-configuring-zeppelin-for-active-directory-u.html"&gt;this article&lt;/A&gt;. Please check.&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 18:52:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212423#M60055</guid>
      <dc:creator>VR46</dc:creator>
      <dc:date>2017-05-28T18:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to restrict specific ActiveDirectory users to access zeppelin</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212424#M60056</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/3576/rguruvannagari.html" nodeid="3576"&gt;@rguruvannagari&lt;/A&gt;, your suggestion works perfectly fine for me in HDP2.6 - zeppelin 0.7&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 14:43:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-restrict-specific-ActiveDirectory-users-to-access/m-p/212424#M60056</guid>
      <dc:creator>haaris292</dc:creator>
      <dc:date>2017-06-19T14:43:03Z</dc:date>
    </item>
  </channel>
</rss>

