Bug 50527 - AD Member Mode breaks UDM REST API (configuration)
AD Member Mode breaks UDM REST API (configuration)
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-21 11:54 CET by Felix Botner
Modified: 2021-09-01 10:55 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
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 Felix Botner univentionstaff 2019-11-21 11:54:26 CET
* Standard UCS master (with UDM REST API)
* ucr get directory/manager/rest/authorized-groups/domain-admins
  cn=Domain Admins,cn=groups,dc=autotest224,dc=local
* AD Member Mode with german Windows AD server
* during the Member Mode initialization the group cn=Domain Admins is renamed
  to cn=Domänen-Benutzer
* now directory/manager/rest/authorized-groups/domain-admins holds the wrong 
  group name and authentication to the REST API no longer works

Workaround:

$ ucr unset directory/manager/rest/authorized-groups/domain-admins
$ univention-run-join-scripts --force --run-scripts 22univention-directory-manager-rest.inst
Comment 1 Ingo Steuwer univentionstaff 2019-11-26 14:57:59 CET
The UDM REST API default ACLs need to be updated if directory/manager/rest/authorized-groups/domain-admins changes.
Comment 2 Florian Best univentionstaff 2019-11-26 15:00:00 CET
(In reply to Ingo Steuwer from comment #1)
> The UDM REST API default ACLs need to be updated if
> directory/manager/rest/authorized-groups/domain-admins changes.
Hm?
The UCR-Variable is the ACL.
The member mode must change directory/manager/rest/authorized-groups/domain-admins, later than the joinscript runs.
So basically we need some hook mechanism in the AD member mode configuration which sets this UCR variable (and probably others as well).
Comment 3 Ingo Steuwer univentionstaff 2019-11-26 16:17:04 CET
(In reply to Florian Best from comment #2)
> (In reply to Ingo Steuwer from comment #1)
> > The UDM REST API default ACLs need to be updated if
> > directory/manager/rest/authorized-groups/domain-admins changes.
> Hm?
> The UCR-Variable is the ACL.
> The member mode must change
> directory/manager/rest/authorized-groups/domain-admins, later than the
> joinscript runs.
> So basically we need some hook mechanism in the AD member mode configuration
> which sets this UCR variable (and probably others as well).

Ah, what I meant is not this UCR variable, my fault.

The LDAP ACLs use a function of univention.lib.misc to identify the "Domain Admins" group, for example in slapd.conf template 60univention-ldap-server_acl-master:

----
from univention.lib.misc import custom_username, custom_groupname

[...]

groups_default_domainadmins = custom_groupname('Domain Admins')
users_default_administrator = custom_username('Administrator')
----

We should have the same behaviour for the UDM REST API.
Comment 4 Florian Best univentionstaff 2019-11-26 16:29:34 CET
We already have this behavior:

~/git2/ucs/management/univention-directory-manager-rest
$ git grep -A 2 custom_groupname
22univention-directory-manager-rest.inst:domain_admins_dn="$(umc_udm groups/group list --filter name="$(custom_groupname "Domain Admins")" | sed -ne 's/^DN: //p')"
22univention-directory-manager-rest.inst-ucr set \
22univention-directory-manager-rest.inst-       directory/manager/rest/authorized-groups/domain-admins?"$domain_admins_dn" \
Comment 5 Florian Best univentionstaff 2019-11-26 17:24:16 CET
For our internal Jenkins test a workaround has been commited, which should be reverted when this bug is fixed:

8d69bfb9d539 | Bug #50527: add workaround
Comment 6 Ingo Steuwer univentionstaff 2019-11-27 12:03:11 CET
(In reply to Florian Best from comment #4)
> We already have this behavior:
> 
> ~/git2/ucs/management/univention-directory-manager-rest
> $ git grep -A 2 custom_groupname
> 22univention-directory-manager-rest.inst:domain_admins_dn="$(umc_udm
> groups/group list --filter name="$(custom_groupname "Domain Admins")" | sed
> -ne 's/^DN: //p')"
> 22univention-directory-manager-rest.inst-ucr set \
> 22univention-directory-manager-rest.inst-      
> directory/manager/rest/authorized-groups/domain-admins?"$domain_admins_dn" \

This is the join script? Then it is only applied during the initial installation. The rename of the group is done later during the configuration of the AD connection.
Comment 7 Florian Best univentionstaff 2019-11-27 15:06:56 CET
(In reply to Ingo Steuwer from comment #6)
> This is the join script? Then it is only applied during the initial
> installation. The rename of the group is done later during the configuration
> of the AD connection.

Yes.