As per K8SPSMDB-732, TLS is now supported with LDAP authentication on Percona Operator for MongoDB 1.16.0 and above. This feature has been documented here as well. I’ve written a previous article on using LDAP authentication and authorization without TLS, so let me provide the instructions here on incorporating TLS with LDAP.

First, you need to create a secret that contains the SSL certificates to connect to LDAP:

At the time of writing, it seems that only the CA certificate is being honored by the operator, so you can simply just add that certificate:

Second, under the secrets section of cr.yaml, add a reference to the secret using the key, ldapSecret and apply it:

Third, enable TLS configuration for the replicaset, config server, and mongos by setting “transportSecurity: tls” in their configuration and apply this change:

Once the pods have restarted, you can see from the logs that it is using the CA certificate you have added for LDAP authentication:

Voila! Now your replicasets, config servers, and mongos can authenticate to LDAP over TLS instead of sending plain usernames and passwords to LDAP on an unencrypted network.

Try out Percona Operator for MongoDB. It allows you to deploy and manage clusters in minutes anywhere, including cloud, on-prem, and hybrid environments.

MongoDB Performance Tuning is a collection of insights, strategies, and best practices from Percona’s MongoDB experts. Use it to diagnose — and correct — the issues that may be affecting your database’s performance.

 

Master MongoDB Performance

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments