Configurer un domaine de type "Annuaire LDAP" avec des contrôleurs de domaine utilisant le protocole LDAP over SSL


Niveau d'utilisateur 2
Badge

Version française


Les communications avec un contrôleur de domaine configuré afin d’utiliser le protocole “LDAP over SSL” nécessitant de reconnaître l’autorité de certification fourni par le protocole LDAPS, il est nécessaire que cette autorité de certification soit installée sur le serveur de médiation de la solution.

Pour cela, il est nécessaire dans un premier temps d’extraire le certificat CA depuis le contrôleur de domaine puis de l’importer sur le serveur de médiation.

Plusieurs méthodes sont possibles afin d’extraire le certificat CA qui sera présenté lors d’une connexion LDAPS, nous n’en présenterons qu’une dans cet article.

 

Identification du certificat CA

Depuis une passerelle Cleanroom, la commande suivante permet de contrôler le certificat qui sera présenté lors d’une connexion LDAPS (indiquer l’adresse du contrôleur de domaine qui sera contacté ainsi que le port).

Cette opération est à effectuer pour chaque contrôleur de domaine afin d’identifier chaque certificat CA car ceux-ci peuvent être différents entre les contrôleurs de domaine.

openssl s_client -connect adresse_controleur_domaine:port -showcerts < /dev/null | grep "CN ="

Plusieurs lignes seront retournées par la commande. Les lignes utiles sont les suivantes (exemple):
 0 s:CN = server.domain.local    i:DC = local, DC = domain, CN = DOMAIN-CA subject=CN = server.domain.local issuer=DC = local, DC = domain, CN = DOMAIN-CA

Ces lignes indiquent les informations du certificat qui sera utilisé lors de l’établissement de la connexion LDAPS.

Dans cet exemple, le certificat “server.domain.local” ne dispose que d’un niveau d’autorité de certification qui sera “DOMAIN-CA”. Il s’agit de ce certificat qu’il est nécessaire de récupérer depuis le contrôleur de domaine. Si plusieurs niveaux d’autorité de certifications sont présents, il sera nécessaire de récupérer chaque niveau.

 

Récupération du certificat CA

Suite à l’identification du certificat CA, il est nécessaire de récupérer ce certificat depuis le contrôleur de domaine.

Depuis le contrôleur de domaine, exécuter la console de gestion des certificats ordinateur (commande “certlm.msc”). Dans la catégorie “Autorités de certification racines de confiance”, “Certificats” identifier le CN du certificat CA identifié précédemment (DOMAIN-CA dans notre exemple).

Ensuite, exporter le certificat: effectuer un clic droit sur le certificat, Toutes les tâches, Exporter. Lors du choix du format à utiliser, il est nécessaire de sélectionner “X.509 encodé en base 64 (*.cer)”.

Lorsque le certificat aura été exporté, renommer son extension en “.crt” car il s’agit du format qui sera utilisé par Linux.

 

Mise en place du certificat CA

Le certificat ayant été récupéré, il est nécessaire de mettre en place celui-ci sur le serveur de médiation.

Transférer le fichier vers le répertoire “/usr/local/share/ca-certificates/” du cerveur de médiation.

Ensuite, depuis une connexion SSH et en utilisant un compte à pouvoir (root par exemple), exécuter la commande “update-ca-certificates” afin de mettre à jour la liste des autorités CA reconnues par le serveur de médiation.

Si l’ajout a bien été effectué, le retour devrait être “[...] 1 added [...]”

La mise en place du certificat CA est terminé.

Le domaine peut désormais être ajouté dans Cleanroom. Si le domaine avait déjà été configuré dans l’interface de configuration de Cleanroom, il est nécessaire revalider la configuration de celui-ci afin d’établir la connexion.

 

 English version


Communications with a domain controller configured to use “LDAP over SSL” protocol require recognition of the certification authority provided by the LDAPS protocol. This certification authority must therefore be installed on the solution's mediation server.

The CA certificate must first be extracted from the domain controller and then imported into the mediation server.
There are several possible methods for extracting the CA certificate that will be presented during an LDAPS connection, but only one of them will be described in this article.
 

Identifying the CA certificate

From a Cleanroom gateway, the following command allows to check the certificate that will be presented during an LDAPS connection (indicate the address of the domain controller to be contacted and the port).
This operation must be performed for each domain controller in order to identify each CA certificate, as these may differ between domain controllers.

openssl s_client -connect domain_controller_address:port -showcerts < /dev/null | grep "CN ="

Several lines will be returned by the command. The following lines are useful (example):

 0 s:CN = server.domain.local    i:DC = local, DC = domain, CN = DOMAIN-CA subject=CN = server.domain.local issuer=DC = local, DC = domain, CN = DOMAIN-CA

These lines indicate the certificate information that will be used to establish the LDAPS connection.

In this example, the "server.domain.local" certificate has only one certification authority level, which will be "DOMAIN-CA". It is this certificate that needs to be retrieved from the domain controller. If several CA levels are present, it will be necessary to retrieve each level.

 

Retrieving the CA certificate

Once the CA certificate has been identified, it needs to be retrieved from the domain controller.
From the domain controller, run the computer certificate management console (command "certlm.msc"). In the "Trusted Root Certification Authorities" category, "Certificates", identify the CN of the CA certificate previously identified (DOMAIN-CA in our example).
Next, export the certificate: right-click on the certificate, All tasks, Export. When choosing the format to use, select "X.509 encoded in base 64 (*.cer)".
Once the certificate has been exported, rename its extension to ".crt", as this is the format that will be used by Linux.

 

Implementing the CA certificate

Once the certificate has been retrieved, it needs to be implemented on the mediation server.
Transfer the file to the "/usr/local/share/ca-certificates/" directory on the mediation server.
Then, using an SSH connection and a privileged account (root for example), run the "update-ca-certificates" command to update the list of CA authorities recognized by the mediation server.
If the addition has been successful, you should obtain the following message "[...] 1 added [...]”
The implementation of the CA certificate is now complete.
The domain can now be added to Cleanroom. If the domain had already been configured in Cleanroom's configuration interface, it is necessary to revalidate its configuration in order to establish the connection.
 

 


This topic has been closed for comments