Bug 36354 - Active Directory Connection Wizards sets wrong UCR variable for binddn
Active Directory Connection Wizards sets wrong UCR variable for binddn
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: AD Connector
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Felix Botner
Stefan Gohmann
:
Depends on: 43070
Blocks: 42545
  Show dependency treegraph
 
Reported: 2014-10-30 15:19 CET by Charly Frahm
Modified: 2016-12-14 12:36 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.171
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2014103021000207
Bug group (optional): External feedback, Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charly Frahm univentionstaff 2014-10-30 15:19:29 CET
The Active Directory Connection Wizard sets the UCR variable "connector/ad/ldap/binddn" always to "cn=<Username>,cn=users,<ldapbase>", even if the given user is not in "cn=users".

Example: There is an additional Domain Admin within the OU "ou=admins". This user was specified as admin user in the Active Directory Connection Wizard. The user is found and the Wizard can be finished successfully. But the synchronisation doesn't work since the wrong DN is written to UCR:

Expected behaviour: the UCR variable ''connector/ad/ldap/binddn'' should contain ''cn=Admin,ou=admins,DC=sld,DC=tld'' 
Observed behaviour: the UCR variable ''connector/ad/ldap/binddn' contains ''cn=Admin,cn=users,DC=sld,DC=tld''
Comment 1 Michael Grandjean univentionstaff 2014-11-06 21:06:38 CET
Reported via Ticket#2014103021000207
Comment 2 Stefan Gohmann univentionstaff 2015-03-12 08:31:03 CET
Removed errata status since it happens only once.
Comment 3 Michel Smidt 2016-02-23 09:47:22 CET
Happened for the second time at remote installation at a customer. This is really an annoying bug because it is very difficult to find out for a usual user. At least if he is a new user.
Comment 4 Florian Best univentionstaff 2016-02-23 09:57:53 CET
The string is hardcoded in Javascript:

services/univention-ad-connector/umc/js/adconnector/SetupWizard.js:
592 »   »   »   »   LDAP_BindDN: lang.replace('cn={username},cn=users,{LDAP_Base}', vals),

Is it possible to do a univention-ad-search at this state?
How to get this DN?
Otherwise we need to adjust the field so that the user must enter the DN instead of the username.
Comment 5 Arvid Requate univentionstaff 2016-02-23 11:17:52 CET
> Is it possible to do a univention-ad-search at this state?
> How to get this DN?

This is how I determined it in Michels case:

ldapsearch -x -h somedc.ad.dom \
      -D thatadmin@AD.DOM \
      -y /etc/univention/connector/ad/bindpw \
      -b 'DC=ad,DC=dom' \
      samaccountname=thatadmin dn

This trick of using the userPrincipalName (with simplebind!) I discovered by chance during the development phase of our AD Connection setup (aka "Membermode"). It seems to be specific to AD but it's really useful to determine a bind dn. On the other hand, one could argue that this implies that we could probably simply set

connector/ad/ldap/binddn=thatadmin@AD.DOM
Comment 6 Felix Botner univentionstaff 2016-11-28 18:40:46 CET
Added get_ad_binddn_from_name to univention.management.console.modules.adconnector. Here, ldbsearch with username and password is used to get the dn of the "username" object.

Default is still cn={username},cn=users,{LDAP_Base} but if get_ad_binddn_from_name finds something, this DN is used.

univention-ad-connector.yaml errata 4.1-4

merged to 4.2-0

But, we have to wait for Bug #43070
Comment 7 Felix Botner univentionstaff 2016-11-29 15:56:32 CET
This change is pretty much useless until we decide to fix Bug #42545.

If we don't want to fix Bug #42545, we should only allow Administrator as connector user (as this account is always member of Domain Admins).
Comment 8 Michel Smidt 2016-11-29 22:38:44 CET
(In reply to Felix Botner from comment #7)
> This change is pretty much useless until we decide to fix Bug #42545.

No, I wouldn't say this. With this bug the the AD-Connector do not even start syncing if the user is not in the users container.
Bug #42545 is about a fragile "guess_ad_domain_language". In this case a consequential error.
Nevertheless I would like to vote to fix both bugs ;-)
Comment 9 Felix Botner univentionstaff 2016-11-30 09:37:47 CET
(In reply to Michel Smidt from comment #8)
> (In reply to Felix Botner from comment #7)
> > This change is pretty much useless until we decide to fix Bug #42545.
> 
> No, I wouldn't say this. With this bug the the AD-Connector do not even
> start syncing if the user is not in the users container.
> Bug #42545 is about a fragile "guess_ad_domain_language". In this case a
> consequential error.
> Nevertheless I would like to vote to fix both bugs ;-)

No, unless Bug #42545 is fixed the binddn user (if not already member of Domain Admins in UCS) is removed from Domain Admins in AD. After that the connector sync is broken (as the user has no longer the rights to create/modify objects in AD).
Comment 10 Felix Botner univentionstaff 2016-11-30 09:44:37 CET
(In reply to Felix Botner from comment #9)
> (In reply to Michel Smidt from comment #8)
> > (In reply to Felix Botner from comment #7)
> > > This change is pretty much useless until we decide to fix Bug #42545.
> > 
> > No, I wouldn't say this. With this bug the the AD-Connector do not even
> > start syncing if the user is not in the users container.
> > Bug #42545 is about a fragile "guess_ad_domain_language". In this case a
> > consequential error.
> > Nevertheless I would like to vote to fix both bugs ;-)
> 
> No, unless Bug #42545 is fixed the binddn user (if not already member of
> Domain Admins in UCS) is removed from Domain Admins in AD. After that the
> connector sync is broken (as the user has no longer the rights to
> create/modify objects in AD).

sorry, it is Bug #43070
Comment 11 Michel Smidt 2016-11-30 10:23:19 CET
(In reply to Felix Botner from comment #10)
> (In reply to Felix Botner from comment #9)
> > (In reply to Michel Smidt from comment #8)
> > > (In reply to Felix Botner from comment #7)
> > > > This change is pretty much useless until we decide to fix Bug #42545.
> > > 
> > > No, I wouldn't say this. With this bug the the AD-Connector do not even
> > > start syncing if the user is not in the users container.
> > > Bug #42545 is about a fragile "guess_ad_domain_language". In this case a
> > > consequential error.
> > > Nevertheless I would like to vote to fix both bugs ;-)
> > 
> > No, unless Bug #42545 is fixed the binddn user (if not already member of
> > Domain Admins in UCS) is removed from Domain Admins in AD. After that the
> > connector sync is broken (as the user has no longer the rights to
> > create/modify objects in AD).
> 
> sorry, it is Bug #43070

Well, then I am with you.
Comment 12 Felix Botner univentionstaff 2016-11-30 15:23:27 CET
(In reply to Felix Botner from comment #6)
> Added get_ad_binddn_from_name to
> univention.management.console.modules.adconnector. Here, ldbsearch with
> username and password is used to get the dn of the "username" object.
> 
> Default is still cn={username},cn=users,{LDAP_Base} but if
> get_ad_binddn_from_name finds something, this DN is used.
> 
> univention-ad-connector.yaml errata 4.1-4
> 
> merged to 4.2-0
> 
> But, we have to wait for Bug #43070

done, tested with 

-> ucr get connector/ad/ldap/binddn 
CN=myadm,CN=groups,DC=w2k12,DC=test
Comment 13 Stefan Gohmann univentionstaff 2016-12-09 06:21:42 CET
Code review: OK

Merge to UCS 4.2: OK

Tests: OK

Jenkins tests: OK

YAML: OK (r75142)
Comment 14 Janek Walkenhorst univentionstaff 2016-12-14 12:36:44 CET
<http://errata.software-univention.de/ucs/4.1/359.html>