Configure TLS/SSL 389 Directory Server CentOS

Configure TLS/SSL 389 Directory Server CentOS

Configure TLS/SSL 389 Directory Server CentOS

389 Directory server is an amazing MultiMaster LDAP solution. Out of the box 389 is not configured to use TLS/SSL, so we are going to walk through the setup process. Please note, that we are using this as a test, so we are using a self-signed certificate, but the directions should work for both scenarios.

login, and su to root

Root shell on test389 before creating a local Certificate Authority for 389 DS

Generate the Self-Signed Certificate:

change to the necessary directory, and setup a few files for the CA

Initializing /etc/pki/CA with index.txt, serial and crlnumber for the local CA

now generate the key/certificate

Running openssl to generate the self-signed CA key and certificate

setup your certificate as appropriate

openssl prompts filling Country, State Wisconsin, City Milwaukee and CN test389.domain.local

set permissions on the cert key

Setting chmod 400 on private/ca-cert.key for the local CA private key

now we need to make sure certificate matching is disabled (unless you are using a full cert)

Opening /etc/pki/tls/openssl.cnf to relax policy_match certificate fields

modify lines 85-88 as follows:

openssl.cnf policy_match section with countryName stateOrProvinceName and organizationName set optional

Generate and Self-Sign Certificate

launch the 389-console

open the directory server you were just working on, and click “Manage Certificates”

Servername –> Directory Server –> Manage Certificates

389 Directory Server Console opening Manage Certificates for the instance

set, and REMEMBER the 1st time password

Set Security Device Password dialog for the Internal Software Token

Under Server Certs, click “Request”

This step, select request manually

Manage Certificates Request dialog set to request the certificate manually

fill out the request wizard as follows:

Certificate Request Wizard step entering CN test389.domain.local and organization fields

enter a “token password” for the certificate

Certificate Request Wizard token password prompt before writing the CSR

now save to file

/tmp/test389.domain.local.csr

Saving the CSR file as /tmp/test389.domain.local.csr from the request wizard

click save, and then done.

now move the CSR to a usable directory within the CA

Moving the CSR into the CA directory tree before signing it

Authorize the Cert with the CA

 openssl ca -in /etc/pki/CA/crl/test389.domain.local.csr -out /etc/pki/CA/newcerts/test389.domain.local.crt  -keyfile /etc/pki/CA/private/ca-cert.key -cert /etc/pki/CA/certs/ca-cert.crt

you should see the following, if not double-check your steps

openssl ca signing output certifying test389.domain.local and commit prompt answered y

Install/Enable Certificate 389 Directory Server

launch the 389-console

Login to Directory Server –> Manage Certificates

The first thing you want to do is install the CA Cert from the CA Cert Tab

Manage Certificates CA Certs tab ready to install the local CA certificate

hit next

Certificate Install Wizard selecting the CA certificate file ca-cert.crt
Certificate Install Wizard trust settings for the CA identifying clients and servers

now our CA Cert is installed

Manage Certificates CA Certs tab listing the trusted test389.domain.local CA

now we need to install our Server Cert from the Server Cert Tab

Server Certs tab ready to install the signed server certificate

next

Certificate Install Wizard next step for the server certificate file

enter the password from earlier when you were creating the CSR

Token password prompt while installing the signed server certificate

Bam! Installed

Manage Certificates Server Certs tab showing server-cert installed successfully

Enable Server Encryption

Directory Server –> Encryption

Directory Server Encryption screen to enable TLS for the 389 instance

** MAKE SURE TO SAVE YOUR CONFIGURATION!!! **

Enable PIN For Directory Service Restarts

389 requires a “pin” or password for the certificate in order to start encryption when the server restarts, here’s what we need to do to configure that:

create a PIN File

Creating /etc/dirsrv/slapd-test389/pin.txt for the certificate token password

enter the certificate password into the PIN file

pin.txt contents with Internal (Software) Token and the certificate password

change permissions on the PIN file so only root can read it

Running chmod 400 on pin.txt so only root can read the token password

now restart the directory service to be sure, if there’s an error, the service will not start

service dirsrv restart completing with OK after enabling 389 DS encryption

That’s it! You have configured TLS/SSL On 389 directory Server

To configure a Secure TLS LDAP Client, click here

Hosted Linux Servers at www.zwiegnet.com/go

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *