Thank you for sharing your set-up. I have never seen anything like that being done before, and not sure what to call it. I'm also having hard time envisioning how the networking would work, like do you have the same MAC addresses for the multiple instances of ldapserver.example.com IP address (one on F5 virtual server, and the openldap pool members)? I'm guessing you can get the openldap servers to respond back using the ldapserver.example.com IP address by creating route entries.
But I'm not even sure a regular in-line load-balancing (using the F5 as the default gateway and using either NAT or SNAT to preserve the client source IP) would work on MS AD Domain Controllers. I'm not sure whether inter-DC traffic such as replication continue to work.
I'll need some time to draw it up and digest this one.
On Wed, Feb 17, 2016 at 4:25 AM, Frank Swasey <Frank.Swasey@xxxxxxx> wrote:
Sounds like my F5 config is slightly different from yours. I’m not certain of the term for it, but my F5 passes the packets without inserting its own address into the packets. All my LDAP servers have the ldapserver.example.com address as a second address on their loopback interface and know that they are also ldapserver.example.com and respond back to the client directly from the ldapserver.example.com address. I’m guessing that in your setup, your AD servers do not have the ldap.test.com address on any of their interfaces and it is likely that the requests are showing up from the address of the F5 not from the actual clients and that your AD servers are answering back to the clients through the F5. I’ve never had to figure out how to make something like that work.—Frank SwaseySystems Architecture & AdministrationFrom: Tadashi Inayama <tci@xxxxxxx>
Date: Tuesday, February 16, 2016 at 6:53 PMHello,A little more details regarding the problem I'm seeing with ldapsearch on my openldap\kerberos\gssapi\sasl\sssd system:Even though I specify rdns = false on /etc/krb5.conf file, there is still a reverse lookup component to the ldap authorization.So if I do not have any special entry on /etc/hosts file, then when I run ldapsearch against ldap.test.com, I get this failure:generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (Server not found in Kerberos database)If I manually place an entry on /etc/hosts file for the IP Address of one of the (two) domain controllers for ldap.test.com, the ldapsearch runs successfully half the time with# search resultsearch: 4result: 0 Success# numResponses: 1But when the load balancer hits to second domain controller, we get this error:generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (Message stream modified)Which means that SASL detects there is a middle-man (the load-balancer) mid-stream.Thank you,TadashiOn Tue, Feb 16, 2016 at 10:52 AM, Frank Swasey <Frank.Swasey@xxxxxxx> wrote:Yes, I conflated SSL and SASL in my answer. So let me clean that up…So, let’s say that my F5 is load balancing based on the name ldapserver.example.com. In the slapd.conf file each of my real servers use, I put the statement:sasl-host ldapserver.example.comAnd in the keytab file that each OpenLDAP server uses, I have a key for ldap/ldapserver.example.com@realmNow, when a GSSAPI connection comes in, OpenLDAP talks to SASL using the ldap/ldapserver.example.com@realm key and verifies that the GSSAPI package is all good.I honestly do not know if AD has the equivalent of the OpenLDAP sasl-host configuration option or not.—Frank SwaseySystems Architecture & AdministrationFrom: Tadashi Inayama <tci@xxxxxxx>
Date: Tuesday, February 16, 2016 at 1:37 PM
To: Frank Swasey <Frank.Swasey@xxxxxxx>
Cc: "cyrus-sasl@xxxxxxxxxxxxxxxxxxxx" <cyrus-sasl@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: Load-balancing LDAP using GSSAPI/Kerberos/Cryus-SASLHello Frank,Thank very much you for your reply. I believe that the solution you are mentioning applies more to load-balancing services that uses ssl certs, such as https. Please correct me if I am wrong. (Or does kerberos\gssapi\sasl use SSL Cert somewhere along the chain?)RedHat Support referred me to this blog:https://ssimo.org/blog/id_019.htmlIn this example, the three https web servers that required kerberos authentication for access were load-balanced.So the picture looked something more like this:\ | /\ | /\ | /\ | /\ | /all.ipa.com (F5 Load Balancer Virtual Server)|||linux_client.ipa.com ------ authentication request ------------> KCD (OpenLDAP/Active Directory)<------ kerberos ticket -------------------------In this case we can have the ssl certs use shared hostnames so we can list uno.ipa.com, due.ipa.com, and tre.ipa.com in the all.ipa.com cert under shared name. (A wild card cert may work also.)What we are attempting to do is slightly different. We are tryin to load-balance the Active Directory Domain Controllers. We can use shared name for SSL Certs, but is there a mechanism either (1) within kerberos to share the hostnames for SPN's or (2) configure Cyrus-SASL to let us use the keytab for authentication so we can import the keys for the domain controllers into the keytab stored the linux clients.Thank you,TadashiA redundant picture:\ /\ /\ /\ /ldap.test.com (virtual server on F5 LTM)|||On Tue, Feb 16, 2016 at 5:25 AM, Frank Swasey <Frank.Swasey@xxxxxxx> wrote:With OpenLDAP you solve this by using an ssl cert with Alternative names on each server – and you use the sasl-host parameter to tell OpenLDAP to use that common name between the various certs on the actual LDAP servers. How you duplicate that in AD is left to the reader…—Frank SwaseySystems Architecture & AdministrationFrom: Cyrus-sasl <cyrus-sasl-bounces+frank.swasey=uvm.edu@xxxxxxxxxxxxxxxxxxxx> on behalf of Tadashi Inayama via Cyrus-sasl <cyrus-sasl@xxxxxxxxxxxxxxxxxxxx>
Reply-To: Tadashi Inayama <tci@xxxxxxx>
Date: Friday, February 12, 2016 at 5:10 PM
To: "cyrus-sasl@xxxxxxxxxxxxxxxxxxxx" <cyrus-sasl@xxxxxxxxxxxxxxxxxxxx>
Subject: Load-balancing LDAP using GSSAPI/Kerberos/Cryus-SASLHello,I am new to using GSSAPI/Kerberos/SASL but we got it working for authorization for LDAP queries from RHEL 5.11 and RHEL 6.7 clients against Win2k12 R2 Domain Controllers.But when we try to load balance the LDAP traffic with F5 LTM (with dc1.test.com and dc2.test.com as the pool members), ldapsearch via gssapi works half the time, and the other half we get an error that the message is changed mid-stream. We are guessing that Cyrus-SASL does a reverse dns lookup of the domain controllers as a final check, and if the ip address of the domain controller does not match the hostname of the F5 Virtual Server then the error pops back as message changed mid-stream. So it work half of the time.So we did some googling and came across this post:"There is a work around for this at the GSSAPI layer, which is to tell the server to trust any principal that exists in the service's keytab. Unfortunately, Cyrus SASL doesn't seem to expose a mechanism for doing this, and so the only way to do so is via a code change to the SASL library."This post was from 2009. So is there currently a mechanism in Cyrus SASL to trust the principals whose key exists in the krb5.keytab? Or is there some established method to load balance between two MS Domain Controllers?(The reason we are trying to load balance the ldap queries is so that when we perform patch or other maintenance work on the individual domain controllers, we don't break the authentication/authorization on the RHEL servers. Without load balancing, we will need to change the authentication server entries on krb5.conf and sssd.conf in each of the RHEL servers. And we already have dns, ntp, and kerberos load-balancing using the F5, we just need to get the ldap portion completed.)Thank you very much,Tadashi\ /\ /\ /\ /ldap.test.com (virtual server on F5 LTM)|||