FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
bmeta
Staff
Staff
Article Id 189972

Description


This article describes how to configure LDAP over SSL with an example scenario.

The LDAP traffic is secured by SSL.

 

Scope

 

Any version of FortiGate.


Solution


In this scenario, a Microsoft Windows Active Directory (AD) server is used as the Certificate Authority (CA). Certificate services have been added as a role and the CA certificate is available for export already.

 

Prerequisites.


Before performing the steps below, install the Active Directory Certificate Services role first as the Certification Authority.

 

To install Active Directory Certificate Services:

 

  1. Open the Server Manager. In the Server Manager, select Manager -> Add Roles and Features in the top right corner. Select Next until the Server Roles section appears.

  2. Select Active Directory Certificate Services and select Add Features:

 

jiahoong112_0-1671183127461.png

 

  1. Select Next until the Role Services section appears. Select Certification Authority.

     

    jiahoong112_1-1671183198077.png

     

     

  2. Select Next and finish the installation. After the installation has finished, select Configure Active Directory Certificate Services on the destination server.

     

    jiahoong112_0-1672032680107.png

     

     

  3. A new window will pop-up. Select Next and ensure Certification Authority is checked under Role Services then select Next.

     

    jiahoong112_1-1672032750305.png

     

     

  4. Select Enterprise CA. If the Enterprise CA cannot be selected, ensure to be logged in as the Administrator in the AD Domain.

     

    jiahoong112_2-1672032867269.png

     

     

  5. Continue to select Next until the final screen is reached. The rest of the options can be left on default. Choose to configure them differently according to the requirements.

     

    jiahoong112_3-1672032984609.png

     

  6. After selecting Configure, the configuration should succeed as such. Select Close when it is done. 

     

    jiahoong112_4-1672033063833.png

     

     

Next, follow the steps below to configure LDAPS.

 

Configure LDAPS on the Microsoft Windows Certificate Authority server:

 

  1. On the Active Directory server, open the MMC (Microsoft Management Console).
    Go to File and select Add/Remove Snap-in, then select Certificates and select Add:

 
  1. Select Computer account:

    JeanPhilippe_P_0-1730298992159.png

     


  2. Select Local computer and select Finish:
     
     
     
  3. The Certificates section appears on the left hand side. Expand the tree and go to Personal -> Certificates. Then, select the intended certificate, go to All Tasks and select Export:
     
     
     
  4. When the Certificate Export Wizard appears, select Next:
     
     
     
  5. Do not Export the Private Key:

    JeanPhilippe_P_1-1730299060933.png
  6. Select the DER file format: 

    JeanPhilippe_P_2-1730299183192.png

     


  7. Specify the name of the file and select Next:

    JeanPhilippe_P_3-1730299232264.png
  8. Complete the Certificate Export Wizard and select Finish:
 
 
A message to indicate that the wizard process was successfully completed will appear.
 
Configure LDAPS on the FortiGate:
 
  1. Import the CA Certificate that was exported in the steps earlier to the FortiGate. To do this, go to System -> Certificates, select Import CA Certificate and upload the file:
 
 
  1. Create a new 'LDAPS' server in the GUI and select the imported certificate:
     
 
 
Note:
  • Before 7.4.4, if no certificate is selected, FortiGate will accept any data from the LDAPS server.
  • After 7.4.4, the CA certificate is required even if not specified in the LDAPS config.
  • See: Technical Tip: LDAPS connections no longer work after update to v7.4.4
  • For lower versions, if a certificate is selected, FortiGate will only accept certificates signed by that CA certificate.
 
(Optional) Debugging processes:
 
Use packet capture and sniffer to verify the communication between FortiGate and the AD server. After a 3-way handshake, data transaction between the client and server will be visible:

'Hello Exchange' -> Client Hello -> Server Hello -> Server Hello Done.
 
 
The certificate sent by the LDAPS server can be seen in the packet, labeled as 'Certificate, Client Key Exchange, …'.
 
Unlike regular LDAP over TCP/389, it is not possible to see LDAP queries and replies. However, a non-secure LDAP can be useful for troubleshooting purposes.
 
diagnose sniffer packet any "host 192.168.252.133 and port 636"
interfaces=[any]
filters=[host 192.168.252.133 and port 636]
3.653907 192.168.252.187.11640 -> 192.168.252.133.636: syn 2104591803
3.655022 192.168.252.133.636 -> 192.168.252.187.11640: syn 3985690082 ack 2104591804
3.655066 192.168.252.187.11640 -> 192.168.252.133.636: ack 3985690083
3.655524 192.168.252.187.11640 -> 192.168.252.133.636: psh 2104591804 ack 3985690083
3.656473 192.168.252.133.636 -> 192.168.252.187.11640: 3985690083 ack 2104592128
 

Note: From FortiOS v7.2.0 onwards, administrators can configure a FortiGate client certificate in the LDAP server configuration when the FortiGate connects to an LDAPS server that requires client certificate authentication:

 

config user ldap

    edit <ldap_server>

        set client-cert-auth {enable | disable}

        set client-cert <source>

    next

end