Hello,
I'm running elastic 6.2.2 /w x-pack and integrating it with LDAP.
The problem I am having is that I'm able to define users by specifying each user individually, but not an LDAP group.
Let me try to clarify:
Config in elasticearch.yml
#ldap authentication
xpack:
security:
authc:
realms:
ldap1:
type: ldap
order: 1
url: "ldap://ldap.company.com:389"
bind_dn: "cn=admin,dc=company,dc=com"
bind_password: password123
user_search:
base_dn: "dc=company,dc=com"
attribute: uid
group_search:
base_dn: "dc=company,dc=com"
files:
role_mapping: "/etc/elasticsearch/x-pack/role_mapping.yml"
unmapped_groups_as_roles: false
native1:
type: native
order: 0
This is a portion of my elasticsearch/x-pack/role_mapping.yml:
superuser:
- "uid=username,ou=People,dc=company,dc=com"
- "uid=username2,ou=People,dc=company,dc=com"
- "uid=username3,ou=People,dc=company,dc=com"
- "uid=username4,ou=People,dc=company,dc=com"
^ this works fine, however I'd like to be able to define an LDAP group instead of each user separately as in the example below:
#power_user:
- "cn=admins,dc=example,dc=com"
#user:
- "cn=users,dc=example,dc=com"
- "cn=admins,dc=example,dc=com"
- "cn=John Doe,cn=other users,dc=example,dc=com"
However, if I add the below, it does not work:
superuser:
- "ou=People,dc=company,dc=com"
In case some more user parameters are required, here is an exmaple of ldapsearch for a specific uid:
dn: uid=username,ou=People,dc=company,dc=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
objectClass: ldapPublicKey
uid: username
sn: Surname
givenName: Name
cn: Name Surname
mail: name@company.com
displayName: Name Surname
uidNumber: 7003
gidNumber: 4000
gecos: Name Surname
departmentNumber: DEPARTMENT
loginShell: /bin/bash
homeDirectory: /home/username
shadowLastChange: 17521
shadowMax: 180
shadowWarning: 14
userPassword:: Sfjsoifj3r3r39DSAdas5235
I looked for an answer in your forums, but was unable to find anything to solve this particular problem..