LDAP authentication fails


(Juan) #1

Hi! I'm tryin to conect my Elasticsearch 6.5.4 to my ldap server in my company but i could not login any user in the AD. The only user that i could meke him login is the bind_dn user, but i get the following error message:
{"message":"action [indices:data/read/search] is unauthorized for user [xxxxxxx]: [security_exception] action [indices:data/read/search] is unauthorized for user [gitlab_auth]","statusCode":403,"error":"Forbidden"}

My elasticsearch.yml:


xpack.security.enabled: true

type: ldap
order: 0
url: "ldap://172.29.xx.xx:389"
bind_dn: "CN=xxxxx,OU=XXX XX,OU=XXX XXX,OU=XXX XXX XX,DC=xxxx,DC=xxxx"
base_dn: "OU=XXX XX,OU=XXX XXX,OU=XXX XXX XX,DC=xxxx,DC=xxxx"
filter: "cn={0}"
base_dn: "dc=xxxxxxx,dc=xxxx"
unmapped_groups_as_roles: false

(Tim Vernum) #2

If you are using AD, then you should use the active_directory realm type, rather than ldap. It is possible to use ldap for this, but the AD realm handles a variety of AD specific features that you will want.

This is an authorization (privileges) problem. You need to configure role mapping so that the user has permissions in ES. See: https://www.elastic.co/guide/en/elastic-stack-overview/6.5/mapping-roles.html

Happy to help diagnose that, but you'll need to provide a clear description of the steps you took and the errors you saw (both logs and API errors)

(Juan) #3

Thanks for your reply. I´ll try to configure de active_directory realm and i´ll let you know if it works.