Shiro 配置 - 角色和限制搜索库
Shiro Configuration - roles and limiting searchbase
我们一直在尝试添加正确的shiro配置,以确保特定的AD组只能登录,并区分角色。我们有两个可行的解决方案,但第一个让我们进入活动目录中的每个人(但角色工作正常),第二个不让每个人进入但角色不起作用。
1)
此版本适用于向特定 CN 添加角色,但允许所有人登录。
activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm
activeDirectoryRealm.systemUsername = aduser
activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelin.jceks
activeDirectoryRealm.searchBase = OU=User Accounts,DC=domain,DC=local
activeDirectoryRealm.url = ldap://AD.domain.local:389
activeDirectoryRealm.groupRolesMap = "CN=admins,OU=User Accounts,DC=domain,DC=local":"admin"
activeDirectoryRealm.authorizationCachingEnabled = false
activeDirectoryRealm.principalSuffix = @domain.local
securityManager.realms = $activeDirectoryRealm
2)
该版本限制登录到指定的AD组,但不将角色与组关联。
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = aduser@domain.local
ldapADGCRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelinldap.jceks
ldapADGCRealm.searchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.userSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = memberUid
ldapADGCRealm.groupIdAttribute = cn
ldapADGCRealm.groupSearchEnableMatchingRuleInChain = true
ldapADGCRealm.rolesByGroup = users: admin
ldapADGCRealm.userSearchFilter = (&(objectclass=user)(sAMAccountName={0})(memberOf=CN=users,OU=User Accounts,DC=domain,DC=local))
ldapADGCRealm.contextFactory.url = ldap://AD.domain.local:389 (edited)
相关帖子:
- https://community.hortonworks.com/questions/54896/zeppelin-ad-users-not-binded-to-groups.html
- https://community.hortonworks.com/questions/82135/how-to-limit-access-to-zeppelin-webui-based-for-sp.html
我们哪里出错了?
谢谢,
安德拉斯
迟到总比不到好)
使用 LdapRealm 获得角色组映射。需要设置
ldapRealm.userSearchAttributeName = userPrincipalName
ldapRealm.memberAttribute = member
在我们的例子中,userPrincipalName 是 AD 中的属性,其中包含我们输入的完整用户名 (user@domain.com),member 是存储组成员的属性。
我们一直在尝试添加正确的shiro配置,以确保特定的AD组只能登录,并区分角色。我们有两个可行的解决方案,但第一个让我们进入活动目录中的每个人(但角色工作正常),第二个不让每个人进入但角色不起作用。
1) 此版本适用于向特定 CN 添加角色,但允许所有人登录。
activeDirectoryRealm = org.apache.zeppelin.realm.ActiveDirectoryGroupRealm
activeDirectoryRealm.systemUsername = aduser
activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelin.jceks
activeDirectoryRealm.searchBase = OU=User Accounts,DC=domain,DC=local
activeDirectoryRealm.url = ldap://AD.domain.local:389
activeDirectoryRealm.groupRolesMap = "CN=admins,OU=User Accounts,DC=domain,DC=local":"admin"
activeDirectoryRealm.authorizationCachingEnabled = false
activeDirectoryRealm.principalSuffix = @domain.local
securityManager.realms = $activeDirectoryRealm
2) 该版本限制登录到指定的AD组,但不将角色与组关联。
ldapADGCRealm = org.apache.zeppelin.realm.LdapRealm
ldapADGCRealm.contextFactory.systemUsername = aduser@domain.local
ldapADGCRealm.hadoopSecurityCredentialPath = jceks://file/user/zeppelin/conf/zeppelinldap.jceks
ldapADGCRealm.searchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.userSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupSearchBase = "OU=User Accounts,DC=domain,DC=local"
ldapADGCRealm.groupObjectClass = group
ldapADGCRealm.memberAttribute = memberUid
ldapADGCRealm.groupIdAttribute = cn
ldapADGCRealm.groupSearchEnableMatchingRuleInChain = true
ldapADGCRealm.rolesByGroup = users: admin
ldapADGCRealm.userSearchFilter = (&(objectclass=user)(sAMAccountName={0})(memberOf=CN=users,OU=User Accounts,DC=domain,DC=local))
ldapADGCRealm.contextFactory.url = ldap://AD.domain.local:389 (edited)
相关帖子:
- https://community.hortonworks.com/questions/54896/zeppelin-ad-users-not-binded-to-groups.html
- https://community.hortonworks.com/questions/82135/how-to-limit-access-to-zeppelin-webui-based-for-sp.html
我们哪里出错了?
谢谢, 安德拉斯
迟到总比不到好) 使用 LdapRealm 获得角色组映射。需要设置
ldapRealm.userSearchAttributeName = userPrincipalName
ldapRealm.memberAttribute = member
在我们的例子中,userPrincipalName 是 AD 中的属性,其中包含我们输入的完整用户名 (user@domain.com),member 是存储组成员的属性。