Bug 53130 - Obsolete ?entryDN? in UCS@school set-style LDAP ACLs slows down ACL performance
Obsolete ?entryDN? in UCS@school set-style LDAP ACLs slows down ACL performance
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: LDAP
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
https://www.openldap.org/faq/data/cac...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-04-21 19:09 CEST by Arvid Requate
Modified: 2021-04-23 17:48 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
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): Large environments, UCS Performance
Max CVSS v3 score:
requate: Patch_Available+


Attachments
proposal1.patch (9.67 KB, patch)
2021-04-21 19:09 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2021-04-21 19:09:00 CEST
The set-style LDAP ACLs in UCS@school which make use of ldap:/// search expansion look  slightly suboptimal to me, as they specify things like

by set="this/ucsschoolSchool & ([ldap:///]+user/entryDN+[?entryDN?base?<some-LDAP-filter>])/ucsschoolSchool" write

According to the OpenLDAP FAQ the dereferenced LDAP URL

[ldap:///]+user/entryDN+[?entryDN?base?<some-LDAP-filter>])/ucsschoolSchool

doesn't only expand to the value of ucsschoolSchool but additionally to the value of entryDN. I can see that with log level "acl" too. Those two values are vompated against the school ou of the target (this/ucsschoolSchool). Clearly the entryDN will not match in that comparison.


So I'd propose to optimize those acls by removing the explicit "entryDN" from the LDAP URL like this:

by set="this/ucsschoolSchool & ([ldap:///]+user/entryDN+[??base?<some-LDAP-filter>])/ucsschoolSchool" write

Probably it doesn't cost much performance, but I haven't measured how this affects a master /primary in a large school environment.
Comment 1 Arvid Requate univentionstaff 2021-04-21 19:09:41 CEST
Created attachment 10694 [details]
proposal1.patch
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2021-04-22 09:46:18 CEST
More detailed information about the ldap-search:
https://www.openldap.org/faq/data/cache/1133.html
Comment 3 Daniel Tröder univentionstaff 2021-04-23 17:48:53 CEST
It seems the '?entryDN?' is unnecessary. It will be added to the result attributes of the search. It will however not be used for comparison, so it is merely a small memory loss.

Those ACLs are only used when an OU Admin or Teacher is logged into the UMC on the Primary Node and is manually administrating users/classes/workgroups.
The ACLs are not installed on the replication nodes.
So this is not performance relevant.

Still it is unnecessary and the ACLs are difficult to read already. So Sönke and I concur that the ACLs should be modified like the OP suggests.