Been hacking at this problem for 2 days now.
This same user I am using in Vault LDAP config to binddn with (including dn and password) is unable to login to Vault using LDAP.
Here is proof this user can bind to ldap and find itself:
$ ldapsearch -H ldap://ldap.mycompany.com -D "CN=svc-hwinf-vlt-test,OU=Service Accounts,OU=Accounts,DC=mycompany,DC=com" -W -b "dc=mycompany,dc=com" -s sub "(&(objectclass=Person)(cn=svc-hwinf-vlt-test))"
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <dc=mycompany,dc=com> with scope subtree
# filter: (&(objectclass=Person)(cn=svc-hwinf-vlt-test))
# requesting: ALL
#
# svc-hwinf-vlt-test, Service Accounts, Accounts, mycompany.com
dn: CN=svc-hwinf-vlt-test,OU=Service Accounts,OU=Accounts,DC=mycompany,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
sAMAccountName: svc-hwinf-vlt-test
Here is my Vault LDAP config:
binddn: "CN=svc-hwinf-vlt-test,OU=Service Accounts,OU=Accounts,DC=mycompany,DC=com"
case_sensitive_names: false
certificate: ""
deny_null_bind: true
discoverdn: true
groupattr: "cn"
groupdn: "OU=GroupID,OU=Groups,DC=mycompany,DC=com"
groupfilter: "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:={{.UserDN}}))"
insecure_tls: true
starttls: false
tls_max_version: "tls12"
tls_min_version: "tls11"
token_bound_cidrs: []
token_explicit_max_ttl: 3600
token_max_ttl: 3600
token_no_default_policy: false
token_num_uses: 0
token_period: 3600
token_policies: []
token_ttl: 3600
token_type: "default"
upndomain: ""
url: "ldap://ldap.mycompany.com,ldap://ldaphq.mycompany.com,ldap://ldap.gtm.mycompany.com/"
use_pre111_group_cn_behavior: false
use_token_groups: false
userattr: "samaccountname"
userdn: "ou=Accounts,dc=mycompany,dc=com"
When I login as another account, it’s successful:
$ vault login -tls-skip-verify -method=ldap username=anotheruser
Password (will be hidden):
Success! You are now authenticated.
But when I try to login as the same account I’m using as a binddn it errors:
$ vault login -tls-skip-verify -method=ldap username=svc-hwinf-vlt-test
Password (will be hidden):
Error authenticating: context deadline exceeded
This does not make sense to me, what is going on?