Problem: Domain Admins cannot create objects after restricting anonymous LDAP access

Problem

Members of Domain Admins cannot create directory objects through Univention Management Console (UMC) after anonymous LDAP read access is disabled and IP exceptions are configured. This prevents administrators from provisioning objects using their personal administrative accounts.

Modifying and deleting existing objects still works for direct group members. Object creation using the built-in Administrator account remains possible.

Investigation

Check the anonymous access configuration and the generated ACL:

ucr get ldap/acl/read/anonymous
ucr get ldap/acl/read/ips
ldap/acl/read/anonymous='no'
ldap/acl/read/ips='127.0.0.1,10.200.43.10,10.150.2.161'

The affected ACL contains IP-based read permissions before the subsequent Domain Admins write permissions:

access to dn.subtree="dc=schein,dc=smb" attrs=entry,uid,univentionObjectIdentifier
   by peername.ip=127.0.0.1 read
   by peername.ip=10.200.43.10 read
   by peername.ip=10.150.2.161 read
   by anonymous auth
   by * +0 break

These IP rules also match authenticated connections. A matching rule stops ACL evaluation with read permissions, preventing subsequent write permissions from taking effect.

For direct Domain Admins members, earlier ACLs already permit writing entry and several ordinary attributes. However, they do not include univentionObjectIdentifier, which UDM assigns during object creation. Consequently, creation fails with LDAP error 50 (Insufficient access), while ordinary modifications and deletion can still succeed.

Solution

Apply one of the following alternatives in the UCR template:

/etc/univention/templates/files/etc/ldap/slapd.conf.d/70univention-ldap-server_acl-master-end

Do not modify only /etc/ldap/slapd.conf: UCR regenerates that file. Back up the template before editing. Local template changes survive configuration regeneration and service restarts but must be reviewed after package updates.

Alternative 1 — Restrict the IP exceptions to anonymous connections

In the block generating the ACL for entry,uid,univentionObjectIdentifier, change:

print('   by peername.ip=%s read' % ip)

to:

print('   by anonymous peername.ip=%s read' % ip)

Change the occurrence within this specific block; the template also contains an IP loop for the final access to * ACL.

The resulting ACL is:

access to dn.subtree="dc=schein,dc=smb" attrs=entry,uid,univentionObjectIdentifier
   by anonymous peername.ip=127.0.0.1 read
   by anonymous peername.ip=10.200.43.10 read
   by anonymous peername.ip=10.150.2.161 read
   by anonymous auth
   by * +0 break

Authenticated administrators reach the subsequent authorization rules, while anonymous clients retain the configured IP exceptions.

Alternative 2 — Grant Domain Admins write access before evaluating IP exceptions

Adding the Domain Admins write rule before the IP rules in the same ACL block is also possible.

Edit the UCR template
/etc/univention/templates/files/etc/ldap/slapd.conf.d/70univention-ldap-server_acl-master-end.

Within its existing @!@ Python block, insert the following line immediately after the statement generating access to ... attrs=entry,uid,univentionObjectIdentifier. *This is template Python code, not LDAP configuration syntax; do not insert it into /etc/ldap/slapd.conf.

print('   by set="user & [cn=%s,cn=groups,%s]/uniqueMember*" write' % (groups_default_domainadmins, ldap_base))

For the example domain, this generates:

access to dn.subtree="dc=schein,dc=smb" attrs=entry,uid,univentionObjectIdentifier
   by set="user & [cn=Domain Admins,cn=groups,dc=schein,dc=smb]/uniqueMember*" write
   by peername.ip=127.0.0.1 read
   by peername.ip=10.200.43.10 read
   by peername.ip=10.150.2.161 read
   by anonymous auth
   by * +0 break

It resolves the Domain Admins case, but other authenticated accounts relying on subsequent write permissions may still encounter the IP-based read restriction.

After applying either alternative, regenerate and validate the configuration:

ucr commit /etc/ldap/slapd.conf
slaptest -u -f /etc/ldap/slapd.conf

Proceed only if validation succeeds. Restarting the service temporarily interrupts OpenLDAP connections; schedule an appropriate maintenance window. Review other LDAP servers individually rather than restarting all servers simultaneously.

systemctl restart slapd.service