OpenLDAP proxy AD showing empty tree

I'm using OpenLDAP (in a docker container) mainly for two purposes:

1.) Having a local tree which actually stores my technical users. 2.) Proxy specific queries to my corporate active directory just to retrieve information (I don't want to modify something).

So far so good. I've found several tutorials in the internet which described how to proxy queries from an openldap to an active directory and finally I used this configuration (for my OpenLDAP) to configure the proxy:

dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: {2}back_ldap

dn: olcDatabase={2}ldap,cn=config
changetype: add
objectClass: olcDatabaseConfig
objectClass: olcLDAPConfig
olcDatabase: {2}ldap
olcDbURI: ldap://my_corporate_ad:389
olcSuffix: dc=my,dc=corporate,dc=ad,dc=com
olcDbRebindAsUser: TRUE
olcDbChaseReferrals: TRUE

After setup I'm able to connect to the local tree and it works like expected. But when I try to connect to the OpenLDAP with the proxy credentials/base dn then I'm able to login but I cannot see any tree/entries. An ldapsearch just gives me zero results if I query for objectclass=*.

When I look at the logs from the openldap then it shows me this output:

56ebba59 conn=1007 fd=23 ACCEPT from IP=100.30.407.19:15313 (IP=172.17.0.3:389)
56ebba59 conn=1007 op=0 BIND dn="cn=dockers2eu,cn=Users,dc=my,dc=corporate,dc=ad,dc=com" method=128
56ebba59 conn=1007 op=0 BIND dn="cn=dockers2eu,cn=Users,dc=my,dc=corporate,dc=ad,dc=com" mech=SIMPLE ssf=0
56ebba59 conn=1007 op=0 RESULT tag=97 err=0 text=
56ebba59 conn=1007 op=1 SRCH base="dc=my,dc=corporate,dc=ad,dc=com" scope=1 deref=0 filter="(objectClass=*)"
56ebba59 conn=1007 op=1 SRCH attr=objectclass
Unable to chase referral "ldap://bkabkzasdh" (-1: Can't contact LDAP server)
Unable to chase referral "ldap://asdfjkasdja" (-1: Can't contact LDAP server)
Unable to chase referral "ldap://my.corporate.ad.com/CN=Configuration,DC=my,DC=corporate,DC=ad,DC=com??base" (-1: Can't contact LDAP server)
56ebba8f conn=1007 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
56ebbacb conn=1007 op=2 SRCH base="dc=my,dc=corporate,dc=ad,dc=com" scope=0 deref=0 filter="(objectClass=*)"
56ebbacb conn=1007 op=2 SEARCH RESULT tag=101 err=0 nentries=0 text=

What I see here is that he can't chase the referrals. That should be okay because I just want to retrieve the information stored locally on the AD.

0
задан 18 March 2016 в 10:30
1 ответ

Первое, что нужно сделать, это убедиться, что ваш ldapsearch правильный. Это определит, проблема в запросе или в настройках LDAP.

Измените хост ldap в команде ldapsearch на -H ldap://my_corporate_ad:389, чтобы запросить AD напрямую. Если это вернет результаты, то ваш поиск будет корректным. Если нет, заставьте это работать, прежде чем повторять попытки против OpenLDAP.

В вашем LDAPConfig вы можете захотеть добавить соответствующие строки olcAccess, хотя я не уверен, что это на самом деле вызывает вашу проблему.

.
0
ответ дан 5 December 2019 в 10:39

Теги

Похожие вопросы