Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1353750 - [RFE] Add logging to show which LDAP server was used to execute query on
[RFE] Add logging to show which LDAP server was used to execute query on
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-extension-aaa-ldap (Show other bugs)
unspecified
All All
medium Severity medium
: ovirt-4.1.0-beta
: ---
Assigned To: Martin Perina
Gonza
: FutureFeature
: 1339939 (view as bug list)
Depends On:
Blocks: 1427729
  Show dependency treegraph
 
Reported: 2016-07-07 18:26 EDT by Greg Scott
Modified: 2017-06-23 17:05 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this update, the debug logging for ovirt-engine-extension-aaa-ldap has been updated. When ovirt-engine-extension-aaa-ldap is enabled the following messages will show in the logs. The LDAP server that authenticated a user is shown as "User 'myuser1' is performing bind request to: ldap.example.com" and the LDAP server that performed a search request is shown as "Performing SearchRequest '...' request on server ldap.example.com."
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
grafuls: testing_plan_complete-


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 62870 None None None 2016-08-26 07:51 EDT
Red Hat Product Errata RHEA-2017:1017 normal SHIPPED_LIVE ovirt-engine-extension-aaa-ldap bug fix and enhancement update for RHV 4.1 2017-04-18 16:24:14 EDT

  None (edit)
Description Greg Scott 2016-07-07 18:26:46 EDT
With the new ovirt-engine-extensions-aaa-ldap module, instead of specifying a list of Kerberos servers, RHEV will now find external Kerberos (including Active Director) authenticators using DNS SRV records.  This RFE asks for a way for the RHEV Admin to look up the currently in-use domain controller to help when troubleshooting authentication problems, and for an API to do this under program control.
Comment 1 Martin Perina 2016-07-12 12:22:13 EDT
So kerberos servers are used in aaa-ldap only if you want to use kerberos SSO to access webadmin/userportal.

If we are talking about LDAP servers, you have several options in aaa-ldap to specify LDAP server:

1. You can use single server:

     pool.default.serverset.type = single
     pool.default.serverset.single.server = ldap.example.com

2. You can use multiple servers and choose a method which one to use (round-robin|failover|fastest-connect|fewest-connections)

    pool.default.serverset.type = <method>
    pool.default.serverset.<method>.1.server = ldap1.example.com
    pool.default.serverset.<method>.2.server = ldap2.example.com

3. You can use multiple servers with DNS round-robin selection (server can be resolved to multiple IP addresses)

    pool.default.serverset.type = dns-round-robin
    pool.default.serverset.dns-round-robin.server = ldap.example.com
    pool.default.serverset.dns-round-robin.selectionMode = RANDOM | FAILOVER | ROUND_ROBIN
    pool.default.serverset.dns-round-robin.dnsRecordTypes = A
    pool.default.serverset.dns-round-robin.cacheTimeoutMillis = NNN

4. You can use what's defined in DNS SRV records for the domain

    pool.default.serverset.type = srvrecord
    pool.default.serverset.srvrecord.service = ldap
    pool.default.serverset.srvrecord.protocol = tcp
    pool.default.serverset.srvrecord.domain = example.com
    pool.default.serverset.srvrecord.ttlMillis = NNN

   You can even do filtering those SRV records (more info in README.profiles)


So could you please describe customer's problem more deeply? From above comment I just don't see what is missing
Comment 2 Ondra Machacek 2016-07-12 12:40:20 EDT
They are using AD, so for them the only option is srvrecord. What they miss is that they want to see DC, currently AFAIK it's not even visible in logs, because that's what UnboundID LDAP SDK does for us, I will take a look what we can do about it. For now at least the visibility in logs.
Comment 3 Martin Perina 2016-07-12 14:38:38 EDT
(In reply to Ondra Machacek from comment #2)
> They are using AD, so for them the only option is srvrecord. 

Not true, srvrecord is default and easiest option for AD, but above mentioned options can also be used if needed.

> What they miss
> is that they want to see DC, currently AFAIK it's not even visible in logs,
> because that's what UnboundID LDAP SDK does for us, I will take a look what
> we can do about it. For now at least the visibility in logs.

Greg, is that the core of this RFE?
Comment 4 Greg Scott 2016-07-12 14:42:06 EDT
The core of this RFE is to give the admin a way to find the Active Directory domain controller that's authenticating logins.  Somehow, some way, RHEV reaches out to a DC.  Why not log which DC it used?  Then when users have trouble authenticating, the admin can look at logs to troubleshoot.
Comment 5 Martin Perina 2016-07-12 15:25:08 EDT
OK, changing the title accordingly
Comment 6 Greg Scott 2016-07-12 22:43:43 EDT
More details:

My specific use case is with a customer with a large Windows Active Directory environment and several independent Windows domains, each in their own AD forests.  Some of those domains are split into AD sites that correspond to physical geography, so a Windows PC in, say, Boston authenticates against a nearby domain controller instead of reaching out to, say, India.  

It makes most sense to find Windows AD domain controllers using DNS SRV records the same way Windows does it.  So then when RHEVM needs to authenticate users against AD, somehow it has to select a domain controller.  

RHEVM should let the world in on that secret somehow. 

One way to do that might be to put in a CLI, GUI, and API to answer this question: "Hey RHEVM, if I were to try to authenticate against the example.com AD domain, what domain controller would I use?"

And RHEVM should also record the domain controllers used by previous logins.  These could be log entries or maybe a database entry; when user mydomain\alice authenticated logged into RHEVM, what was the last domain controller used?
Comment 7 Martin Perina 2016-07-13 03:28:09 EDT
(In reply to Greg Scott from comment #6)
> More details:
> 
> My specific use case is with a customer with a large Windows Active
> Directory environment and several independent Windows domains, each in their
> own AD forests.  Some of those domains are split into AD sites that
> correspond to physical geography, so a Windows PC in, say, Boston
> authenticates against a nearby domain controller instead of reaching out to,
> say, India.  

Please just bare in mind that the selection of 'nearest' AD server should depend on location of RHEVM server and not RHEVM user's computer. So in theory RHEVM should always choose closest AD server (but that depends on configuration of DNS server that RHEVM host is using and assuming you are using srvrecord method to resolve LDAP servers).

> 
> It makes most sense to find Windows AD domain controllers using DNS SRV
> records the same way Windows does it.  So then when RHEVM needs to
> authenticate users against AD, somehow it has to select a domain controller.
> 
> 
> RHEVM should let the world in on that secret somehow. 

OK, we will investigate if it's possible to log which LDAP server is used for each query (this information is contained only inside unboundid-ldapskd library). But it seems to me as candidate for DEBUG log level as there will be a lot of those messages.

> 
> One way to do that might be to put in a CLI, GUI, and API to answer this
> question: "Hey RHEVM, if I were to try to authenticate against the
> example.com AD domain, what domain controller would I use?"

This is problematic, because we can return ldap1.example.com, but on next execution we can return ldap2.example.com, as result heavily depends on srv records configuration.

But as I said above, if we can get this info from unboundid-ldapsdk, we can use ovirt-engine-extensions-tool to display it.

> 
> And RHEVM should also record the domain controllers used by previous logins.
> These could be log entries or maybe a database entry; when user
> mydomain\alice authenticated logged into RHEVM, what was the last domain
> controller used?

This is very problematic:

1. aaa-ldap extension is not using database at all and I definitely don't want to add any database requirement to it
2. Please bear in mind that during login we execute several queries to LDAP server (1 to get info about user and 1 per each group that user is member of including nested groups) and each time we may (but may not) ask different LDAP, server (that depends on srvrecord content)
Comment 8 Greg Scott 2016-07-13 05:36:31 EDT
Oh wow.  Ain't nuthin' simple in this world.  Although not specifically called out in this RFE, support for AD sites in aaa-ldap will also be essential. I think that's already in place but I should mention it.
Comment 9 Martin Perina 2016-12-19 07:29:06 EST
Included in ovirt-engine-extension-aaa-ldap-1.3.0
Comment 11 Gonza 2017-02-06 04:21:56 EST
Verified with:
ovirt-engine-extension-aaa-ldap-1.3.1-0.0.master.20170115190508.gitda48d9d.el7.noarch

2017-02-06 11:20:36,596+02 DEBUG [org.ovirt.engineextensions.aaa.ldap.Framework] (default task-14) [] Performing SearchRequest 'SearchRequest(baseDN='DC=...,DC=redhat,DC=com', scope=SUB, deref=NEVER, sizeLimit=0, timeLimit=0, filter='&(sAMAccountType=805306368)(|(givenName=*)(sn=*)(displayName=*)(name=*))', attrs={objectGUID, userPrincipalName, name, displayName, department, givenName, sn, title, mail}, controls={SimplePagedResultsControl(pageSize=500, isCritical=false)})' request on server '....redhat.com'
Comment 13 Martin Perina 2017-06-23 17:05:13 EDT
*** Bug 1339939 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.