LDAP via Samba4 nicht mehr erreichbar

Hallo zusammen,

ich habe UCS 4.1.4 errata410 im Einsatz, 1x DC Master und 1x DC Backup.
Das Setup läuft seit Monaten stabil und wurde in den letzten 4 Wochen nicht verändert. Von heute auf morgen ist nun in Nagios folgender Fehler auf der DC Master eingetragen: “S4CONNECTOR CRITICAL: Could not connect to samba server!”.
In der Tat ist es nun so, dass der LDAP via Samba4 über Port 389 oder 636 ist mehr erreichbar ist. Das hat zur Folge, dass auch andere Dienst wie z.B. OpenVPN die so konfiguriert waren über LDAP die Benutzerauthentifizierung durchzuführen nicht mehr funktionieren.

“univention-s4search” liefert folgendes Ergebnis:

Failed to connect to ldap URL 'ldaps://dc.domain.com' - LDAP client internal error: NT_STATUS_CONNECTION_DISCONNECTED Failed to connect to 'ldaps://dc.domain.com' with backend 'ldaps': (null) Failed to connect to ldaps://dc.domain.com - (null)

Das Aufgeben eines Kerberos Tickets via kinit funktioniert.
Ein Neuprovisionieren des Samba4 DC wie hier beschrieben http://sdb.univention.de/content/6/274/en/re_provisioning-samba4-on-a-dc-master.html
brachte ebenfalls keinen Erfolg.

Aktuell komme ich hier nicht weiter… Wo sollte man als nächstes Ansetzen ?

[UPDATE]
Wenn ich in der /etc/samba/smb.conf
“ldap server require strong auth = allow_sasl_over_tls” durch “ldap server require strong auth = no” funktioniert der ungesicherte Zugriff über 389 wieder. 636 scheitert nach wie vor. Das Thema scheint also irgendwie in Richtung TLS und sasl zu gehen…

[UPDATE2]
Es hängt definitiv am Zertifikat.
Wenn ich mir per “openssl req -newkey rsa:2048 -keyout myKey.pem -nodes -x509 -days 365 -out myCert.pem” ein neues Zertifikat erstelle und manuell in der smb.conf hinterlege geht der Zugriff sofort, auch der S4 Connector geht dann wieder.
Wenn ich jedoch über “univention-certificate new -name dc.domain.com -days 1825” ein Zertifikat erstelle komme ich zum beschriebenen Fehlerbild.

Beste Grüße,
Ludwig

Dear @lw3234,

what settings do you have?

root@ucs:~$ ucr get ssl/default/hashfunction

and what hashing is used in your certificates?

#RootCA
root@ucs:~$ openssl x509 -in /etc/univention/ssl/ucsCA/CAcert.pem -noout -text | grep "Signature Algorithm:"
root@ucs:~$ openssl x509 -in /etc/univention/ssl/$(hostname -f)/cert.pem -noout -text | grep "Signature Algorithm:"

The used hashing should not be MD5!

—EDIT—
In case your RootCA still uses MD5 you have to renew the complete cert chain!

Hi,

the CAcert uses SHA256 (2048Bit), the hostcertificate is SHA512 (4096Bit). The default is SHA512.

Could it be an issue that the hash functions for the 2 certificates differ from each other ?

Ok… solved the problem !

Obviously Samba4 has a problem with SHA512. After generating a new host certificate using SHA256 LDAPS works again as exspected.

After the first creation of the hosts certificate the default hash has been changed from SHA256 to 512 where the last one was then used to renew the hosts certificate lately causing the problem.

Thanks for the lead to the solution :slight_smile:

Hi! Just as a quick remark: This might be related to GnuTLS, which is used by Samba. The version of GnuTLS in UCS 4.1 is a bit rusty. I didn’t test it, but I wouldn’t be surprised if SHA512 works with the newer version in UCS 4.2.

Mastodon