Group role mapping
See original GitHub issueHi! I have two groups:
- sentry_admin
- sentry_owner
Where each group have members which are
memberof
each group.
# sentry_admin, groups, site.io
dn: cn=sentry_admin,ou=groups,dc=site,dc=io
objectClass: groupOfNames
cn: sentry_admin_user
member: uid=sentry_admin_user,ou=people,dc=site,dc=io
# sentry_owner, groups, site.io
dn: cn=sentry_owner,ou=groups,dc=site,dc=io
objectClass: groupOfNames
cn: sentry_owner_user
member: uid=sentry_owner_user,ou=people,dc=site,dc=io
My current ldap configuration is as follows
AUTH_LDAP_USER_SEARCH = LDAPSearch(
"ou=people,dc=site,dc=io",
ldap.SCOPE_SUBTREE,
"(uid=%(user)s)"
)
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
"ou=groups,dc=site,dc=io", ldap.SCOPE_SUBTREE, "(objectClass=groupOfNames)"
)
AUTH_LDAP_SENTRY_USERNAME_FIELD = 'uid'
AUTH_LDAP_GROUP_TYPE = GroupOfUniqueNamesType()
AUTH_LDAP_REQUIRE_GROUP = None
AUTH_LDAP_DENY_GROUP = None
AUTH_LDAP_USER_ATTR_MAP = {
'name': 'cn',
'email': 'mail'
}
AUTH_LDAP_SENTRY_GROUP_ROLE_MAPPING = {
'owner': ['cn=sentry_owner,ou=groups,dc=site,dc=io'],
'admin': ['cn=sentry_admin,ou=groups,dc=site,dc=io']
}
AUTH_LDAP_FIND_GROUP_PERMS = False
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
AUTH_LDAP_DEFAULT_SENTRY_ORGANIZATION = u'Sentry'
# AUTH_LDAP_SENTRY_ORGANIZATION_ROLE_TYPE = 'member'
AUTH_LDAP_SENTRY_ORGANIZATION_GLOBAL_ACCESS = True
AUTH_LDAP_SENTRY_SUBSCRIBE_BY_DEFAULT = True
User login works perfect, but always as “Member”. Is there any way to approach a user management by its group? Not really sure if I’m using
AUTH_LDAP_SENTRY_GROUP_ROLE_MAPPING = {
'owner': ['cn=sentry_owner,ou=groups,dc=site,dc=io'],
'admin': ['cn=sentry_admin,ou=groups,dc=site,dc=io']
}
correctly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Mapping users and groups to roles | Elasticsearch Guide [8.5]
Within the role mapping file, the security roles are keys and groups and users are values. The mappings can have a many-to-many relationship....
Read more >Mapping AD Groups to Roles - Fortinet Documentation Library
FortiSIEM provides the ability to map Microsoft Active Directory (AD) Groups to Roles. A user mapped to more than one Role has permissions...
Read more >Groups, Roles and Mappings, Oh My! | OneLogin Training
Groups, Roles and Mappings, Oh My! Take a look at this brief training video to understand the differences between OneLogin Groups and OneLogin...
Read more >Security role to user or group mapping - IBM
Use this page to specify the users and groups that are mapped to the security roles that are used with the enterprise application....
Read more >Mapping Roles to Users and Groups - Oracle Help Center
Mapping Roles to Users and Groups ... The role name can be mapped to either a specific principal (user), a group, or both....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Huh I’m out of ideas 😦, but I would validate that group queries are proper towards LDAP. Did you tried to run Sentry in debug mode? If so what are results from group query towards LDAP? For me I get something like this (when user first time logins):
Not sure if it helps you, but I can share development setup that works for me. This is my dev Groups LDIF:
Conf for package:
requirements.txt
Did anyone get this working? I have role mapped but every user that login for first time the default “member” role is assinged to him. So role mapping dont work for me 😦