@@ -564,7 +564,170 @@ You will need to know the path to the keystore and the password.
564564- ``ldap.truststore.password `` : truststore password
565565
566566
567- .. |button to dedicate a zone, pod,cluster, or host | image :: /_static/images/dedicate-resource-button.png
567+ Configuring LDAPS/ LDAP SSL Trust for LDAP Integration
568+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
569+
570+ When integrating Apache CloudStack with an LDAP directory over **LDAPS (TCP 636) **,
571+ the CloudStack Management Server must trust the TLS certificate presented by the
572+ LDAP server. This trust is established by importing the LDAP server certificate
573+ into a Java truststore and configuring CloudStack to use that truststore for LDAP
574+ communication.
575+
576+ This procedure uses the **manual certificate import method ** used for LDAP/LDAPS
577+ integration in CloudStack and Microsoft AD.
578+
579+ Retrieve the LDAP Server Certificate
580+
581+
582+ 1. On a CloudStack Management Server, navigate to the CloudStack management
583+ configuration directory:
584+
585+ .. code-block :: bash
586+
587+ cd /etc/cloudstack/management/
588+
589+ 2. Retrieve **only the LDAP server certificate ** (not the full certificate chain
590+ or root CA):
591+
592+ .. code-block :: bash
593+
594+ echo " " | openssl s_client -connect ldap.example.com:636 -showcerts 2> /dev/null | \
595+ openssl x509 -out ldap-server-certificate.pem
596+
597+ 3. Verify the retrieved certificate:
598+
599+ .. code-block :: bash
600+
601+ openssl x509 -in ldap-server-certificate.pem -noout -text
602+
603+ Ensure that the certificate details (Subject, Issuer, and validity dates)
604+ match the LDAP server configuration.
605+
606+ Create and Populate a Java Truststore
607+
608+
609+ 1. Import the LDAP server certificate into a Java KeyStore (JKS):
610+
611+ .. code-block :: bash
612+
613+ keytool -importcert \
614+ -alias ldap-server \
615+ -file ldap-server-certificate.pem \
616+ -trustcacerts \
617+ -keystore cloudstack-ldap-truststore.jks \
618+ -storetype JKS
619+
620+ 2. Verify the contents of the truststore:
621+
622+ .. code-block :: bash
623+
624+ keytool -v -list -keystore cloudstack-ldap-truststore.jks
625+
626+ 3. Verify file permissions:
627+
628+ .. code-block :: bash
629+
630+ ls -l /etc/cloudstack/management/cloudstack-ldap-truststore.jks
631+
632+ Example output:
633+
634+ .. code-block :: text
635+
636+ -rw-r--r-- 1 root root 1332 <date> cloudstack-ldap-truststore.jks
637+
638+ Ensure that the CloudStack Management Server process has read access to the
639+ truststore file.
640+
641+ Distribute the Truststore
642+
643+
644+ If multiple CloudStack Management Servers are deployed:
645+
646+ * Copy the truststore file to **all management servers **
647+ * Ensure the **file path is identical ** on each server
648+ * Ensure file permissions allow CloudStack to read the truststore
649+
650+ Example path:
651+
652+ ::
653+
654+ /etc/cloudstack/management/cloudstack-ldap-truststore.jks
655+
656+ Configure CloudStack LDAP Settings
657+
658+ Configure the following LDAP-related settings in the global settings:
659+
660+ .. list-table :: LDAP Settings
661+ :header-rows: 1
662+ :widths: 25 25 25 35
663+
664+ * - Setting
665+ - OpenLDAP
666+ - Active Directory
667+ - Description
668+ * - ``ldap.basedn ``
669+ - ``OU=APAC,DC=company,DC=com ``
670+ - ``DC=company,DC=com ``
671+ - Sets the base DN for LDAP searches.
672+ * - ``ldap.search.group.principle ``
673+ - ``CN=ACSGroup,DC=company,DC=com ``
674+ - ``CN=ACSGroup,CN=Users,DC=company,DC=com ``
675+ - *(Optional) * If set, only users belonging to this group are listed.
676+ * - ``ldap.bind.principal ``
677+ - ``CN=ACSServiceAccount,OU=APAC,DC=company,DC=com ``
678+ - ``CN=ACSServiceAccount,CN=Users,DC=company,DC=com ``
679+ - Service account used to list users under the configured base DN.
680+ Avoid using privileged accounts such as ``Administrator ``.
681+ * - ``ldap.bind.password ``
682+ - ``**************** ``
683+ - ``**************** ``
684+ - Password for the bind DN. Entered in plain text but stored encrypted.
685+ * - ``ldap.user.object ``
686+ - ``inetOrgPerson ``
687+ - ``user ``
688+ - LDAP object class representing user accounts.
689+ * - ``ldap.email.attribute ``
690+ - ``mail ``
691+ - ``mail ``
692+ - Attribute used to retrieve the user email address.
693+ * - ``ldap.firstname.attribute ``
694+ - ``givenName ``
695+ - ``givenName ``
696+ - Attribute used to retrieve the user first name.
697+ * - ``ldap.lastname.attribute ``
698+ - ``sn ``
699+ - ``sn ``
700+ - Attribute used to retrieve the user last name.
701+ * - ``ldap.group.object ``
702+ - ``groupOfUniqueNames ``
703+ - ``groupOfUniqueNames ``
704+ - LDAP object class representing groups.
705+ * - ``ldap.group.user.uniquemember ``
706+ - ``uniqueMember ``
707+ - ``uniqueMember ``
708+ - Attribute defining user membership within a group.
709+
710+
711+ Restart CloudStack Management Services
712+
713+
714+ After updating the configuration, restart the CloudStack Management Server:
715+
716+ .. code-block :: bash
717+
718+ systemctl restart cloudstack-management
719+
720+ Notes
721+
722+
723+ * Configuration changes do not take effect until the management service is restarted.
724+ * This procedure as it is applies to the **manual LDAP certificate import method ** used by
725+ CloudStack bt can be referenced for other methods as well.
726+ * Certificate renewal on the LDAP server requires repeating this procedure and
727+ redeploying the updated truststore.
728+
729+
730+
568731
569732Using a SAML 2.0 Identity Provider for User Authentication
570733----------------------------------------------------------
0 commit comments