#6461 LDAP Connection Management refactoring
Closed: Fixed Opened by tkrizek.

In FreeIPA 4.4 there are multiple ways to establish an LDAP connection. Connections are also established and re-used in random places.

The refactoring effort focuses on:

  • providing a unified way to use LDAP connections
  • proper connects and disconnects at the star/end of scripts
  • proper reconnects when Directory Server is restarted

master:

  • 5760b7e983da6bda8f5383d9079551e4acb4c2da ipaldap: remove wait/timeout during binds
  • de58a5c60596de8b45c8016c3318bac78305477a ipaldap: merge simple_bind into LDAPClient
  • 60e38ecc7ff6b983f4f3af0a66c08eb3a3fda22d ipaldap: merge external_bind into LDAPClient
  • 4f1a6a177666c475156f496d3f7719b37e66a7b0 ipaldap: merge gssapi_bind to LDAPClient
  • 5b81dbfda1e4f0799d4ce87e9987a896af3ff299 ipaldap: merge IPAdmin to LDAPClient
  • 9340a1417acf120fed3e9ffbe9d658d3456743a1 install: remove dirman_pw from services
  • 24baccbd6ac8a19ba52619a3cc59366220c4ca1f dsinstance: enable ldapi and autobind in ds
  • 9fca820b6bc2144cd827bddba69cb53f8ba3f42a replicainstall: set ldapi uri in replica promotion
  • 7a1c0db989cf59a778676635e160f73ebc610694 cainstall: add dm_password to CA installation
  • e2780b2106a6e6bab0cb3f3d3ec06482cde9d374 ldap2: change default time/size limit
  • 8934d03b3b5bbf02e9e20a1644ef31d27fa0f483 dsinstance: conn management
  • e8aa2627c7a3dcb0b0745e656ea58ccbbccd38fb upgradeinstance: ldap conn management
  • e05bdeb6cf4505ef84e485b95b37aabba625160b install: add restart_dirsrv for directory server restarts
  • a77469f5984b12e201a3d349efad1ca2925ee5af install: remove adhoc api.Backend.ldap2 (dis)connect
  • df86efdc69271cca0774868ab85b5be7df529136 install: ldap conn management
  • 49ff159a5f0cfd2f9d037ad00e75d8ac5bfba585 replicainstall: properly close adhoc connection in promote
  • c51b04fae77149a09e921495c5b3c9802d199076 ldapupdate: use ldapi in LDAPUpdate
  • 03d113cdd7c5f943d8937eb4fec1086bfe47e909 install: remove adhoc dis/connect from services
  • 1240262a0b01ff8408c06058d6d4d61fc5cde548 ipa-adtrust-install: ldap conn management
  • 36d95472d983ff342a43a5df36d932b9de8c32ac ldap2: change default bind_dn
  • 922062eb559d1bb82a9d787763aacb31c0cf9b8d install tools: ldap conn management
  • 7d028992ea2c2bf6acabe79f101621bdebbf9dbc replicainstall: correct hostname in ReplicationManager
  • a9585ec563d1e54c3cd7de14789457f72cd00843 replicainstall: use ldap_uri in ReplicationManager
  • 41098e3f7bb517f7445ed34d555bc3fb2083c6ce ldap2: modify arguments for create_connection

Leaving ticket opened, there might be some minor enhancements or fixes. Please close it when refactoring of LDAP connections is done.

master:

  • 33f7b8dc32bc95e0db067ac4df49807ee2b5120e libexec scripts: ldap conn management

9340a1417acf120fed3e9ffbe9d658d3456743a1 removes Directory Manager password from nolog which causes it to appear in ca/kra installation logs.

Nice catch, Standa. I missed this one.

In 9340a1417acf120fed3e9ffbe9d658d3456743a1 I removed the dm_password from no_log as well as the class, so that change in itself was fine. However, when I realized CA can't be installed without dm_password, I re-added it in 7a1c0db989cf59a778676635e160f73ebc610694 without appending it to no_log.

master:

  • a68c95d11612108375877ff45bdb53ce6fc8fbe4 ipaldap: remove do_bind from LDAPClient

master:

  • f183f70e0183e51d569ada972bd3ec73cad76a30 dns: check if container exists using ldapi

There is a regression with ipa-ca-install on a DL-0 replica:

$ ipa-ca-install /home/frenaud/replica-info-vm-159.abc.idm.lab.eng.brq.redhat.com.gpg 
Directory Manager (existing master) password:
Run connection check to master
Connection check OK
ipa         : CRITICAL CA DS schema check failed. Make sure the PKI service on the remote master is operational.
Your system may be partly configured.
Run /usr/sbin/ipa-server-install --uninstall to clean up.
Unexpected error - see /var/log/ipareplica-ca-install.log for details:
DatabaseError: Connect error: Start TLS request accepted.Server willing to negotiate SSL.

The commit 5b81dbfda1e4f0799d4ce87e9987a896af3ff299 seems to be the culprit as it is using (in ipaserver/install/cainstance.py, line 1307)

cacert=config.dir + "/ca.cer"

instead of

cacert=config.dir + "/ca.crt"

master:

  • d6300dca285acaad296f6271421c23999e3c1071 cainstance: use correct certificate for replica install check

master:

  • 68295bf8cfd57333deb50f58df1b336a4b48ffe7 services: replace admin_conn with api.Backend.ldap2
  • 0914fc6a6043846159f6d1c4bb433dcfe9ee3f46 upgrade: ldap conn management

master:

  • e617f895e70e6812836870f504af6e22a5dc7def Do not log DM password in ca/kra installation logs

Metadata Update from @tkrizek:
- Issue assigned to tkrizek
- Issue set to the milestone: FreeIPA 4.5

Metadata