Bug 41220 - replace windows password service with python samba drsuapi.DsGetNCChangesRequest8/samr.SetUserInfo
replace windows password service with python samba drsuapi.DsGetNCChangesRequ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: AD Connector - Windows password service
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 3.2-8-errata
Assigned To: Stefan Gohmann
Arvid Requate
:
Depends on: 40745
Blocks: 41365 41632
  Show dependency treegraph
 
Reported: 2016-05-09 14:30 CEST by Stefan Gohmann
Modified: 2016-09-21 20:34 CEST (History)
6 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2016-05-09 14:30:17 CEST
This should be backported to UCS 3.2.


+++ This bug was initially created as a clone of Bug #40745 +++

Here two python scripts for setting/getting the nt hash on/from a windows ad server.
Maybe as replacement for our password service:

NT get: uses drsuapi.DsGetNCChangesRequest8() - https://msdn.microsoft.com/en-us/library/dd207691.aspx

NT set: samr.SetUserInfo - https://msdn.microsoft.com/en-us/library/cc245793.aspx
Comment 1 Stefan Gohmann univentionstaff 2016-05-12 15:18:05 CEST
I've backported the patch: r69288
YAML: r69289
Test Case: r69296
Comment 2 Arvid Requate univentionstaff 2016-05-31 11:12:18 CEST
I think we should adjust the code to address Bug 41247
Comment 3 Stefan Gohmann univentionstaff 2016-07-04 09:06:36 CEST
(In reply to Arvid Requate from comment #2)
> I think we should adjust the code to address Bug 41247

Done: r70478

YAML: r70479
Comment 4 Arvid Requate univentionstaff 2016-07-19 21:17:18 CEST
Code Merge: Complete
Functional Test: Ok
Advisory: Ok
Comment 5 Arvid Requate univentionstaff 2016-07-19 22:29:45 CEST
I also tested with AD-Connection-Mode (aka Member-Mode): Ok.

Due to the default of connector/ad/mapping/user/password/kinit=true the new DRS code isn't used until the steps described in http://sdb.univention.de/1332 are performed, so there are no immediate rejects due to the connector/ad/ldap/binddn being set by default to the unprivileged machine account.

Just to document the type of log messages I get when following SDB 1332 but still using the machine account (or some other underprivileged account):
==============================================================================
19.07.2016 22:52:34,292 LDAP        (PROCESS): sync to ucs:   [          user] [    modify] uid=wuser1,cn=users,dc=w2k8r2d2,dc=ar
19.07.2016 22:52:34,299 LDAP        (ERROR  ): failed in post_con_modify_functions
19.07.2016 22:52:34,299 LDAP        (ERROR  ): Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/univention/connector/__init__.py", line 1281, in sync_to_ucs
    f(self, property_type, object)
  File "/usr/lib/pymodules/python2.6/univention/connector/ad/password.py", line 383, in password_sync
    res = get_password_from_ad(connector, univention.connector.ad.compatible_modstring(object['dn']))
  File "/usr/lib/pymodules/python2.6/univention/connector/ad/password.py", line 183, in get_password_from_ad
    (level, ctr) = connector.drs.DsGetNCChanges(connector.drsuapi_handle, 8, req8)
RuntimeError: (8439, 'WERR_DS_DRA_BAD_DN')
==============================================================================

So there would be rejects in that case which will go away when configuring a privileged account instead.
Comment 6 Janek Walkenhorst univentionstaff 2016-07-21 14:01:50 CEST
<http://errata.software-univention.de/ucs/3.2/443.html>