I'm experimenting with Elasticsearch and X-Pack, I'm using X-Pack in trial mode with no license, installed via RPM.
I've installed a 2-node cluster on Oracle Linux 7.x, using Oracle jdk1.8.0_121 (
localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: it
X11 Layout: it,us
X11 Variant: ,
).
I installed X-Pack plugin for elastichsearch and Kybana, then I configured a realm to authenticate against our Active Directory (no SSL, Windows 2012 R2) and it works fine, I'm able to login in Elastiscsearch and Kybana with roles that I mapped.
Then I configured a realm to authenticate against an LDAP infrastructure (389console) and I was never able to login, authentication ever fails. I've done a lot of checks without observe any error so I tried changing the LDAP user's password with a simpler one without any special chars and, magically, authentication via LDAP starts working like a charm.
Then I restored previous password and authentication fails again. The only not-alphanum chars in the password were an "@" and a "-"
The same password for a user authenticated via AD works with no issue, seems to be an issue only when using LDAP realms.
So... I think if there was a bug in the parser for LDAP realms there would be many reports about instead I found nothing.
What am I doing wrong?
No, it hasn't.
Bindings to LDAP is fine, If I change my user password to remove the "@" in it, authentication works fine.
Authentication fails only if user's password contain special chars (to tell the true, I haven't tried other special chars, the testing password contains only one "@" and a "-" and the other which instead succeed only letters).
But the same password with "@" and "-", against an AD realm, succeed.
Tested with two different user, with similar password.
I tried from kybana but also sending a request via CURL from command line, with the same results.
I've done a quick test with Elasticsearch+X-Pack 5.2.2 with OpenLDAP, and I was able to login using a password with @ in it.
So the next step is to try and see what is special about your environment.
I'll aim to run up a 389DS environment for testing, but it may be some time before I can do that.
Can you tell us which version of Elasticsearch you're running? It looks like it's not the latest one - if you were on 5.2.2 there would be another log message when the authentication fails.
Is it possible for you to upgrade to 5.2.2? I can't think of anything in that version that would fix this problem, but it will give us more details in the logs.
Also, when you are doing this testing, how are you logging in? Is it via Kibana or via curl?
For testing purposes, we'd like to eliminate as many variables as possible, so the simplest test is:
We were running version 5.2.1, installed via RPM on Oracle Linux.
The issue exists both via kibana or via curl
Just updated to 5.2.2:
With the @ in the password:
# curl -u fracassetti.monitor "http://localhost:9200/"
Enter host password for user 'fracassetti.monitor':
{"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [fracassetti.monitor] for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"unable to authenticate user [fracassetti.monitor] for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}
The account I used for test LDAP authentication is a currently-working account which I use every day to access to a mailbox, so when autenticating vs other systems, LDAP auth with the @ in the password works fine.
The issue appears only when elasticsearch (via kibana or CURL) tries to authenticate vs this ldap. The same password, used for authenticate a different user vs an AD realm, works fine.
And what if I try con configure an LDAP realm against our AD DC? May be useful?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.