-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDAP group search doesn't work #6325
Comments
I removed vault write auth/ldap/config url="ldap://<YOUR LDAP HOST IP>:389" userdn="ou=people,dc=planetexpress,dc=com" groupdn="ou=people,dc=planetexpress,dc=com" groupattr="cn" upndomain="planetexpress.com" insecure_tls=true userattr=uid starttls=false binddn="cn=admin,dc=planetexpress,dc=com" bindpass='GoodNewsEveryone' and now it works fine. I don't know if it is a bug or just a problem between the chair and the keyboard :-/ |
Definitely a bug. In GetUserDN (https://github.com/hashicorp/vault/blob/master/helper/ldaputil/client.go#L149), if the bindDN is actually a distinguished name (because It seems like |
@NeilSorensen I'm not following your comment. Which part of the logic do you think should change? It seems like the? a? bug may be that line 134 should be moved up as the first if condition. I'm not sure if that's related to this problem or not though, mostly because I don't know in the GetUserDN function what the logic should be. |
The result of If The bug happens because if either |
Thanks for the explanation! Do you agree that moving the condition on line 134 first (so that if upndomain is set we use that, then do the discoverdn/binddn logic, then the fallback) would fix the issue? |
That might make group discovery work, but at the cost of potentially breaking individual authentication. If it were me, I'd change GetUserDN to use the same logic as GetUserBindDN |
Why do you think that would break individual auth? That comment suggests that you think that honoring upndomain, if it's set, will break auth -- but shouldn't we always be honoring that if it's set? |
I have the same error! However, if I remove the 'User Principal (UPN) Domain' I can no longer authenticate. With the 'User Principal (UPN) Domain' attribute authentication happens normally!
|
Hi! It may be that my settings help someone else! In my case, the internal domain used in my company is different from the email domain! Internal domain: mydomain.net.br
I was able to get the correct groups using the settings below.
I do not know if this is the best way, but I hope this helps! |
This comment has been minimized.
This comment has been minimized.
I've also run into this issue and I can't quite work it out - Unfortunately my LDAP skillz aren't amazing. I use JumpCloud. I enabled vault debug logging and as far as I can tell (maybe I'm completely wrong) it's connecting with the wrong binddn... it's using the user I try to authenticate with rather than what's defined in the ldap config e.g.
|
Not working in v1.2.2 as well WARNING! The following warnings were returned from Vault:
auth.ldap.auth_ldap_8a4e4bdf: groups fetched from server: num_server_groups=0 server_groups=[] |
Note: I hid a comment above because it's actually a totally separate issue from this one, and has already been resolved. |
Is there any fix planned for this? |
same error . not working with version 1.2.3 as well |
I'm also getting the same error in version 1.2.3. It's definitely a blocker for us here. Glancing through the comments, i agree with @jefferai re moving the updomain condition up as it should always honour that if set (in theory). |
Have the same error in version 1.2.2 and 1.2.3. The error doesn't occur in version 1.2.1 As a workaround you can remove the upndomain or leave it blank. |
leaving the upndomain blank worked for me as well. |
hmmm...i'm missing something then because leaving the upndomain blank didn't work for me. I removed it completely and it wouldn't let me log in at all. Are any of you able to share your configuration (with sensitive values omitted of course) as a pointer please @sdeoras @dunkelbunt1 ? |
@devops-rob have a look. resource "vault_ldap_auth_backend" "ldap" { |
I have been using vault 1.1.3 with LDAP auth and it has worked ok. Was planning to try raft storage backend and wanted to try vault 1.3, but now I get also this "no LDAP groups found in groupDN". Tried with empty upndomain, but that did not help. Any pointers how to troubleshoot this further, or is this really a bug that has appeared after 1.1.3? |
Got it to work now in vault 1.3 with a new groupfilter... |
I solved with a mix of the above configuration:
Using token groups in our case has the strange effect of getting the groups of the binddn user (vault) instead of the logging-in one. |
Not sure if you ever got this to work with Jumpcloud but i got it working on 1.3.4 vault: `Key Value binddn uid=User,ou=Users,o=<account_id>,dc=jumpcloud,dc=com |
I'm using 1.3.2+ent and got the same error. Took @Jamby93 's suggestion and changed the group filter and group dn. It worked fine after that - no ldap errors. |
That worked for me. Redhat Identity Manager. Thanks |
Describe the bug
LDAP group search doesn't work:
The UserDN variable seems to be empty when rendered in the LDAP groupfilter
To Reproduce
Steps to reproduce the behavior:
docker run --privileged -d -p 389:389 --name ldap rroemhild/test-openldap
to start a provisioned LDAP servervault write auth/ldap/config url="ldap://<YOUR LDAP HOST IP>:389" userdn="ou=people,dc=planetexpress,dc=com" groupdn="ou=people,dc=planetexpress,dc=com" groupattr="cn" upndomain="planetexpress.com" insecure_tls=true userattr=uid starttls=false binddn="cn=admin,dc=planetexpress,dc=com" bindpass='GoodNewsEveryone'
to setup LDAP authdocker logs -f ldap
vault write auth/ldap/groups/admin_staff policies=default
vault login -method=ldap username=hermes
(Password: hermes)We can see that
5c7ad477 conn=1049 op=5 SRCH base="ou=people,dc=planetexpress,dc=com" scope=2 deref=0 filter="(|(memberUid=hermes)(member=)(uniqueMember=))"
which is rendered by(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))
is empty when the{{.UserDN}}
template should contain the user DN fetched in the previous queries.Expected behavior
Vault should render
{{.UserDN}}
with the user DN fetched in the previous LDAP queries and map the LDAP group to the policy:I also tried with the following group filter:
(&(objectClass=group)(member={{.UserDN}}))
-> Same issueEnvironment:
vault status
):vault version
):v1.0.3 ('85909e3373aa743c34a6a0ab59131f61fd9e8e43')
Ubuntu 18.04.2 x86_64
Vault server configuration file(s):
Additional context
The text was updated successfully, but these errors were encountered: