<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lanson Pereira on Medium]]></title>
        <description><![CDATA[Stories by Lanson Pereira on Medium]]></description>
        <link>https://medium.com/@lansonlp?source=rss-2f9c68ed7bdb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*t7WaSKgXPQSblunT</url>
            <title>Stories by Lanson Pereira on Medium</title>
            <link>https://medium.com/@lansonlp?source=rss-2f9c68ed7bdb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:16:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lansonlp/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Managing Multiple Certificates on a Single GCP Load Balancer Using Certificate Maps]]></title>
            <link>https://medium.com/niveus-solutions/managing-multiple-certificates-on-a-single-gcp-load-balancer-using-certificate-maps-ef94d9f48488?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef94d9f48488</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[load-balancer]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[infra-modernization]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 17:34:53 GMT</pubDate>
            <atom:updated>2025-06-30T11:13:19.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SsND1pmOzhrLZbCfrzkcg.png" /></figure><h3>INTRODUCTION:</h3><p>In modern cloud architectures, it’s common to host multiple domains or subdomains behind a single load balancer. Managing SSL/TLS certificates for each of these can quickly become complex. Google Cloud addresses this challenge with <strong>Certificate Manager</strong> and <strong>Certificate Maps</strong>, allowing you to associate multiple SSL certificates with a single <strong>External HTTPS Load Balancer</strong>. This setup not only simplifies certificate management but also enhances scalability and security for multi-domain deployments. In this guide, we’ll explore how to configure multiple SSL certificates using Certificate Maps and apply them to a single load balancer in GCP.</p><h3>PROBLEM STATEMENT:</h3><p>In scenarios where multiple domains or subdomains need to be served through a single HTTPS load balancer on Google Cloud, managing SSL certificates becomes a challenge. Traditionally, associating multiple certificates with one load balancer required manual configuration and lacked scalability. This approach is error-prone, difficult to manage, and limits flexibility when adding or updating domains. There is a need for a more dynamic and scalable solution to handle multiple SSL certificates efficiently within a single load-balancing setup.</p><h3>PRE-REQUISITES:</h3><ol><li><strong>Google Cloud Project</strong> with billing enabled.</li><li><strong>IAM Permissions</strong></li><li><strong>External HTTPS Load Balancer</strong> already created and configured.</li><li><strong>Domain names</strong> registered and pointing to the load balancer (via DNS A or CNAME records).</li><li><strong>SSL Certificates</strong> (either Google-managed or self-managed) created and available in <strong>Certificate Manager</strong>.</li><li><strong>Certificate Map and Certificate Map Entries</strong> planned based on domain-to-certificate mapping.</li><li><strong>gcloud CLI</strong> or access to <strong>Cloud Console</strong> for configuration.</li></ol><h3>TOPICS COVERED:</h3><ul><li>Overview of SSL Certificate Manager in GCP</li><li>Introduction to Certificate Manager and Certificate Maps</li><li>Use Case for Hosting Multiple Domains on a Single Load Balancer</li><li>Creating and Managing SSL Certificates (Google-managed and Self-managed)</li><li>Certificate Authorization Methods in GCP</li><li>Creating Certificate Maps and Certificate Map Entries</li><li>Associating Certificate Maps with an HTTPS Load Balancer</li><li>Application testing and Certificate domain validation</li><li>Additional commands for Certificate map</li><li>Monitor Certificate Expiry</li></ul><h3>Certificate Manager in GCP:</h3><p>Google Cloud provides two ways to manage SSL certificates for HTTPS Load Balancers: <strong>Classic SSL Certificates</strong> and <strong>Certificate Manager Certificates</strong>.</p><h4><strong>Certificates:</strong></h4><p>Certificates created under <strong>Certificate Manager</strong> (via <em>Security → Certificate Manager</em>) do <strong>not appear</strong> in the load balancer UI’s certificate dropdown. These certificates can only be used by creating a <strong>Certificate Map</strong> and attaching it to the <strong>Target HTTPS Proxy</strong>. This method is ideal for scenarios involving multiple domains or subdomains, as it supports hostname-based certificate selection using SNI (Server Name Indication) and scales well beyond the 15-certificate limit of classic certificates.</p><h4><strong>Classic Certificates:</strong></h4><p>In contrast, <strong>Classic SSL Certificates</strong> are created directly from the Load Balancer section (or using gcloud compute ssl-certificates). They can be selected directly during load balancer creation, but are limited in scalability and flexibility. For new projects or multi-domain use cases, using Certificate Manager with Certificate Maps is the recommended approach.</p><h4>Certificate Maps:</h4><p><strong>Certificate Maps</strong> in Google Cloud are a key feature of <strong>Certificate Manager</strong> that allow you to associate multiple SSL certificates with different domain names (hostnames) behind a <strong>single HTTPS Load Balancer</strong>.</p><p>Each <strong>Certificate Map</strong> contains one or more <strong>Map Entries</strong>, where each entry defines a hostname (or wildcard domain) and links it to a specific SSL certificate.</p><h4>Certificate Requirement:</h4><p>When using <strong>Certificate Manager</strong>, you must specify the exact domains and subdomains in your certificate (like test.com, www.test.com, app.test.com), and ensure that corresponding <strong>A records</strong> are properly set up in your DNS provider (like Google Domains, Cloudflare, GoDaddy, etc.).</p><h4>Overview of Domain, Subdomain, and A Record:</h4><p>A D<strong>omain</strong> is the main address of a website on the internet — for example, test.com. It is registered through a domain registrar and serves as the primary identity for your web resources.</p><p>A <strong>subdomain</strong> is a child of the main domain, for example, www.test.com,app.test.com,api.test.comand is used to organize or separate parts of a website or service.</p><p>An <strong>A Record</strong> is a type of DNS (Domain Name System) record that maps a domain or subdomain to an IPv4 address. This tells browsers and clients where to go when they request a particular domain. <br>For example,</p><pre>test.com          A    34.102.200.3<br>app.test.com      A    34.102.200.5<br>api.test.com      A    34.102.200.8</pre><h4>SETUP OF MULTIPLE CERTIFICATES FOR LB:</h4><h4><strong>Step 1: Creating and Managing SSL Certificates (Google-managed and Self-managed)</strong></h4><p>Navigate to &gt; Certificate Manager &gt; Certificates &gt; Add Certificate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTVAjSjd6uBguWEmRp-3Ww.png" /></figure><p>Here we are creating 2 certificates from two different domains</p><p><strong>Note: </strong>Here I am not fully exposing my actual domains, I will be using the following domains,</p><h4><strong>Certificate Authorization Methods in GCP</strong></h4><p>When working with SSL certificates in Google Cloud, it’s important to understand how domain ownership is verified. Google Cloud supports two main authorization methods:</p><ul><li><strong>DNS Authorization</strong><br> This involves adding a TXT record to your domain’s DNS. It’s especially useful when you want to issue certificates <strong>before</strong> the load balancer is created or configured.</li><li><strong>Load Balancer (LB) Authorization</strong><br> This validates ownership automatically when the certificate is attached to an HTTPS load balancer and traffic starts flowing. This method is <strong>only available with Classic certificates</strong>.</li></ul><p><strong>Classic certificates</strong> (created from the Load Balancer UI) support <strong>only LB authorization</strong>.</p><p><strong>Certificate Manager certificates</strong> support <strong>both DNS and LB authorization</strong>, offering more flexibility.</p><p><strong>Why I Used DNS Authorization</strong></p><p>In this article, I chose to use <strong>DNS authorization</strong> because I wanted to <strong>pre-create certificates</strong> and organize them using <strong>Certificate Maps</strong> before setting up the HTTPS Load Balancer. This is a common approach when managing multiple domains and certificates efficiently.</p><p><strong>Creating SSL certificates</strong></p><p>For the scenario using two subdomains here</p><pre>app.lan****world.in<br>jenkins.lan*******test.site</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*cHhmp7lYbxRVKEHRssJRIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*qE1aPokrYCfNC-VagK9dwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8aRJJ9oXncBvtxbPxaOKQ.png" /></figure><p>Copy the CNAME content</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LT1u49xE4EPKDWwdCuO9qQ.png" /></figure><p><strong>Authorizing Domains with Registrars</strong></p><p><strong>In your domain registrar’s DNS management page</strong>, click on the respective domain and add the <strong>CNAME record</strong></p><ul><li><strong>Record Type:</strong> CNAME</li><li><strong>Name (Host)- </strong>DNS Record Name<strong>:</strong> _acme-challenge.jenkins.lan*****test.site.</li><li><strong>Value (Target)- </strong>DNS Record Data<strong>:</strong> df1873hdh-4761-z8.2.authorize.certificatemanager.goog.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72rb-Sou4TkpK8sQjxDqCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWUH0ILpkCWS-rRoQIigMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jDgp7EcXPzSuSMvofGLYIg.png" /></figure><p>Once done, check after a few hours and validate the SSL certificate on the console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*rCrBJdkyvMhAjPWCtpRnVw.png" /></figure><h4><strong>Step 2: Creating Certificate Maps and Certificate Map Entries</strong></h4><p>You <strong>can view</strong> Certificate Maps in the <strong>Certificate Manager</strong> section.<br>However, you <strong>cannot create, edit, or attach</strong> them to LB components through the UI at this time.</p><pre>gcloud certificate-manager maps create app-map<br><br><br>gcloud certificate-manager maps entries create app-cert-entry-1 \<br>  --map=&quot;app-map&quot; \<br>  --certificates=&quot;cert-lan****wold&quot; \<br>  --hostname=&quot;app.lan****world.in&quot;<br>  <br> gcloud certificate-manager maps entries create app-cert-entry-2 \<br>  --map=&quot;app-map&quot; \<br>  --certificates=&quot;cert-lan*******test&quot; \<br>  --hostname=&quot;jenkins.lan*******test.site&quot;</pre><p>certificates — <strong>Certificate resource names</strong> that you want to serve for the hostname</p><p>hostname — This defines which domain (hostname) the entry should match against using <strong>SNI</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q7yKWghbM5LxjrbidJ5pWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zYO4uXoJXKznWJv-J_z6-A.png" /></figure><p><strong>Validate the certificate map</strong></p><p>Navigate to &gt; Certificate Manager &gt; Certificate maps &gt; app-map</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*gKurZ28wgmX_NF51y3pb1g.png" /></figure><h4><strong>Step 3: Associating Certificate Maps with an HTTPS Load Balancer</strong></h4><p>In this step, we will configure a Global HTTPS External Load Balancer featuring an unmanaged instance group with two backends — both running on the same instance: Apache on port 80 and Jenkins on port 8080.</p><p><strong>Creating LB on Console, and it’s asking for classic certs… what now?”</strong></p><p><strong>Note:</strong> The <strong>Console UI only supports “classic SSL certificates”</strong> during LB creation. It <strong>does not support Certificate Maps directly</strong> (as of now)</p><p>In this step, I will create the Load Balancer in the Console using a placeholder (test) SSL certificate. After the Load Balancer is set up, I will use the gcloud CLI to attach the actual Certificate Map.</p><p><strong>Backend VM</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFUCB86PjJpej2RiCfDoww.png" /></figure><p><strong>Unmanaged Instance group</strong></p><pre>UMIG - umig-as1-poc-application<br>VM - apache-application<br>UMIG Backend Ports -<br>  http    80<br>  jenkins 8080</pre><p><strong>Global HTTPS External Load Balancer</strong></p><p>Note: In this step, I have created a load balancer with a single sample test classic SSL certificate for one-time load balancer creation.</p><p>To create a Sample Test certificate for Load Balancer</p><p><strong>Navigate to &gt; Certificate Manager &gt; Classic Certificates</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WzArKBE5HJOIZ4NFCJemgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*R9q-823PP_P_TaF2eOBMCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oCfqqGBYRFkeNoIQZ3i0Zg.png" /><figcaption>Test certificate for one time LB creation</figcaption></figure><p><strong>Alternatives,</strong></p><p>We can use <strong>Terraform</strong> to attach a <strong>Certificate Map</strong> to an LB</p><pre>resource &quot;google_compute_ssl_policy&quot; &quot;policy&quot; {<br>  ...<br>}<br><br>resource &quot;google_compute_target_https_proxy&quot; &quot;proxy&quot; {<br>  name             = &quot;https-proxy&quot;<br>  url_map          = google_compute_url_map.default.self_link<br>  certificate_map  = google_compute_certificate_map.example.id<br>}</pre><p>Terraform supports attaching<strong> </strong>certificate_map to a target_https_proxy</p><p><strong>Classic SSL certificate Name: </strong>lan*****-ssl-cert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lw6WdL2Ocbg_UE0d6qh5Kg.png" /><figcaption>Load balancer with Single cert</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1NSDoGDhr9bE_Qsn8Fzgw.png" /></figure><p>In this step,</p><p>The domain app.lan***world.in routes to the <em>application-backend</em>, which has Apache installed and is listening on port 80.</p><p>The domain jenkins.lan*******.site routes to the <em>jenkins-backend</em>, where Jenkins is installed and running on port 8080.</p><p><strong>Since a test certificate is currently attached to the load balancer, the associated domain will not function properly. The next step is to attach the correct certificate map to the load balancer.</strong></p><h4><strong>Step 4: Associating Certificate Map with an HTTPS Load Balancer</strong></h4><p>Navigate to &gt; GCP console &gt; cloudshell</p><pre>gcloud compute target-https-proxies list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*6CuMckaNk0DAiSFDtDTr7g.png" /></figure><p>Copy the proxy name <strong><br>Name: </strong>lb-application-target-proxy</p><p><strong>To update the certificate map for the Load balancer,</strong></p><pre>gcloud compute target-https-proxies update lb-application-target-proxy \<br>    --certificate-map=&quot;app-map&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcBxkCf9_3YkEyT8JEU81Q.png" /></figure><p>The certificate map has now been <em>successfully</em> updated on the load balancer.</p><p><strong>To remove the certificate map for the Load balancer,</strong></p><pre>gcloud compute target-https-proxies update lb-application-target-proxy --certificate-map=&quot;&quot;</pre><p>Validate the Load balancer,</p><p>Navigate to &gt; GCP console &gt; Load balancing &gt; lb-application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D20UiYT2LaSWwU0nE-O83w.png" /><figcaption>Load balancer with Certificate Map</figcaption></figure><h4><strong>Step 5: Adding ‘A’ Record for Load Balancer</strong></h4><p>Navigate to &gt; GCP console &gt; Load balancing &gt; lb-application</p><p>Copy the IP Address of the Load balancer</p><p>Example — 34.X.X.115</p><p>Navigate to the Domain Registrar<br>In my Case, CloudFlare is my domain registrar</p><p><strong>Note: </strong>Ensure that the proxy status is turned off.</p><p>First Domain,</p><pre>app.lan****world.in</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dg07hz2GFRiT9HOEtOSMsA.png" /><figcaption>Adding ‘A’ Record app.lan****world.in</figcaption></figure><p>Second Domain,</p><pre>jenkins.lan*******test.site</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2I0x9Y-CrdZBJj4t8RINGw.png" /><figcaption>Adding ‘A’ Record jenkins.lan*******test.site</figcaption></figure><p>The domain has been mapped successfully.</p><h4>Step 6: Application testing and Certificate domain validation</h4><p>Load the Domain in the browser</p><pre>jenkins.lan*******test.site</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Jzcb8TDEMS_mSd0-JHzhw.png" /></figure><p>Jenkins Page,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*BDWcxLJ16tSEIHBjYybnVw.png" /></figure><pre>app.lan****world.in</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*nVmegtmWpBXaAgITywRP3A.png" /></figure><p>Application Page — Apache Default Page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*UnI6gpQ2NGbyV5ECxui57Q.png" /></figure><p>The pages are loading successfully, and the certificate map is working as expected. 🔐🌐</p><h4><strong>Additional commands for Certificate Map</strong></h4><pre>#To check Certificate status<br><br>gcloud certificate-manager certificates describe certificate-name<br><br><br><br>#To check if the certificate map entry is active<br><br>gcloud certificate-manager maps entries describe CERTIFICATE_MAP_ENTRY_NAME \<br>    --map=&quot;CERTIFICATE_MAP_NAME&quot;<br><br><br><br># To list the number of entries in the certificate map<br><br>gcloud certificate-manager maps entries list --map=CERTIFICATE_MAP_NAME<br><br><br><br># Delete a Certificate Map Entry<br><br>gcloud certificate-manager maps entries delete CERTIFICATE_MAP_ENTRY_NAME \<br>  --map=&quot;CERTIFICATE_MAP_NAME&quot;<br><br><br># Delete a Certificate Map<br><br>gcloud certificate-manager maps delete CERTIFICATE_MAP_NAME<br><br></pre><p>🔔 <strong>Want to Monitor Certificate Expiry?</strong><br>Once your SSL certificates are set up, it’s equally important to monitor their health and expiry. Check out my Medium article on how to set up SSL certificate expiry alerts in GCP to avoid downtime:</p><p>👉 <a href="https://medium.com/niveus-solutions/establishing-alert-notifications-for-google-managed-ssl-certificates-within-a-google-cloud-platform-167dfe60753f">Set Up SSL Certificate Expiry Alerts in GCP</a></p><p>Stay secure by ensuring your certificates never expire without warning.</p><h4>CONCLUSION:</h4><p>Managing SSL certificates effectively is crucial for securing modern web applications, especially when serving multiple domains through a single Google Cloud HTTPS Load Balancer. By using <strong>Certificate Manager</strong> and <strong>Certificate Maps</strong>, you gain a <strong>scalable, flexible, and automated solution</strong> for efficiently managing multiple certificates and domain-to-certificate mappings.</p><h4>REFERENCES:</h4><ul><li><a href="https://cloud.google.com/certificate-manager/docs/deploy-google-managed-dns-auth#create_a_google-managed_certificate_referencing_the_dns_authorization">Deploy a global Google-managed certificate with DNS authorization | Certificate Manager | Google Cloud</a></li><li><a href="https://cloud.google.com/certificate-manager/docs/map-entries">Manage certificate map entries | Certificate Manager | Google Cloud</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef94d9f48488" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/managing-multiple-certificates-on-a-single-gcp-load-balancer-using-certificate-maps-ef94d9f48488">Managing Multiple Certificates on a Single GCP Load Balancer Using Certificate Maps</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenLDAP: Effective Backup Strategies and Data Restoration Techniques]]></title>
            <link>https://medium.com/niveus-solutions/openldap-effective-backup-strategies-and-data-restoration-techniques-ea79ecdd6d77?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea79ecdd6d77</guid>
            <category><![CDATA[data-modernization]]></category>
            <category><![CDATA[data-restoration]]></category>
            <category><![CDATA[openldap]]></category>
            <category><![CDATA[backup]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 05:02:42 GMT</pubDate>
            <atom:updated>2025-03-16T19:00:56.167Z</atom:updated>
            <content:encoded><![CDATA[<h3>INTRODUCTION:</h3><p>OpenLDAP is a widely used directory service that plays a crucial role in managing user information within organizations. To safeguard against data loss from accidental deletions, hardware failures, or other unforeseen events, a robust backup and recovery strategy is essential. Regular backups not only protect vital data but also ensure that services can be quickly restored with minimal downtime. This process involves not only implementing effective backup methods and tools but also understanding how to import and restore these backups while maintaining data integrity. By mastering these practices, administrators can enhance the resilience of their OpenLDAP environments and secure critical information effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IigEzL7jLOIV6WF4F2IIAA.png" /></figure><h4>Topics:</h4><ul><li>OpenLDAP backups</li><li>OpenLDAP Data Restoration</li></ul><h4>Implementation:</h4><p><strong>OpenLDAP backups:</strong></p><p>Create a destination backup folder</p><pre>mkdir /var/opt/example/backup/</pre><p><strong>Create a backup script file:</strong></p><p>It will create a backup of the configuration, the slapd folder, and OpenLDAP user data, and will delete backup files older than 2 days from the backup folder.</p><pre>vim /sbin/backup_slapd.sh</pre><pre>#!/bin/bash<br><br>set -e<br><br>USAGE=&quot;usage: $0 environment backup-location&quot;<br><br>if [ $# -ne 2 ]; then<br>    echo &quot;ERROR: Not all required arguments were supplied.&quot;<br>    echo &quot;${USAGE}&quot;<br>    exit 1<br>fi<br><br>ENVIRONMENT=$1<br>BACKUP_PATH=$2<br><br>if [ ! -d &quot;${BACKUP_PATH}&quot; ]; then<br>    echo &quot;ERROR: location to save backups [${BACKUP_PATH}] does not exist.&quot;<br>    exit 1<br>fi<br><br>SLAPCAT=/usr/sbin/slapcat<br>timestamp=$(date -Is)<br><br># Backup the DIT<br>nice ${SLAPCAT} -n 1 | gzip - &gt; &quot;${BACKUP_PATH}/${ENVIRONMENT}-${timestamp}-dit.ldif.gz&quot;<br><br># Backup the config<br>nice ${SLAPCAT} -n 0 | gzip - &gt; &quot;${BACKUP_PATH}/${ENVIRONMENT}-${timestamp}-config.ldif.gz&quot;<br><br># Copy the /etc/ldap/slapd.d directory preserving permissions and timestamps<br>cp -rp /etc/ldap/slapd.d &quot;${BACKUP_PATH}/${ENVIRONMENT}-${timestamp}-slapd.d&quot;<br><br># Set ownership and permissions for the backup files<br>chown root:root ${BACKUP_PATH}/*<br>chmod 600 ${BACKUP_PATH}/*.ldif.gz<br>chmod 700 ${BACKUP_PATH}/${ENVIRONMENT}-${timestamp}-slapd.d<br><br># Clean up old backups<br># Delete backups older than 2 days<br>find &quot;${BACKUP_PATH}&quot; -type f -name &quot;*.ldif.gz&quot; -mtime +2 -exec rm {} \;<br></pre><p><strong>Run and Test:</strong></p><pre>/sbin/openLDAP_backup.sh live-stage /var/opt/example/backup/</pre><p><strong>Cron Job:</strong></p><p>Every day at 11.50 PM -IST</p><pre>20 6 * * * /sbin/openLDAP_backup.sh live-stage /var/opt/example/backup/slapd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7nT5mAe0DcGKNITyOVlrA.png" /></figure><h3><strong>OpenLDAP Data Restoration</strong></h3><p>Step1: Stop the slapd service.</p><pre>sudo systemctl stop slapd</pre><p>Navigate to <strong>/var/lib/ldap/ </strong>folder</p><p>Delete the existing user data</p><p>Which is located below the path,</p><p><strong>/var/lib/ldap/data.mdb</strong></p><p><strong>The folder and path should have the below permission</strong></p><pre>chown -R openldap:openldap /var/lib/ldap</pre><p>Step 2: Import LDAP data</p><p>Navigate to the backup folder and extract the data file</p><pre>cd /var/opt/example/backup/<br>#live-gcp-2024-09-24T06:14:16+00:00-dit.ldif.gz<br>gunzip live-stage-2024-09-24T06:48:00+00:00-dit.ldif.gz<br></pre><p>Import backup data with the below command</p><pre>sudo slapadd -n 1 -l live-stage-2024-09-24T06:48:00+00:00-dit.ldif -w</pre><p>Once the import is done, Restart the slapd service</p><pre>sudo systemctl restart slapd</pre><p>Check the OpenLDAP data count</p><pre>ldapsearch -x -H ldaps://ldap01.example.in -D &quot;cn=admin,dc=example,dc=in&quot; -W -b &quot;dc=example,dc=in&quot; &quot;(uid=*)&quot; | wc -l</pre><h4>CONCLUSION:</h4><p>In conclusion, a robust backup and recovery strategy for OpenLDAP is essential for maintaining the integrity and availability of directory services. Regular backups safeguard against data loss and enable quick recovery from incidents. By mastering effective backup methods and restoration processes, administrators can ensure minimal downtime and enhance data security, supporting the seamless operation of critical systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea79ecdd6d77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/openldap-effective-backup-strategies-and-data-restoration-techniques-ea79ecdd6d77">OpenLDAP: Effective Backup Strategies and Data Restoration Techniques</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenLDAP Configuration and Multi-master Replication - Part 4]]></title>
            <link>https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-4-4e735140891d?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e735140891d</guid>
            <category><![CDATA[openldap]]></category>
            <category><![CDATA[data-modernization]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 05:02:06 GMT</pubDate>
            <atom:updated>2024-12-20T12:06:24.412Z</atom:updated>
            <content:encoded><![CDATA[<h3>How did we manage to set up OpenLDAP on GCP and migrate it.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nXl_CTUqrqmXztODlIJhw.png" /></figure><h4>INTRODUCTION:</h4><p>OpenLDAP multi-master replication allows multiple servers to function as masters, enabling them to accept write operations simultaneously. This configuration enhances system availability and fault tolerance, as it ensures that if one server fails, others can still handle requests. It is ideal for environments that require high availability and scalability, allowing for efficient load distribution and continuous access to directory services. This setup also incorporates mechanisms for conflict resolution to manage simultaneous updates across different servers.</p><h4>PROBLEM STATEMENT:</h4><p>Configure multi-master replication for four LDAP nodes, implementing both configuration and data replication between the nodes to ensure high availability and consistency of directory information across the environment.</p><h4>Topics Covered:</h4><ul><li>Creation of Admin Hashing Password</li><li>Configure Config database admin Password Hashing</li><li>Configure Data database admin Password Hashing</li><li>Enable replication module</li><li>olcServerID</li><li>Config database Overlay syncprov</li><li>Config replication</li><li>Data replication initial configs</li><li>Data database Overlay syncprov</li><li>Data replication</li></ul><p>Implementation:</p><p><strong>Step 1: Generate admin Hashing Password</strong></p><pre>slappasswd -h {SSHA}</pre><p>Enter the password multiple times, In this case, I am using the same admin root password created in part1</p><p>Something like this,</p><p>Ldap@root?123 — <strong>{SSHA}dcj5VEOp11SBuIGJ+M56b7Pvs6</strong></p><p>Note: Each time you generate an SSHA hash for the same password, a different unique random value is typically created, resulting in different hash outputs.</p><p>Copy the generated password.</p><p><strong>Note: In this case, I am using the same hashed password for both configuration and data replication. However, you can generate and use different hashing passwords for configuration and data replication for added security.</strong></p><p><strong>Step 2: Configure Config database admin Hashing Password</strong></p><p>Create a ldif file for changing the Config database password with the following content (put the new password in front of olcRootPW).</p><p>Replace your SSHA password</p><pre>vim /tmp/change_config_pwd.ldif</pre><pre>dn: olcDatabase={0}config,cn=config<br>changetype: modify<br>replace: olcRootPW<br>olcRootPW: {SSHA}dcj5VEOp11SBuIGJ+M56b7Pvs6</pre><pre>sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /tmp/changepwd-configdb.ldif</pre><p><strong>Step 3: Configure Data database admin Hashing Password</strong></p><pre>vim /tmp/change_data_pwd.ldif</pre><pre>dn: olcDatabase={1}mdb,cn=config<br>changetype: modify<br>replace: olcRootPW<br>olcRootPW: {SSHA}dcj5VEOp11SBuIGJ+M56b7Pvs6</pre><pre>sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /tmp/changepwd-datadb.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*HLKxjzlh30ZXxEMQ45wYnw.png" /></figure><p><strong>Note:</strong> Execute the above steps on all nodes starting from step number 2. All nodes should use the same hashed password. Generate the hash only once on one server and apply the same hashed password across all LDAP servers.</p><h3>Multi-Master Replication</h3><p><strong>Step 1: Enable replication module</strong></p><p>Go to /tmp/ldapimport and create the following file,</p><pre>sudo vim syncprov_mod.ldif</pre><p>Add the following content. Ensure /usr/lib/ldap path is correct and syncprov.la library is in that path. Else change as required.</p><pre>dn: cn=module,cn=config<br>objectClass: olcModuleList<br>cn: module<br>olcModulePath: /usr/lib/ldap<br>olcModuleLoad: syncprov.la</pre><p>Save and close. Apply the config.</p><pre>ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov_mod.ldif</pre><p>The output should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*TORAFgFPcViP6r7nKfCqAQ.png" /></figure><p><strong>Note:</strong> Perform this step on all servers.</p><p><strong>Step 2: Set the server ID with the host on each server</strong></p><pre>vi olcserveridhost.ldif</pre><pre>### Update Server ID with LDAP URL ###<br><br>dn: cn=config<br>changetype: modify<br>add: olcServerID<br>olcServerID: 1 ldaps://ldap01.example.in<br>olcServerID: 2 ldaps://ldap02.example.in<br>olcServerID: 3 ldaps://ldap03.example.in<br>olcServerID: 4 ldaps://ldap04.example.in</pre><p>Apply the config.</p><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f olcserveridhost.ldif</pre><p><strong>Note:</strong> Perform this step on all servers.</p><p><strong>Common Error: “Server Unwilling to Perform”</strong></p><p>In this case, ensure that the olcServerID host entries for the current server are present in the /etc/default/slapd file under the SLAPD_SERVICES parameter.</p><p>Refer to Part 3 for more information</p><h4>Step 3: Config database Overlay syncprov</h4><pre>vim overlay-config.ldif</pre><pre>### Enable Config Replication###<br><br>dn: olcOverlay=syncprov,olcDatabase={0}config,cn=config<br>changetype: add<br>objectClass: olcOverlayConfig<br>objectClass: olcSyncProvConfig<br>olcOverlay: syncprov</pre><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f overlay-config.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*TVoygpauVlgb_J_0ynrk_Q.png" /></figure><p><strong>Note:</strong> Perform this step on all servers.</p><pre>systemctl restart slapd<br>systemctl status slapd</pre><h4><strong>Step 4: Config replication</strong></h4><p>When configuration database replication is enabled, any configuration changes made on one LDAP server will be reflected across all nodes.</p><pre>vim configrep.ldif</pre><pre>### Adding config details for confDB replication ###<br>### Ensure &#39;credentials&#39; below is updated to the cleartext password created for admin ###<br><br>dn: olcDatabase={0}config,cn=config<br>changetype: modify<br>add: olcSyncRepl<br>olcSyncRepl: rid=001 provider=ldaps://ldap01.example.in binddn=&quot;cn=admin,cn=config&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;cn=config&quot; type=refreshAndPersist retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=002 provider=ldaps://ldap02.example.in binddn=&quot;cn=admin,cn=config&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;cn=config&quot; type=refreshAndPersist retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=003 provider=ldaps://ldap03.example.in binddn=&quot;cn=admin,cn=config&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;cn=config&quot; type=refreshAndPersist retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=004 provider=ldaps://ldap04.example.in binddn=&quot;cn=admin,cn=config&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;cn=config&quot; type=refreshAndPersist retry=&quot;5 5 300 5&quot; timeout=1<br>-<br>add: olcMultiProvider<br>olcMultiProvider: TRUE</pre><p><strong>Note:</strong> Replace your domain name and Password</p><p>For the provider, you can use either the IP address or the hostname. Ensure that the hostname and olcServerID entries are correctly configured in the /etc/default/slapd file.</p><p>Apply the config</p><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f configrep.ldif</pre><p>Also, verify that /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif</p><pre>cat /etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif<br><br>or <br><br>#Validate all config olcserverID, replication module, config and data replication<br>slapcat -n 0<br></pre><p><strong>Note: </strong>It may take a few minutes for the applied configuration replication files to be replicated to the other servers. If replication does not occur, try restarting the slapd services on the remaining servers.</p><p>Once you have confirmed that configuration replication is functioning correctly, you can proceed to enable replication for the database that stores the data.</p><h4>Step 5: Data replication initial configs</h4><p>This step needs to be done on any one node as long as the config replication is working.</p><p>First, check the database to be replicated:</p><pre>ldapsearch -H ldapi:// -Y EXTERNAL -b &quot;cn=config&quot; -LLL -Q &quot;(olcSuffix=*)&quot; dn olcSuffix</pre><p>The output will be something like:</p><pre>root@openldap:/etc/ldap/slapd.d# ldapsearch -H ldapi:// -Y EXTERNAL -b &quot;cn=config&quot; -LLL -Q &quot;(olcSuffix=*)&quot; dn olcSuffix<br>dn: olcDatabase={1}mdb,cn=config<br>olcSuffix: dc=example,dc=in</pre><p>So, the database to be replicated for example.in is {1}mdb,cn=config</p><pre>vim databse-config.ldif</pre><pre>dn: olcDatabase={1}mdb,cn=config<br>changetype: modify<br>replace: olcSuffix<br>olcSuffix: dc=example,dc=in<br>-<br>replace: olcRootDN<br>olcRootDN: cn=admin,dc=example,dc=in<br>-<br>add: olcDbIndex<br>olcDbIndex: entryUUID  eq<br>-<br>add: olcDbIndex<br>olcDbIndex: entryCSN  eq<br>-<br>add: olcDbIndex<br>olcDbIndex: mobileNum eq</pre><p><strong>Note:</strong> Replace your domain name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*DIvuOnTpJd6ABOiljSGEdQ.png" /></figure><p>Also, verify that slapcat -n 0 shows olcMultiProvider=TRUE</p><h4>Step 6: Data database Overlay syncprov</h4><pre>vim overlay-database.ldif</pre><pre>dn: olcOverlay=syncprov,olcDatabase={1}mdb,cn=config<br>changetype: add<br>objectClass: olcOverlayConfig<br>objectClass: olcSyncProvConfig<br>olcOverlay: syncprov</pre><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f overlay-database.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*0Bm4RTxMhh4BPtS0O1kK-g.png" /></figure><p>Verify the config</p><pre>slapcat -n 0</pre><h4>Step 7: Data replication</h4><p>This step needs to be done on any one node as long as the config replication is working.</p><pre>vim datarep.ldif</pre><pre>dn: olcDatabase={1}mdb,cn=config<br>changetype: modify<br>add: olcSyncRepl<br>olcSyncRepl: rid=011 provider=ldaps://ldap01.example.in binddn=&quot;cn=admin,dc=example,dc=in&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;dc=example,dc=in&quot; type=refreshOnly interval=00:00:00:10 retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=012 provider=ldaps://ldap02.example.in binddn=&quot;cn=admin,dc=example,dc=in&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;dc=example,dc=in&quot; type=refreshOnly interval=00:00:00:10 retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=013 provider=ldaps://ldap03.example.in binddn=&quot;cn=admin,dc=example,dc=in&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;dc=example,dc=in&quot; type=refreshOnly interval=00:00:00:10 retry=&quot;5 5 300 5&quot; timeout=1<br>olcSyncRepl: rid=014 provider=ldaps://ldap04.example.in binddn=&quot;cn=admin,dc=example,dc=in&quot; bindmethod=simple credentials=Ldap@root?123 searchbase=&quot;dc=example,dc=in&quot; type=refreshOnly interval=00:00:00:10 retry=&quot;5 5 300 5&quot; timeout=1<br>-<br>add: olcMultiProvider<br>olcMultiProvider: TRUE</pre><p>Apply the config</p><pre>ldapmodify -Y EXTERNAL  -H ldapi:/// -f datarep.ldif</pre><p>Also, verify that slapcat -n 0 shows olcMultiProvider=TRUE</p><p>Verify the configs on all nodes by running the above command</p><h4><strong>To verify whether the replication is working across all nodes.</strong></h4><p><strong>Note:</strong> At least one of the nodes should contain the user/group object data.</p><p><strong>Step 1: </strong>Manual file verification</p><p>Navigate to, /var/lib/ldap and verify that data is being added to the data files.</p><p><strong>Step 2: </strong>LDAP search command</p><pre>ldapsearch -x -H ldaps://ldap01.example.in -D &quot;cn=admin,dc=example,dc=in&quot; -W -b &quot;dc=example,dc=in&quot; &quot;(uid=*)&quot; | wc -l<br>ldapsearch -x -H ldaps://ldap02.example.in -D &quot;cn=admin,dc=example,dc=in&quot; -W -b &quot;dc=example,dc=in&quot; &quot;(uid=*)&quot; | wc -l<br>ldapsearch -x -H ldaps://ldap03.example.in -D &quot;cn=admin,dc=example,dc=in&quot; -W -b &quot;dc=example,dc=in&quot; &quot;(uid=*)&quot; | wc -l<br>ldapsearch -x -H ldaps://ldap04.example.in -D &quot;cn=admin,dc=example,dc=in&quot; -W -b &quot;dc=example,dc=in&quot; &quot;(uid=*)&quot; | wc -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9wYJuGSkv--Hy_IrirYcwA.png" /></figure><p>Object Creation:</p><p><strong>Adding OU:</strong></p><pre>vim testou.ldif</pre><pre>dn: ou=test,dc=example,dc=in<br>objectClass: top<br>objectClass: organizationalUnit<br>ou: test</pre><pre>ldapadd -H ldaps://ldap01.example.in -x -W -D &quot;cn=admin,dc=example,dc=in&quot; -f testou.ldif</pre><pre>ldapsearch -H ldaps://ldap01.example.in  -x -b &quot;ou=test,dc=example,dc=in&quot; &quot;(objectClass=*)&quot; &quot;*&quot;</pre><p>Run the commands of step 2 to verify that the ‘OU=test’ object is replicated across all nodes.</p><p><strong>Adding Users to the OU:</strong></p><pre>vim testusers.ldif</pre><pre>dn: uid=joy,ou=test,dc=example,dc=in<br>objectClass: top<br>objectClass: account<br>objectClass: posixAccount<br>objectClass: shadowAccount<br>cn: admin<br>uid: joy<br>uidNumber: 16859<br>gidNumber: 100<br>homeDirectory: /home/joy<br>loginShell: /bin/bash<br>gecos: joy<br>userPassword: {crypt}x<br>shadowLastChange: 0<br>shadowMax: 0<br>shadowWarning: 0<br><br>-<br><br>dn: uid=adam,ou=test,dc=example,dc=in<br>objectClass: top<br>objectClass: account<br>objectClass: posixAccount<br>objectClass: shadowAccount<br>cn: admin<br>uid: adam<br>uidNumber: 16859<br>gidNumber: 100<br>homeDirectory: /home/adam<br>loginShell: /bin/bash<br>gecos: adam<br>userPassword: {crypt}x<br>shadowLastChange: 0<br>shadowMax: 0<br>shadowWarning: 0<br><br>-<br><br>dn: uid=jerry,ou=test,dc=example,dc=in<br>objectClass: top<br>objectClass: account<br>objectClass: posixAccount<br>objectClass: shadowAccount<br>cn: admin<br>uid: jerry<br>uidNumber: 16859<br>gidNumber: 100<br>homeDirectory: /home/jerry<br>loginShell: /bin/bash<br>gecos: jerry<br>userPassword: {crypt}x<br>shadowLastChange: 0<br>shadowMax: 0<br>shadowWarning: 0</pre><pre>ldapadd -H ldaps://ldap01.example.in -x -W -D &quot;cn=admin,dc=example,dc=in&quot; -f testusers.ldif</pre><p>Validate user</p><pre>ldapsearch -H ldaps://ldap01.example.in  -x -b &quot;ou=test,dc=example,dc=in&quot; &quot;(objectClass=*)&quot; &quot;*&quot;</pre><p>The multi-master setup for the 4 OpenLDAP servers has been completed.</p><p><em>The next steps will focus on importing OpenLDAP data backups and configuring regular OpenLDAP backup processes in the </em><a href="https://medium.com/@lansonlp/openldap-effective-backup-strategies-and-data-restoration-techniques-ea79ecdd6d77"><em>following link</em></a><em>.</em></p><h4>CONCLUSION:</h4><p>The multi-master replication setup for the four OpenLDAP servers has been completed, ensuring both configuration and data are consistently replicated across all nodes. Password management using SSHA hashes was implemented to enhance security, and replication was verified to ensure synchronization across the environment. This setup strengthens the LDAP infrastructure by improving its resilience, security, and scalability.</p><h4>REFERENCES:</h4><p><a href="https://www.openldap.org/devel/admin/replication.html">https://www.openldap.org/devel/admin/replication.html</a></p><p><a href="https://ubuntu.com/server/docs/openldap-replication">https://ubuntu.com/server/docs/openldap-replication</a></p><p><a href="https://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-openldap-multi-master-replication-linux.html">https://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-openldap-multi-master-replication-linux.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e735140891d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-4-4e735140891d">OpenLDAP Configuration and Multi-master Replication - Part 4</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenLDAP SSL Certificate Creation using OpenSSL and Attaching SSL Certificate to each Server- Part…]]></title>
            <link>https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-3-0481384e0870?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/0481384e0870</guid>
            <category><![CDATA[openldap]]></category>
            <category><![CDATA[data-modernization]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 05:01:12 GMT</pubDate>
            <atom:updated>2024-12-20T12:05:31.622Z</atom:updated>
            <content:encoded><![CDATA[<h3>OpenLDAP SSL Certificate Creation using OpenSSL and Attaching SSL Certificate to each Server- Part 3</h3><h3>How did we manage to set up OpenLDAP on GCP and migrate it.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOejw7JndTbLkbd2dAskQA.png" /></figure><h3>INTRODUCTION:</h3><p>LDAP (Lightweight Directory Access Protocol) is widely used to manage user directories and authentication in enterprise environments. When LDAP communication happens over an unencrypted channel, the data — including sensitive information like passwords — is vulnerable to interception. This is where <strong>SSL/TLS certificates</strong> come into play, as they secure LDAP communications by encrypting data exchanged between the LDAP client and the LDAP server.</p><h4>Methods for Securing LDAP with SSL/TLS:</h4><ul><li><strong>LDAPS (LDAP over SSL)</strong>: Uses port 636 and encrypts the connection from the start.</li><li><strong>StartTLS</strong>: Establishes a normal LDAP connection (port 389), then upgrades it to TLS by negotiating encryption before any sensitive data is transferred.</li></ul><h4><strong>Types of Certificates for LDAP:</strong></h4><ul><li><strong>Self-signed Certificates</strong>: Typically used for internal networks where a trusted CA is not required. They provide encryption but no trusted identity verification.</li><li><strong>CA-signed Certificates</strong>: Issued by a trusted Certificate Authority. Clients can verify the server’s identity using the CA’s root certificate.</li></ul><p><strong>Step1:Adding host files on all nodes</strong></p><p>Add all host entries before creating SSL certificates.</p><p><strong>Note: This is only necessary if you’re setting up SSL certificates for a domain name.</strong></p><pre>sudo vim /etc/hosts</pre><pre>172.16.0.1           ldap01.example.in<br>172.16.0.2           ldap02.example.in<br>10.0.0.1             ldap03.example.in<br>10.0.0.2             ldap04.example.in</pre><p><strong>Step 2: Creation of CA Certificate on the Central server</strong></p><pre>cd /etc/ssl<br>/usr/lib/ssl/misc/CA.pl -newca</pre><p>When prompted, press Enter to create and set a passphrase — be sure to remember it, as you’ll need it for all future certificate signing requests. Enter the country name, state, and organization name.<br>For the FQDN, use <strong>ldap01.example.in </strong>or <strong>172.16.0.1</strong></p><p>If successful, this will create a new <strong>CA</strong> folder named <strong>demoCA</strong> inside <strong>/etc/ssl</strong> (make sure not to change the folder name).</p><p>Edit the <strong>/etc/ssl/openssl.cnf</strong> file and uncomment the following property under the <strong>[ CA_default ]</strong> section:</p><pre>copy_extensions = copy</pre><p>This will ensure that when certificates are signed, the Subject Alternate Names (SAN) are included in the certificate, allowing clients to connect to the server successfully.</p><h4><strong>Step 3: LDAP Server Certificate and Server Key</strong></h4><p>For creating new server certificate requests for signing, create a config file called <strong>/etc/ssl/certreq.txt </strong>and put the following content:</p><pre>[req]<br>default_bits = 2048<br>prompt = no<br>default_md = sha256<br>req_extensions = req_ext<br>distinguished_name = dn<br><br>[ dn ]<br>C=IN<br>ST=Maharashtra<br>L=Pune<br>O=example<br>OU=example<br>emailAddress=info@example.in<br>CN = ldap01.example.in<br>[ req_ext ]<br>subjectAltName = @alt_names<br><br>[ alt_names ]<br>DNS.1 = ldap01.example.in<br>IP.1 = 172.16.0.1</pre><p>Now from within <strong>/etc/ssl</strong>, create a new certificate request. Make sure the certreq.txt is updated with the correct CN and IP values before running this command</p><pre>openssl req -new -sha256 -nodes -out newreq.pem -newkey rsa:2048 -keyout newreq.pem -config &lt;( cat certreq.txt )</pre><p>Enter the previous passphrase</p><p>then from /etc/ssl/ folder:</p><pre>/usr/lib/ssl/misc/CA.pl -sign</pre><p>This will create a new file called <strong>newcert.pem</strong></p><p>copy the ca public certificate to /etc/ssl/certs</p><pre>cp /etc/ssl/demoCA/cacert.pem /etc/ssl/certs/cacert.pem</pre><p>then move the newly signed certificate to /etc/ssl/private and public cert to /etc/ssl/certs</p><p><strong>Note: If you’re setting up a multi-master with config replication for LDAP, use the same names for the certificate and key files across all nodes, such as ldapcert.pem and ldapkey.pem</strong></p><pre>mv newcert.pem certs/ldapcert.pem<br>mv newreq.pem private/ldapkey.pem</pre><p>Remove the permissions to the server private key:</p><pre>sudo chmod 640 private/ldapkey.pem</pre><p>Create a group (if one does not exist or if ssl-cert package was not installed) called ssl-cert and change group ownership of /etc/ssl/private to ssl-cert:</p><pre>sudo groupadd ssl-cert<br>sudo chown root:ssl-cert /etc/ssl/private<br>sudo chmod 750 /etc/ssl/private</pre><p>give permission to ssl-cert group</p><pre>sudo chown root:ssl-cert private/ldapkey.pem<br>sudo chmod 640 private/ldapkey.pem</pre><p>Add openldap user to ssl-cert group and restart ldap</p><pre>sudo usermod -aG ssl-cert openldap</pre><p>Now update the ldap config to use the certificates:</p><pre>cd /tmp/ldapimport<br>mkdir certconf<br>cd certconf<br>vi addcerts.ldif</pre><p>Enter the following text in vim /tmp/ldapimport/addcerts.ldif:</p><p><em>vi addcerts.ldif</em></p><pre>dn: cn=config<br>changetype: modify<br>replace: olcTLSCACertificateFile<br>olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem<br>-<br>replace: olcTLSCertificateFile<br>olcTLSCertificateFile: /etc/ssl/certs/ldapcert.pem<br>-<br>replace: olcTLSCertificateKeyFile<br>olcTLSCertificateKeyFile: /etc/ssl/private/ldapkey.pem<br>-<br>replace: olcTLSCipherSuite<br>olcTLSCipherSuite: SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:+VERS-DTLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC<br>-<br>replace: olcTLSProtocolMin<br>olcTLSProtocolMin: 3.3</pre><p>olcTLSCipherSuite and olcTLSProtocolMin are used to limit the minimum protocol version 1.2 (3.3 means TLS 1.2 and 3.2 means TLS 1.1 and so on) and strong ciphers.</p><p>Save and close, and run ldap command to update config:</p><pre>sudo ldapmodify -H ldapi:// -Y EXTERNAL -f addcerts.ldif</pre><pre>sudo systemctl restart slapd<br>sudo systemctl status slapd</pre><p>To verify the SSL certificates</p><pre>cat /etc/ldap/slapd.d/cn\=config.ldif<br>or<br>slapcat -n 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*wCZuQa7PlPGl0mzap9LMrQ.png" /></figure><p>We have now completed the setup of the SSL certificate for one node.</p><h3><strong>Configure SSL certificates for the remaining OpenLDAP Servers</strong></h3><p><strong>Note: Follow the below steps for all 3 remaining nodes.</strong></p><p><strong>Add the same name on all 4 servers</strong><br><strong>(cacert, ldapcert.pem and ldapkey.pem)</strong></p><p><strong>Step 1: Copy the CA Certificate to LDAP 2</strong></p><p>First, ensure that LDAP 2 trusts the CA that signed LDAP 1’s certificate.</p><pre>cat /etc/ssl/certs/cacert.pem<br>#Copy the above file from Previous LDAP(Central) server.<br><br>#In ldap2 create the below file (Another Server)<br>vim /etc/ssl/certs/cacert.pem<br>Paste it and save it</pre><p>Edit the<strong> /etc/ssl/openssl.cnf</strong> and uncomment the following property under the [ CA_default ] section:</p><pre>copy_extensions = copy</pre><p>This will ensure that when certificates are signed, the SAN (Subject Alternate Names) are copied to the certificate so that clients can successfully connect to the server.</p><p><strong>Step2: Generate a Certificate Signing Request (CSR) on LDAP 2</strong></p><p><strong>Step 2.1: Create a new private key</strong></p><p>On LDAP 2, generate a new private key:</p><pre>#ssh root@172.16.0.2<br>openssl genrsa -out /etc/ssl/private/ldapkey.pem 2048</pre><p><strong>Step 2.2: Create the CSR configuration file</strong></p><p>Create a CSR configuration file on LDAP 2 at /etc/ssl/certreq.txt with LDAP 2’s details:</p><pre>[req]<br>default_bits = 2048<br>prompt = no<br>default_md = sha256<br>req_extensions = req_ext<br>distinguished_name = dn<br><br>[ dn ]<br>C=IN<br>ST=Maharashtra<br>L=Pune<br>O=example<br>OU=example<br>emailAddress=info@example.in<br>CN = ldap02.example.in<br>[ req_ext ]<br>subjectAltName = @alt_names<br><br>[ alt_names ]<br>DNS.1 = ldap02.example.in<br>IP.1 = 172.16.0.2</pre><p><strong>Step 2.3: Generate the CSR</strong></p><p>Generate the CSR using the configuration file:</p><pre>openssl req -new -key /etc/ssl/private/ldapkey.pem -out /etc/ssl/newreq.pem -config /etc/ssl/certreq.txt</pre><p><strong>Step 3: Sign the CSR with the CA on LDAP 1 (Central Server)</strong></p><pre>#scp /etc/ssl/newreq.pem root@172.16.0.2:/etc/ssl/<br><br>or<br><br>cat /etc/ssl/newreq.pem<br>Copy the above file from LDAP2(Second server)<br><br>In ldap1 (Central) create<br>vim /etc/ssl/newreq.pem<br>Paste it and save it</pre><p>On LDAP 1, sign the CSR with your CA:</p><pre>cd /etc/ssl<br>/usr/lib/ssl/misc/CA.pl -sign</pre><p>When prompted, press Enter to create and set a passphrase</p><p><strong>Step 4:</strong> <strong>On LDAP 2, update the OpenLDAP configuration to use the new SSL certificate.</strong></p><p>Copy the signed certificate back to LDAP 2<br>If we have multiple nodes, follow the same steps on each server:</p><ol><li>Generate the newreq.pem file on each server.</li><li>Sign in on the central server (172.16.0.1)</li><li>Copy the signed certificate back to each server.</li></ol><p><strong>Note:</strong> To avoid conflicts, perform these steps on one server at a time.<br>Create a new folder and move the previous req and cert file into that folder.</p><pre>#scp /etc/ssl/newcert.pem root@172.16.0.2:/etc/ssl/certs/ldapcert.pem<br><br>or<br><br>cat /etc/ssl/newcert.pem<br>Copy the above file<br><br>In ldap2(Second server) create<br>vim /etc/ssl/certs/ldapcert.pem<br>Paste it and save it</pre><p><strong>Step 5: Grant Permission for the Private key we generated earlier in Step 2.1 on the Second LDAP server.</strong></p><p>Remove the permissions to the server private key:</p><pre>sudo chmod 640 private/ldapkey.pem</pre><p>Create a group (if one does not exist or if ssl-cert package was not installed) called ssl-cert and change group ownership of /etc/ssl/private to ssl-cert:</p><pre>sudo groupadd ssl-cert<br>sudo chown root:ssl-cert /etc/ssl/private<br>sudo chmod 750 /etc/ssl/private</pre><p>give permission to ssl-cert group</p><pre>sudo chown root:ssl-cert private/ldapkey.pem<br>sudo chmod 640 private/ldapkey.pem</pre><p>Add openldap user to ssl-cert group</p><pre>sudo usermod -aG ssl-cert openldap</pre><p>Now update the ldap config to use the certificates:</p><pre>cd /tmp/ldapimport<br>mkdir certconf<br>cd certconf<br>vim addcerts.ldif</pre><p><strong>Step 6: Attach certificates</strong></p><p>Enter the following text in vim /tmp/ldapimport/addcerts.ldif:</p><p>addcerts.ldif</p><pre>dn: cn=config<br>changetype: modify<br>add: olcTLSCACertificateFile<br>olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem<br>-<br>add: olcTLSCertificateFile<br>olcTLSCertificateFile: /etc/ssl/certs/ldapcert.pem<br>-<br>add: olcTLSCertificateKeyFile<br>olcTLSCertificateKeyFile: /etc/ssl/private/ldapkey.pem<br>-<br>add: olcTLSCipherSuite<br>olcTLSCipherSuite: SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:+VERS-DTLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC<br>-<br>add: olcTLSProtocolMin<br>olcTLSProtocolMin: 3.3</pre><p>olcTLSCipherSuite and olcTLSProtocolMin are used to limit the minimum protocol version 1.2 (3.3 means TLS 1.2 and 3.2 means TLS 1.1 and so on) and strong ciphers.</p><p>Save and close, and run ldap command to update config:</p><pre>sudo ldapmodify -H ldapi:// -Y EXTERNAL -f addcerts.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*ktjFsie5IW45uvA1cPaBow.png" /></figure><p><strong>Note:</strong> If the ldapmodify command fails, ensure that the ssl-cert group has permission to access /etc/ssl/private folder as well as the private key inside that folder.</p><pre>sudo systemctl restart slapd<br>sudo systemctl status slapd</pre><p><strong>Step 7: To verify the SSL certificates</strong></p><pre>cat /etc/ldap/slapd.d/cn\=config.ldif<br>or<br>slapcat -n 0</pre><h3><strong>Set the LDAP/LDAPS protocol</strong></h3><p><strong>/etc/default/slapd</strong> file as follows,</p><pre>vim /etc/default/slapd</pre><p>On each server add the respective server IP address.</p><p>For example for the second server, it will be 172.16.0.2 or ldap02.example.in</p><pre>SLAPD_SERVICES=&quot;ldap://172.16.0.1 ldapi:/// ldaps://172.16.0.1&quot;<br><br>or <br><br>SLAPD_SERVICES=&quot;ldap://ldap01.example.in ldapi:/// ldap://ldap01.example.in&quot;</pre><p><strong>Note: If you configure slapd services using an IP address, ensure that the olcServerID for replication is also specified as the IP. Similarly, if you’re using DNS names, use the same hostnames for replication.</strong></p><p>In my case, I am going to use the DNS names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*s1T4WDruRONHDix6bhrbjw.png" /></figure><p>Restart ldap service:</p><pre>sudo service slapd stop<br>sudo service slapd start</pre><p>Note: Add the same file name on all 4 servers<br><strong>(cacert, ldapcert.pem and ldapkey.pem)</strong></p><p><strong>If the slapd service is not starting, ensure that the IP address or DNS name is correctly configured.</strong></p><h3><strong>Force TLS for all connections</strong></h3><p>Note: Follow the below steps for all the servers</p><pre>sudo ldapsearch -H ldapi:// -Y EXTERNAL -b &quot;cn=config&quot; -LLL -Q &quot;(olcSuffix=*)&quot; dn olcSuffix</pre><p>This will list the config database and the DITs available like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NGlOto3VVUVyFvXGUpDW7A.png" /></figure><p>dn: olcDatabase={1}mdb,cn=config is the config database for example.in note, this will be required in the next step.</p><pre>mkdir /tmp/ldapimport/forcetls<br>cd /tmp/ldapimport/forcetls<br><br>vi forcetls.ldif</pre><p>Now copy the following note the dn value should match with the previous:</p><pre>dn: olcDatabase={1}mdb,cn=config<br>changetype: modify<br>add: olcSecurity<br>olcSecurity: tls=1</pre><p>Save and close. Then apply the config:</p><pre>sudo ldapmodify -H ldapi:// -Y EXTERNAL -f forcetls.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*AVrcbpNM8CCIXTRCyq3iXQ.png" /></figure><h3><strong>Configure the OpenLDAP config file on all servers</strong></h3><p><strong>Now edit the /etc/ldap/ldap.conf and find TLS_CACERT and set the ca certification location as: /etc/ssl/certs/cacert.pem</strong></p><p><strong>Note: if you’re using multiple nodes then add all servers</strong></p><pre>vim  /etc/ldap/ldap.conf</pre><pre>TLS_CACERT      /etc/ssl/certs/cacert.pem<br>TLS_REQCERT allow<br>URI     ldaps://ldap01.example.in ldaps://ldap02.example.in ldaps://ldap03.example.in ldaps://ldap04.example.in</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*zQQbK7KQTFf9xQL0F9wq9Q.png" /></figure><p>Restart the service:</p><pre>sudo service slapd stop<br>sudo service slapd start</pre><p>Now TLS is forced. To test from the shell:</p><pre>ldapsearch -H ldap://ldap01.example.in -x -b &quot;dc=example,dc=in&quot; -LLL dn<br><br>or<br><br>ldapsearch -H ldap://172.16.0.1 -x -b &quot;dc=example,dc=in&quot; -LLL dn</pre><p>This command should fail with the following message:</p><p><strong>Confidentiality required (13)</strong></p><p><strong>Additional information: TLS confidentiality required</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1qV_jDK28WvSONTRicG7Q.png" /></figure><p><strong>Now try with TLS:</strong></p><pre>ldapsearch -H ldap://ldap01.example.in -x -b &quot;dc=example,dc=in&quot; -LLL -Z dn</pre><p>You may get an error like additional info: TLS: hostname does not match CN in peer certificate, but you can ignore that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KIiQ5JXTmkvNO1W5LB8Bcg.png" /></figure><p>Test the LDAP connection:</p><pre>ldapwhoami -H ldap://ldap01.example.in  -x<br>ldapwhoami -H ldaps://ldap01.example.in  -x</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_PCLSFORA75q2mtzjiTVA.png" /></figure><p>Once all nodes are configured as mentioned above, proceed by running the command.</p><p>Next steps:</p><ol><li>Log in to the first server.</li><li>Run the below command</li></ol><pre>ldapsearch -H ldap://ldap01.example.in -x -b &quot;dc=example,dc=in&quot; -LLL -Z dn<br>ldapsearch -H ldap://ldap02.example.in -x -b &quot;dc=example,dc=in&quot; -LLL -Z dn<br>ldapsearch -H ldap://ldap03.example.in -x -b &quot;dc=example,dc=in&quot; -LLL -Z dn<br>ldapsearch -H ldap://ldap04.example.in -x -b &quot;dc=example,dc=in&quot; -LLL -Z dn<br>or<br>ldapsearch -H ldaps://ldap01.example.in -x -b &quot;dc=example,dc=in&quot;</pre><p><strong>Note: You should be able to fetch data from another LDAP node on the same server. If this is not working, there might be an issue with the LDAP certificates.</strong></p><p>We have completed the OpenLDAP SSL setup.</p><p><em>The next steps will focus on configuring the multi-master setup on OpenLDAP servers, as outlined in the </em><a href="https://medium.com/@lansonlp/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-4-4e735140891d"><em>following link</em></a><em>.</em></p><h4>CONCLUSION:</h4><p>We have successfully set up SSL/TLS on your OpenLDAP servers. This configuration ensures encrypted communication between the LDAP clients and servers, enhancing the security of data transmission. If issues arise, such as failure to fetch data from other nodes, it may be necessary to verify the LDAP certificates and ensure proper configuration of IP addresses or DNS names. With SSL/TLS in place, the environment is now ready for further configurations, such as setting up a multi-master replication.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0481384e0870" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-3-0481384e0870">OpenLDAP SSL Certificate Creation using OpenSSL and Attaching SSL Certificate to each Server- Part…</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenLDAP Basic Schema Import and Password Policies- Part 2]]></title>
            <link>https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-2-a2fb87a57c03?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2fb87a57c03</guid>
            <category><![CDATA[password-policies]]></category>
            <category><![CDATA[data-modernization]]></category>
            <category><![CDATA[openldap]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 05:00:06 GMT</pubDate>
            <atom:updated>2025-03-24T17:29:32.844Z</atom:updated>
            <content:encoded><![CDATA[<h3>How did we manage to set up OpenLDAP on GCP and migrate it.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*756vdIhQOMrn2TccGsXk3Q.jpeg" /></figure><h3>INTRODUCTION:</h3><p>OpenLDAP is a versatile directory service that allows for effective management of directory information through the use of schemas. Importing basic schemas is essential for defining the structure and types of data, such as user accounts and groups, that can be stored. Additionally, implementing strong password policies is vital for enhancing security by enforcing standards for password complexity, expiration, and history. Understanding how to import schemas and configure password policies in OpenLDAP enables administrators to create a secure and organized directory environment.</p><p><strong>Topics:</strong></p><ul><li>OID implement</li><li>OpenLDAP Schema imports</li><li>Password Policy overlay</li></ul><h4><strong>Step 1: Identify if You Need an OID</strong></h4><ul><li><strong>OID</strong> is used in LDAP to identify schema elements like object classes and attributes uniquely.</li><li>You need to<a href="https://www.openldap.org/faq/data/cache/197.html"> register a unique OID to avoid</a> conflicts, especially if you’re creating custom schema extensions.</li></ul><h4>Step 2: Obtain a Private Enterprise Number (PEN)</h4><p>You can obtain an OID by registering a <strong>Private Enterprise Number </strong><a href="https://www.iana.org/assignments/enterprise-numbers/"><strong>(PEN)</strong></a> with IANA (Internet Assigned Numbers Authority). The PEN is the base OID under which you can define your own sub-OIDs for various schema elements.</p><ul><li>Go to the IANA PEN registration page: <a href="https://www.iana.org/assignments/enterprise-numbers/assignment/apply/">IANA PEN Application</a>.</li><li>Complete the application form with details about your organization.</li></ul><h4><strong>Step 3: OpenLDAP Custom Schema</strong></h4><p>Refer to the OpenLDAP official <a href="https://www.openldap.org/doc/admin24/schema.html">website</a></p><p>Also, Refer to the custom <a href="https://guillaumemaka.com/2013/07/17/openldap-create-a-custom-ldap-schema/">schema</a></p><h4><strong>Step 4: OpenLDAP Schema imports</strong></h4><p>First, create a folder in /tmp, let&#39;s say /tmp/ldapimport</p><p>Then copy the custom.schema file to /tmp/ldapimport</p><p>Note: If you do not have any custom schemas, do not include them.</p><p>Create a file called /tmp/ldapimport/import.conf and add the following save and close.</p><p>vim import.conf</p><pre>include /etc/ldap/schema/core.schema<br>include /etc/ldap/schema/cosine.schema<br>include /etc/ldap/schema/nis.schema<br>include /etc/ldap/schema/inetorgperson.schema<br>include /tmp/ldapimport/custom.schema</pre><p>Change to the folder and run slaptest</p><pre>cd /tmp/ldap<br>mkdir output<br>slaptest -f import.conf -F /tmp/ldapimport/output</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*PcudslEtEnpCU-KAoXQFnA.png" /></figure><p>If the command is successful, you should get a message like ‘config file testing succeeded’. and there will be output in the output folder.</p><p><strong>Note: Follow the steps below if you have a custom schema. If not, you can skip these steps and proceed directly to step 5.</strong></p><pre>copy the<br> /tmp/ldapimport/output/cn=config/cn=schema/cn={4}custom.ldif <br>To<br> /etc/ldap/schema/custom.ldif<br><br>change the first line<br> dn: cn={0}custom<br>and change it to<br>dn: cn=custom,cn=schema,cn=config<br><br> Change<br> cn: {0}custom<br> To<br> cn: custom<br> Remove all the lines starting from &quot;structuralObjectClass:&quot;</pre><p>Run the command</p><pre>ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/custom.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*Nnji8kpLAIfHsUM7O7j-jQ.png" /></figure><p><strong>Step 6: Applying password Policy overlay</strong></p><p>Refer to the following links:</p><p><a href="https://tobru.ch/openldap-password-policy-overlay/">Link 1</a></p><p><a href="http://tutoriels.meddeb.net/openldap-password-policy-managing-users-accounts/">Link 2</a></p><p>First, load the ppolicy schema into ldap.</p><p>Note: The ldapadd step for ppolicy.ldif is only necessary for OpenLDAP versions 2.4 and older. Starting with version 2.5, the password policy module is already included, so you can proceed directly to configuring it from the next step.</p><p>Since the LDAP version is 2.5.17, No need to perform this command.</p><pre>ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif</pre><p>Ignore the above step and execute from the below steps,</p><p>Now, create a file named /tmp/ppolicymodule.ldif and add the following content:</p><pre>dn: cn=module{0},cn=config<br>changeType: modify<br>add: olcModuleLoad<br>olcModuleLoad: ppolicy</pre><p>Now load the module:</p><pre>ldapmodify -Y EXTERNAL -H ldapi:/// -f /tmp/ppolicymodule.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*_LyXbGSZ92LUEc8PHv8ugw.png" /></figure><p>Check whether the module is loaded:</p><pre>ldapsearch -H ldapi:/// -Y EXTERNAL -b cn=config &quot;(objectClass=olcModuleList)&quot; olcModuleLoad -LLL</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufIQBak_2do8bdCj0IEsFQ.png" /></figure><p>If you can see ppolicy in the list, then the password policy module is loaded.</p><p><strong>NOTE: Below To Be Checked if needed in Prod or Not</strong></p><p>Now create a default policy. In the olcPPolicyDefault, you can configure any names you want.</p><p>Create a file, for example, /tmp/ppolicy-conf.ldif, and add the policy configurations as follows:</p><p><strong>Note: </strong>Replace your domain</p><pre>dn: olcOverlay=ppolicy,olcDatabase={1}mdb,cn=config<br>objectClass: olcOverlayConfig<br>objectClass: olcPpolicyConfig<br>olcOverlay: ppolicy<br>olcPPolicyDefault: cn=ppolicy,dc=example,dc=in<br>olcPPolicyUseLockout: FALSE<br>olcPPolicyHashCleartext: TRUE</pre><p>Check the olcDatabase from /etc/ldap/slap.d/cn=config and see the appropriate value in the first line in the above file.</p><p>Run the below command to verify the config files</p><pre>slapcat -n 0</pre><p>Now configure it:</p><pre>ldapadd -Y EXTERNAL -H ldapi:/// -f /tmp/ppolicy-conf.ldif</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*tylVltd4Rq_EOaf0m1bXRw.png" /></figure><p>Now check and confirm it is set properly:</p><pre>ldapsearch -H ldapi:/// -Y EXTERNAL -b cn=config &quot;(objectClass=olcPpolicyConfig)&quot; -LLL</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*90NDfvbRc1HW2SWk8gemIw.png" /></figure><p>Finally, let’s configure the options for the default policy created above.</p><p>Create a file, for example, /tmp/ppolicy-default.ldif, and add the following content:</p><p><strong>Note: </strong>Replace your domain</p><pre>dn: cn=ppolicy,dc=example,dc=in<br>objectClass: device<br>objectClass: pwdPolicyChecker<br>objectClass: pwdPolicy<br>cn: ppolicy<br>pwdAllowUserChange: TRUE<br>pwdAttribute: userPassword<br>pwdCheckQuality: 1<br>pwdExpireWarning: 600<br>pwdFailureCountInterval: 30<br>pwdGraceAuthNLimit: 5<br>pwdInHistory: 5<br>pwdLockout: TRUE<br>pwdLockoutDuration: 0<br>pwdMaxAge: 0<br>pwdMaxFailure: 5<br>pwdMinAge: 0<br>pwdMinLength: 4<br>pwdMustChange: FALSE<br>pwdSafeModify: FALSE</pre><p>Note: The value of dn in the First line must match with the olcPPolicyDefault defined in the previous step.</p><p>Note: Many options are available, check the ppolicy.ldiffile for configuration <a href="https://tools.ietf.org/html/draft-behera-ldap-password-policy-08">available</a>.</p><p>Now install the policy (You will need an admin password):</p><pre>ldapadd -x -H ldapi:/// -D cn=admin,dc=example,dc=in -W -f /tmp/ppolicy-defaut.ldif</pre><p>Verify the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*tKaV4qP7AxY9M17UKccxkA.png" /></figure><p><strong>Note: </strong>Replace your domain</p><pre>ldapsearch -x -H ldapi:/// -D cn=admin,dc=example,dc=in -W -b dc=example,dc=in &quot;(objectClass=pwdPolicy)&quot; -LLL</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q63YIGbdQNjYb1l7GHfMXw.png" /></figure><p>Password policy is now implemented.</p><p><em>The upcoming steps will focus on creating an SSL certificate using OpenSSL and then attaching this SSL certificate to each OpenLDAP server as outlined in the </em><a href="https://medium.com/@lansonlp/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-3-0481384e0870"><em>following link</em></a><em>.</em></p><h4>CONCLUSION:</h4><p>The LDAP schema import and password policy setup has been completed. The schema has been updated with the necessary attributes and object classes to meet the organizational requirements. Additionally, password policies have been configured to enhance security by enforcing complexity requirements and expiration rules.</p><h4>REFERENCES:</h4><p><a href="https://www.openldap.org/faq/data/cache/197.html">https://www.openldap.org/faq/data/cache/197.html</a><br><a href="https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers">https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers</a><br><a href="https://www.iana.org/assignments/enterprise-numbers/assignment/apply/">https://www.iana.org/assignments/enterprise-numbers/assignment/apply/</a><br><a href="https://guillaumemaka.com/2013/07/17/openldap-create-a-custom-ldap-schema/">https://guillaumemaka.com/2013/07/17/openldap-create-a-custom-ldap-schema/</a><br><a href="https://www.openldap.org/doc/admin24/schema.html">https://www.openldap.org/doc/admin24/schema.html</a><br><a href="http://tutoriels.meddeb.net/openldap-password-policy-managing-users-accounts/">http://tutoriels.meddeb.net/openldap-password-policy-managing-users-accounts/</a><br><a href="https://tools.ietf.org/html/draft-behera-ldap-password-policy-08">https://tools.ietf.org/html/draft-behera-ldap-password-policy-08</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2fb87a57c03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-2-a2fb87a57c03">OpenLDAP Basic Schema Import and Password Policies- Part 2</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenLDAP Installation and Initial LDAP Configuration- Part 1]]></title>
            <link>https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-1-5c1494ddc304?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c1494ddc304</guid>
            <category><![CDATA[openldap]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[data-modernization]]></category>
            <category><![CDATA[installation]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 30 Sep 2024 04:58:52 GMT</pubDate>
            <atom:updated>2025-03-16T23:45:25.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>How we managed to set up OpenLDAP on GCP and migrate it.</h3><h4>INTRODUCTION:</h4><p>Lightweight Directory Access Protocol (LDAP) is a standard protocol for managing and accessing hierarchical directory data across a network. Although it can store diverse types of information, its primary use is for centralized authentication systems or corporate directories for email and phone contacts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOgwY4MgeM5NAVgkxoE72A.png" /></figure><p>LDAP is a widely accepted application protocol (as defined by RFC) that establishes a standard interface or communication language for client applications to interact with directory services, such as OpenLDAP or Active Directory. It allows these applications to query or modify directory information.</p><h4><strong>PROBLEM STATEMENT:</strong></h4><p>This guide will cover installing and configuring an OpenLDAP server on Ubuntu 22. We will install OpenLDAP packages, set up schemas, and apply password policies. Additionally, we will secure the LDAP service using SSL certificates from OpenSSL, a provider of free and automated certificates. Finally, we will configure a multi-master replication setup across multiple nodes.</p><p>This blog will cover the implementation of LDAP replication and migration from on-premises to Google Cloud Platform (GCP).</p><p><strong>Note:</strong> In this scenario, we will implement LDAP servers, with two on-premises and two on the Google Cloud Platform (GCP).</p><h4><strong>PRE-REQUISITES:</strong></h4><ul><li>A GCP project</li><li>Networks and Firewalls</li><li>Google-managed compute instances (VMs)</li><li>open-source OpenLDAP</li><li>OpenSSL SSL certificates</li></ul><h4>Topics Covered:</h4><ul><li>OpenLDAP Installation</li><li>OpenLDAP Validation</li><li>Importing LDAP Schemas</li><li>Implementation of Password policy</li><li>SSL Certificate creation using openSSL</li><li>Attaching SSL certificate for each server</li><li>Force TLS for all connections</li><li>Configuration of Multi-master Replication</li><li>Object creation</li><li>OpenLDAP backups</li></ul><h4>Networks and Firewalls</h4><ul><li>Configure VPN between on-prem to GCP</li><li>Allow Firewall rules for Port 389,636</li></ul><h4>1. OpenLDAP Installation:</h4><p><strong>Step 1:</strong> <strong>Installation of OpenLDAP packages on all 4 servers.</strong></p><p>Log in to the server and run the commands below.<br>During the installation, you will be asked to select and confirm an administrator password multiple times for LDAP.<br><strong>Note:</strong> Keep your password handy, as the admin password will be required to configure the LDAP server at the administrative level.</p><pre>sudo apt-get update<br>sudo apt-get install slapd ldap-utils</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*QIiPTiuokchc-nu1I-n5pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EY75xEV7_BsfdtM6" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*N5sTxMWdH9wAJx44" /></figure><p>Although we have just installed the package, we will proceed with reconfiguring it. The slapd package can prompt several important configuration questions, but these are skipped by default during installation. To access all of these prompts, we need to instruct our system to reconfigure the package.</p><pre>sudo dpkg-reconfigure slapd</pre><p>For the domain, enter the root domain you want (e.g., if you use example.com, it will be configured as dc=example,dc=com). <br>The organization’s name can be set to “Example.”</p><p>There are quite a few new questions to answer in this process.<br>• Omit OpenLDAP server configuration? <strong>No</strong><br>• Administrator password? Enter a secure password twice<br>• Remove the database when slapd is purged? <strong>No</strong><br>• Move old database? <strong>Yes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xk9K3VbbVmj-wqTX" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*6w4FWMqAmLcoTjvk" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*c1_wbkHGjOlZM8HD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*nxnQOasxgib2uXS4" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/0*J5BFwWsKzKn61rid" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lZFSJv3L_8URpbTP" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*AHHm_SjSsp4ubcS4OttA0Q.png" /></figure><p><strong>Step 2: Configure Firewall<br></strong>At this stage, your LDAP server is configured and running. Open the LDAP port on your firewall to allow external clients to connect.</p><pre>sudo ufw allow ldap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*Spv3ZBpM05Uc4z-xpaptTA.png" /></figure><h4>2. OpenLDAP Validation:<strong><br>Step 1: Port Validation</strong></h4><pre>sudo apt install net-tools<br>netstat -tunlp | grep slapd</pre><p><strong>Note:</strong> Initially, you may see only port 389 enabled. Once SSL is configured, both ports 389 and 636 will be enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/0*jrOJEbaHMCI19VfU" /></figure><p><strong>Step 2: Test the LDAP connection</strong></p><p>Let’s verify our LDAP connection using the ldapwhoami command, which should return the username to which we are currently connected.</p><pre>ldapwhoami -H ldap:// -x</pre><p>The output will be, <strong>anonymous</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*bd94uFGX4FtYAgRSbX5xdA.png" /></figure><p><strong>Step 3: Test the slapd(LDAP)service</strong></p><pre>systemctl enable slapd<br>systemctl status slapd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*9Pt2119KtoxkflFbANkH-w.png" /></figure><p><strong>Step 4: Check the LDAP version</strong></p><pre>dpkg -l | grep slapd<br>slapd -V</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*ck8ZEIOqh-EFLUuUuxFRmQ.png" /></figure><p>The installed version will be 2.5.17</p><p>Step 5: Validate through ldapsearchcommand</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*2M-aFEhWhXBtLSRWs2TjBA.png" /></figure><p>Also, check using the below command</p><pre>sudo debconf-show slapd</pre><p><strong>OpenLDAP has been successfully installed on the server.</strong><br><em>The next steps will cover the import of the basic OpenLDAP schema and the implementation of password policies in the </em><a href="https://medium.com/@lansonlp/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-2-a2fb87a57c03"><em>following link</em></a><em>.</em></p><h4>CONCLUSION:</h4><p>After successfully installing and configuring LDAP on the server, the service is now running and ready for use. The LDAP ports are open for connections, and basic tests confirm that the server is functioning as expected. Further configuration, such as Schema, Password policy, and SSL setup, can be done to enhance security.</p><h4>REFERENCES:</h4><p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-openldap-and-phpldapadmin-on-ubuntu-16-04#prerequisites">https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-openldap-and-phpldapadmin-on-ubuntu-16-04#prerequisites<br></a><a href="https://ubuntu.com/server/docs/service-ldap">https://ubuntu.com/server/docs/service-ldap</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c1494ddc304" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/how-did-we-manage-to-set-up-openldap-on-gcp-and-migrate-it-part-1-5c1494ddc304">OpenLDAP Installation and Initial LDAP Configuration- Part 1</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Establishing Alert Notifications for Google Managed SSL certificates within a Google Cloud Platform]]></title>
            <link>https://medium.com/niveus-solutions/establishing-alert-notifications-for-google-managed-ssl-certificates-within-a-google-cloud-platform-167dfe60753f?source=rss-2f9c68ed7bdb------2</link>
            <guid isPermaLink="false">https://medium.com/p/167dfe60753f</guid>
            <category><![CDATA[google-managed-ssl]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Lanson Pereira]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 05:54:37 GMT</pubDate>
            <atom:updated>2025-03-16T23:30:26.422Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Establishing Alert Notifications for SSL certificates within a Google Cloud Platform (GCP)</strong></h3><h3>INTRODUCTION:</h3><p>In contemporary cloud computing administration, ensuring resource security holds paramount importance for organizations. SSL certificates stand out as indispensable tools for safeguarding secure connections and confidential data. Given their finite validity period, proactive monitoring of certificate expiration is critical to prevent service disruptions and potential security vulnerabilities.</p><p>In this scenario, establishing “SSL certificate alerts” within a Google Cloud Platform (GCP) project emerges as a pivotal tactic. With the integration of automated alerts, organizations can proactively address certificate expirations, act promptly, and maintain uninterrupted secure communication channels.</p><p>Setting up SSL certificate alerts in a GCP project requires understanding the details of certificate validity, setting up tools for monitoring, and using automatic notifications. We intend to emphasize how crucial this procedure is to maintain a safe and secure cloud infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pbc6oEu3iWGAayd0vGuSRQ.png" /></figure><h3>PROBLEM STATEMENT:</h3><p>For all Google-managed certificate issued in a GCP project, an alert policy needs to be set up for a certain time period, a few days prior to the SSL certificate expiration and also after the certificate expires.</p><h3>PRE-REQUISITES:</h3><ol><li>A GCP project is necessary.</li><li>Within this project, A GCP managed certificate must be created and maintained under the Certificate Manager section.</li></ol><h3>STEPS:</h3><h4><strong>1. Alerting for Expired SSL certificate:</strong></h4><p><strong>Step1: </strong>Navigate to Monitoring &gt; Log Explorer &gt; Create Alert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzJWGaFgSCab7sKar5j0Bw.png" /></figure><p><strong>Step 2: Add Alert details</strong></p><p>Add Alert Policy name<br>Add Severity Level &gt; Critical<br>Add Documentation &gt; The message will be displayed in the alert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*H67QDPtp0Kee2FX5Aphvxw.png" /></figure><p>Step 3: Logs for Alert</p><p>Add this below log filter to fetch an expired certificate in the GCP project.<br><strong>Note: </strong>Replace the project ID and Log labels are optional.</p><pre>logName = &quot;projects/PROJECT_ID/logs/certificatemanager.googleapis.com%2Fcertificates_expiry&quot; AND jsonPayload.state = &quot;EXPIRED&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*KtJ4_bYPIi-I2hbFbcVRPQ.png" /></figure><p><strong>Step 4:</strong> Set Notification Duration<br>1. Add time between notifications<br> This will generate an alert 10 minutes after identifying an expired SSL certificate.<br>2. Incident autoclose duration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*UT5KJS2XKS9Df-XGI8Wc8Q.png" /></figure><p><strong>Step 5: </strong>Set Notification Receiver</p><p>Click on Manage Notification Channels<br>Click on email<br>Add an email and name of the user to send an alert and close it.<br>Refresh the filter block, Select the users click OK, and Save it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*0AQW1p4-keI8XETJxpUn-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WIk57exEr0LDaVAyXO5FOQ.png" /></figure><p>Done</p><h4><strong>2. Alerting for SSL certificate Renewal</strong></h4><p><strong>Step1: </strong>Navigate to Monitoring &gt; Log Explorer &gt; Create Alert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CjeljZtqrfInY8s4eMx3Uw.png" /></figure><p><strong>Step 2: Add Alert details</strong></p><p>Add Alert Policy name<br>Add Severity Level &gt; Warning<br>Add Documentation &gt; The message will be displayed in the alert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*3RFt6uXW3fmv8z-2q_-A6A.png" /></figure><p><strong>Step 3:</strong> Logs for Alert</p><p>Add this below log filter to fetch the certificates that are close to expiry in the GCP project.<br>Note: Replace the project ID and Log labels are optional.</p><pre>logName = &quot;projects/PROJECT_ID/logs/certificatemanager.googleapis.com%2Fcertificates_expiry&quot; AND jsonPayload.state = &quot;CLOSE_TO_EXPIRY&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*9iTrcDIsNfGrRypdq9QCQQ.png" /></figure><p><strong>Step 4:</strong> Set Notification Duration<br>1. Add time between notifications<br>2. Incident autoclose duration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*T9QknshWIOj9MuPzqgQnmg.png" /></figure><p><strong>Step 5: </strong>Set Notification Receiver</p><p>Click on Manage Notification Channels<br>Click on email<br>Add an email and name of the user to send an alert and close it.<br>Refresh the filter block, Select the users click ok, and Save it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*ERC-ntxTsZwHI4za6GnL-A.png" /></figure><p>Done</p><p><strong>Monitoring:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wLSTPM7Qq765wFZxUtWGw.png" /></figure><p><strong>Email Notification</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*aGZGyUc-VG_IhQuj04_1RA.png" /></figure><h3>CONCLUSION:</h3><p>In summary, establishing alerts for SSL certificate expiration in a Google Cloud Platform (GCP) project is a proactive measure to ensure the security and uninterrupted operation of digital services. SSL certificate renewals must be done on time since more and more businesses are sending critical data over secure connections.</p><h3>REFERENCES:</h3><p><a href="https://cloud.google.com/certificate-manager/docs/logs-metrics">https://cloud.google.com/certificate-manager/docs/logs-metrics</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=167dfe60753f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/establishing-alert-notifications-for-google-managed-ssl-certificates-within-a-google-cloud-platform-167dfe60753f">Establishing Alert Notifications for Google Managed SSL certificates within a Google Cloud Platform</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>