Bug 50052 - [UDM HTTP API] support read-only cn=admin connection
[UDM HTTP API] support read-only cn=admin connection
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: 50051
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-25 08:45 CEST by Daniel Tröder
Modified: 2019-09-22 15:51 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
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): Workaround is available
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-08-25 08:45:59 CEST
+++ This bug was initially created as a clone of Bug #50051 +++

UCS@school installs very complex LDAP ACLs.
Traversing them takes time → costs performance.
In some situations the identity of the client has already been verified and thus the backend code uses a cn=admin connection for performance reasons.
In dry-runs or when only retrieving information from LDAP, a connection that does not allow (accidentally) writing to LDAP is used.

Support using a read-only cn=admin connection with the UDM HTTP API.
Comment 1 Florian Best univentionstaff 2019-09-01 22:32:05 CEST
There is no such thing as a read only cn=admin connection. cn=admin has all permissions and there is no way to restrict this.

If you want a read only connection, create any user which has read permissions to everything and write permissions to nothing. Then use that user.
I think this can be done in a UCS@school joinscript and ACL's.

What does the UDM REST API need to do here?
Comment 2 Daniel Tröder univentionstaff 2019-09-02 08:13:12 CEST
(In reply to Florian Best from comment #1)
> There is no such thing as a read only cn=admin connection. cn=admin has all
> permissions and there is no way to restrict this.
> 
> If you want a read only connection, create any user which has read
> permissions to everything and write permissions to nothing. Then use that
> user.
The cn=admin user get's special treatment in the LDAP ACLs. That speeds up things a lot. Using that user is a requirement for a fast import.

If I connect with a user... let's say "admin-ro"... that should represent that cn=admin r/o connection, then I want the UDM REST API to use a cn=admin connection, but have all write operations disabled in the uldap Python code.

In UCS@school we have an implementation here:
https://git.knut.univention.de/univention/ucsschool/blob/4.4/ucs-school-import/modules/ucsschool/importer/utils/ldap_connection.py#L129