You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by gss2002 <gi...@git.apache.org> on 2016/10/14 00:53:06 UTC
[GitHub] zeppelin pull request #1513: ZEPPELIN-1472 - Create new LdapRealm based on A...
GitHub user gss2002 opened a pull request:
https://github.com/apache/zeppelin/pull/1513
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm
### What is this PR for?
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm: Provides LdapRealm Functionality similar to what Apache Knox provides. This is critical as in large enterprise environments Active Directory Global Catalogs are used for lookup with samAccountName and using a DN Template is not an option as their are multiple OUs. Also searching on "userPrincipalName" is risky in an AD environment since the explicit UPN vs Implicit UPN can be different this is definitely the case with environments using Office 365. And the LDAP userPrincipalName attribute is the explicit UPN which can be defined by the directory administrator to any value and it can be duplicated. SamAccountName is unique per domain and Microsoft states best practice is to not allow duplicate samAccountName's across the forest.
### What type of PR is it?
[Improvement]
### Todos
None
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1472
### How should this be tested?
Setup shiro.ini to use the following configuration:
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = CN=hdpbind,OU=Svc,DC=exadc,DC=w2k,DC=example,DC=com
ldapADGCRealm.contextFactory.systemPassword = ldapPassword
ldapADGCRealm.searchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.userSearchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.groupSearchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.contextFactory.url = ldap://exampledc1.exadc.w2k.example.com:3268
ldapADGCRealm.userSearchAttributeName = sAMAccountName
ldapADGCRealm.contextFactory.authenticationMechanism = simple
ldapADGCRealm.userObjectClass = user
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = member
### Questions:
* Does the licenses files need update? n
* Is there breaking changes for older versions? n
* Does this needs documentation? n
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gss2002/zeppelin ZEPPELIN-1472
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/1513.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1513
----
commit 34938754ac7e220a03cc1817bf93f2cf2d189ee9
Author: gss2002 <gr...@senia.org>
Date: 2016-10-11T03:58:51Z
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm
Class
commit 8991d647b024d04eed7005173b4a8eec07b18c6c
Author: gss2002 <gr...@senia.org>
Date: 2016-10-14T00:48:25Z
Merge remote-tracking branch 'upstream/master' into ZEPPELIN-1472
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by nazgul33 <gi...@git.apache.org>.
Github user nazgul33 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@gss2002 can you explain how to map ldap groups to shiro roles?
What i'm trying to do is to configure user rights to notebooks.
```
shiro.ini
----
ldapADGCRealm.userObjectClass = posixAccount
ldapADGCRealm.groupObjectClass = posixGroup
ldapADGCRealm.memberAttribute = memberUid
ldapADGCRealm.rolesByGroup = \
dataservice:admin, \
woowabros:woowabros
securityManager.realms = $ldapADGCRealm
[roles]
admin = *
woowabros = *
```
Added "testuser" in group "woowabros" by setting memberUid attribute of woowabros.
if I access a notebook with security setup
owner = nazgul33
read = woowabros
an error pops out like this
> Insufficient privileges to read notebook.
>
> Allowed users or roles: [woowabros]
>
> But the user testuser belongs to: [testuser]
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin pull request #1513: ZEPPELIN-1472 - Create new LdapRealm based on A...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 closed the pull request at:
https://github.com/apache/zeppelin/pull/1513
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@khalidhuseynov and @zjffdu can we look at committing this since tests have passed. If not let me know what else is needed.
Thanks
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@nazgul33 and @jongyoul this has been tested from a group perspective:
Here is the example:
[gsenia@hdp25sandbox ~]$ cat /etc/zeppelin/conf/shiro.ini
# Sample LDAP configuration, for user Authentication, currently tested for single Realm
[main]
ldapRealm = org.apache.zeppelin.realm.LdapRealm
ldapRealm.contextFactory.systemUsername = CN=hdplookup,OU=hadoop,DC=hdpusr,DC=senia,DC=org
ldapRealm.contextFactory.systemPassword = ldapBind12
ldapRealm.searchBase = dc=hdpusr,dc=senia,dc=org
ldapRealm.userSearchBase = dc=hdpusr,dc=senia,dc=org
ldapRealm.groupSearchBase = dc=hdpusr,dc=senia,dc=org
ldapRealm.authorizationEnabled = true
ldapRealm.contextFactory.url = ldap://seniadc1.hdpusr.senia.org:3268
ldapRealm.userSearchAttributeName = sAMAccountName
ldapRealm.contextFactory.authenticationMechanism = simple
ldapRealm.groupObjectClass = group
ldapRealm.memberAttribute = member
ldapRealm.rolesByGroup = hdpeng: admin
securityManager.realms = $ldapRealm
sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
### If caching of user is required then uncomment below lines
#cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
#securityManager.cacheManager = $cacheManager
securityManager.sessionManager = $sessionManager
# 86,400,000 milliseconds = 24 hour
securityManager.sessionManager.globalSessionTimeout = 86400000
shiro.loginUrl = /api/login
[roles]
# 'admin' role has all permissions, indicated by the wildcard '*'
admin = *
[urls]
# anon means the access is anonymous.
# authcBasic means Basic Auth Security
# authc means Form based Auth Security
# To enfore security, comment the line below and uncomment the next one
#/api/version = anon
#/** = anon
/api/interpreter/** = authc, roles[admin]
/api/configurations/** = authc, roles[admin]
/api/credential/** = authc, roles[admin]
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by nazgul33 <gi...@git.apache.org>.
Github user nazgul33 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@jongyoul I could make it work with openLDAP server. I had no time to play around with group settings, but at least I could authenticate user by
* ldapADGCRealm.userSearchAttributeName = cn
* ldapADGCRealm.userSearchAttributeName = uid
and the followings are settings I had to modify when I'm using phpldapadmin to manage users.
ldapADGCRealm.contextFactory.authenticationMechanism = simple
ldapADGCRealm.userObjectClass = posixAccount
ldapADGCRealm.groupObjectClass = posixGroup
ldapADGCRealm.memberAttribute = memberUid
for me, it works.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
Rerun build as error is not related to this patch.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@khalidhuseynov made the requested changes and updated documentation. Please let me know what you think. Also I will be willing to create a jira and move the other Realms.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@nazgul33 I've heard your team used LDAP. Can you adopt and test this PR in your team?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin pull request #1513: ZEPPELIN-1472 - Create new LdapRealm based on A...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 closed the pull request at:
https://github.com/apache/zeppelin/pull/1513
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by nazgul33 <gi...@git.apache.org>.
Github user nazgul33 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@gss2002 Thanks for the sample configuration.
I'm going to test this PR further with group mappings on Monday.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
This is replaced by #1614
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin pull request #1513: ZEPPELIN-1472 - Create new LdapRealm based on A...
Posted by gss2002 <gi...@git.apache.org>.
GitHub user gss2002 reopened a pull request:
https://github.com/apache/zeppelin/pull/1513
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm
### What is this PR for?
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm: Provides LdapRealm Functionality similar to what Apache Knox provides. This is critical as in large enterprise environments Active Directory Global Catalogs are used for lookup with samAccountName and using a DN Template is not an option as their are multiple OUs. Also searching on "userPrincipalName" is risky in an AD environment since the explicit UPN vs Implicit UPN can be different this is definitely the case with environments using Office 365. And the LDAP userPrincipalName attribute is the explicit UPN which can be defined by the directory administrator to any value and it can be duplicated. SamAccountName is unique per domain and Microsoft states best practice is to not allow duplicate samAccountName's across the forest.
### What type of PR is it?
[Improvement]
### Todos
None
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1472
### How should this be tested?
Setup shiro.ini to use the following configuration:
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = CN=hdpbind,OU=Svc,DC=exadc,DC=w2k,DC=example,DC=com
ldapADGCRealm.contextFactory.systemPassword = ldapPassword
ldapADGCRealm.searchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.userSearchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.groupSearchBase = dc=w2k,dc=example,dc=com
ldapADGCRealm.contextFactory.url = ldap://exampledc1.exadc.w2k.example.com:3268
ldapADGCRealm.userSearchAttributeName = sAMAccountName
ldapADGCRealm.contextFactory.authenticationMechanism = simple
ldapADGCRealm.userObjectClass = user
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = member
### Questions:
* Does the licenses files need update? n
* Is there breaking changes for older versions? n
* Does this needs documentation? n
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gss2002/zeppelin ZEPPELIN-1472
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/1513.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1513
----
commit 34938754ac7e220a03cc1817bf93f2cf2d189ee9
Author: gss2002 <gr...@senia.org>
Date: 2016-10-11T03:58:51Z
ZEPPELIN-1472 - Create new LdapRealm based on Apache Knox LdapRealm
Class
commit 8991d647b024d04eed7005173b4a8eec07b18c6c
Author: gss2002 <gr...@senia.org>
Date: 2016-10-14T00:48:25Z
Merge remote-tracking branch 'upstream/master' into ZEPPELIN-1472
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by jongyoul <gi...@git.apache.org>.
Github user jongyoul commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@gss2002 Hi, Thanks for the contribution. This PR actually has no problem itself or no breaking current behavior. So LGTM. But I'm just curious about the use case. Do you know the case to use this? May be in your company?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] zeppelin issue #1513: ZEPPELIN-1472 - Create new LdapRealm based on Apache K...
Posted by gss2002 <gi...@git.apache.org>.
Github user gss2002 commented on the issue:
https://github.com/apache/zeppelin/pull/1513
@nazgul33 refactoring some code fix coming.. To utilize groups and users
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---