Vault - What is the correct placement of Domain Certificates in order to enable LDAPS communication to the domain
Question
How can we ensure the correct certificates are placed in the right stores on the vault server Windows Certificate Store?
Environment
Privileged Access Manager (PAM, self-hosted) Vault Server
Answer
LDAPS Background
In Windows Domain Controllers, LDAPS communication is enabled by the issuance of a domain controller certificate to the DC server, as described in the Microsoft KB below:
Once a certificate that meets the LDAPS certificate requirements is issued to the DC machine by the organization's CA, LDAPS over port 636 will be enabled for client/server communication.
Domain Controller Side Certificates
We can verify this by going to the DC > Local Machine Certificate Store > Personal > Certificates
We will see a certificate that includes an associated private key, supports Server and Client authentication usage, and is usually published based on a "Domain Controller" template.
As seen in the example below (taken from a DC server):
When the vault connects to the DC, this certificate will be presented in the SSL handshake, and in order to establish the connection, the vault needs to trust this certificate.
To establish trust, the vault needs to have in place (ahead of time) the Root CA certificate of the CA that signed the domain controller's personal certificate, and any issuing certificate that is in the chain between the Root and the Personal cert.
To inspect the chain, we can open the certificate on the DC side and go to the Certification Path tab:
We will need to open (double-click) and export each certificate in the chain above the DC's certificate (as a .cer file), and bring those over to the vault for installation.
To export a certificate:
Go to the 'Details' Tab > click 'Copy To File' > Click 'Next' > Select 'Base-64 encoded X.509 (.CER)' > Click 'Browse' and select a location and file name > Click 'Save' > Click 'Next' > Click 'Finish'
Vault Side Certificates
Once on the vault, each certificate needs to be installed into the Local Machine appropriate certificate store-
- The Root CA (top of the chain), needs to be installed into the "Trusted Root Certification Authorities" store.
- The intermediate/issuing certificates (middle of the chain), need to be installed into the "Intermediate Certification Authorities" store.
As seen in the example below (vault side)
Root CA certificate in the Root CA store-
Issuing CA certificate in the Intermediate CA store:
Once in place, the communication to LDAP over SSL port 636 can be established and SSL trust is configured between the vault and the domain.
Certificate Maintenance
Do not forget to update these certificates periodically as they expire or replaced, as the vault is not Domain Joined and does not have any mechanism to auto-manage domain certificates.
Domain integration
Domain integration over LDAPS can simplified by the "CyberArk LDAPS Certificate Tool" available in the Marketplace.
This tool can be used when the CyberArk installer/Administrator does not have direct access to the domain controller. Instead, the tool can export the appropriate certificates from any Domain Joined machine (such as components servers), and then import them to the vault and automatically place them in the correct certificate stores.
For complete instructions on how to use the tool, see the KB below: