Bug 1062320 - [RFE][AAA] Active Directory Group Membership detection on login is too slow for users with large numbers of groups
Summary: [RFE][AAA] Active Directory Group Membership detection on login is too slow f...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-extension-aaa-ldap
Version: 3.3.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
: 3.5.0
Assignee: Alon Bar-Lev
QA Contact: Ondra Machacek
URL:
Whiteboard: infra
Depends On:
Blocks: oVirt-AAA-LDAP
TreeView+ depends on / blocked
 
Reported: 2014-02-06 16:24 UTC by James W. Mills
Modified: 2019-05-20 11:08 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-11 18:12:37 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1060874 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Knowledge Base (Solution) 790953 0 None None None Never
Red Hat Product Errata RHEA-2015:0174 0 normal SHIPPED_LIVE new package: ovirt-engine-extension-aaa-ldap 2015-02-11 22:40:02 UTC
oVirt gerrit 28561 0 None ABANDONED aaa: Fix sync 2020-02-03 22:43:05 UTC

Description James W. Mills 2014-02-06 16:24:40 UTC
What is the nature and description of the request?

RHEV refreshes all group membership for a user when logging in via LDAP/AD.  If an organization has many LDAP/AD groups, users experience a very large lag time (~30 seconds) as group membership is analyzed.
  
Why does the customer need this?

* Large scale deployment using AD auth
* Large AD/LDAP group memberships
  
How would the customer like to achieve this?

Any implementation that would speed up the login process.  Maybe a background thread that does group membership validation asynchronous to the login process?

For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.  

Logging in as an AD user with many groups (~150) will be quick.
  
Is there already an existing RFE upstream or in Red Hat Bugzilla?

No.
  
Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?  

ASAP (RHEV 3.3.X)

Is the sales team involved in this request and do they have any additional input?  

Not that I am aware.

List any affected packages or components.

ovirt-engine-backend, specifically adbroker.DirectorySearcher
  
Would the customer be able to assist in testing this functionality if implemented?

Possibly

Comment 2 Eli Mesika 2014-02-09 10:06:30 UTC
Yair/Juan please specify what can be done (if available) to improve performance in this case

Comment 3 Yair Zaslavsky 2014-02-10 07:51:12 UTC
IMHO we should try to parallelize the code of the group retrieval and introduce other performance issues to the following area in the code -

LdapBrokerCommandBase.populateGroup

Comment 4 Barak 2014-03-03 18:40:41 UTC
(In reply to Yair Zaslavsky from comment #3)
> IMHO we should try to parallelize the code of the group retrieval and
> introduce other performance issues to the following area in the code -
> 
> LdapBrokerCommandBase.populateGroup

As the group membership may influence the permissions to that user,
Shouldn't we rely on previously retrieved groups and after login refresh ?

I'm not sure about the expectations here, but assuming these membership are rarely changed this may be a good enough solution.

Alon what do you think ?

Comment 5 Alon Bar-Lev 2014-03-03 18:51:43 UTC
(In reply to Barak from comment #4)
> (In reply to Yair Zaslavsky from comment #3)
> > IMHO we should try to parallelize the code of the group retrieval and
> > introduce other performance issues to the following area in the code -
> > 
> > LdapBrokerCommandBase.populateGroup
> 
> As the group membership may influence the permissions to that user,
> Shouldn't we rely on previously retrieved groups and after login refresh ?
> 
> I'm not sure about the expectations here, but assuming these membership are
> rarely changed this may be a good enough solution.
> 
> Alon what do you think ?

I do not fully understand current implementation nor the question...

However, if you refer to the ldap synchronization we do, we should not relay on it when constructing user profile on login, as the authoritative information is within the ldap.

After we implement the new ldap provider we will be able to benchmark individual queries better, analyzing what should be optimized.

During logon we should not update database with results, I think the current implementation does that.

Comment 6 Yair Zaslavsky 2014-03-04 03:31:02 UTC
(In reply to Alon Bar-Lev from comment #5)
> (In reply to Barak from comment #4)
> > (In reply to Yair Zaslavsky from comment #3)
> > > IMHO we should try to parallelize the code of the group retrieval and
> > > introduce other performance issues to the following area in the code -
> > > 
> > > LdapBrokerCommandBase.populateGroup
> > 
> > As the group membership may influence the permissions to that user,
> > Shouldn't we rely on previously retrieved groups and after login refresh ?
> > 
> > I'm not sure about the expectations here, but assuming these membership are
> > rarely changed this may be a good enough solution.
> > 
> > Alon what do you think ?
> 
> I do not fully understand current implementation nor the question...
> 
> However, if you refer to the ldap synchronization we do, we should not relay
> on it when constructing user profile on login, as the authoritative
> information is within the ldap.
> 
> After we implement the new ldap provider we will be able to benchmark
> individual queries better, analyzing what should be optimized.
> 
> During logon we should not update database with results, I think the current
> implementation does that.

It does, as the current login flow also performs the MLA check (whether user is authorized to perform login to the system).

Comment 8 Alon Bar-Lev 2014-06-11 14:04:04 UTC
Actions taken:

1. there is no way to escape query all groups in LDAP as the output is group DN while in order to determine actual group membership the group unique id is required.

2. the new ldap implementation will not query same group twice in same query.

3. the engine synchronization was modified to avoid recursive queries, resolve and cache groups and only query these that are not resolved.

Comment 10 Alon Bar-Lev 2014-06-29 11:18:02 UTC
Notes:

1. query groups at login cannot be done async - as fully functional user within application requires all privileges.

2. query groups of user/groups must be done using individual query based on DN, so N groups derives N queries.

3. optimizing implementation to use X connections in parallel is doable at client side, however:

a. in a sequence of several users at once, we load the server in many connections.

b. the server has its own limitation, and it does not serve only ovirt application.

Comment 11 Alon Bar-Lev 2014-07-21 10:33:15 UTC
Adjusting priority/severity per work on generic ldap provider, bug#1063095.

Comment 12 Alon Bar-Lev 2014-12-17 11:41:59 UTC
Not sure why I missed this bug, we done our best within the new ldap implementation.

I consider this fixed within 3.5 as we have no way to assign component version within the way we manage our product.

Comment 13 Karl Abbott 2014-12-17 12:25:35 UTC
Alon,

That's good to hear as our customer is very keen to get this functionality as it's blocking their wider adoption of RHEV. They will definitely be testing 3.5 and if they hit any issues with the ldap implementation, they will let us know and we will file appropriate bzs. 

Is there anything we should do specifically to keep you from missing bugs related to the LDAP implementation in RHEV?

Cheers,
Karl

Comment 14 Alon Bar-Lev 2014-12-17 14:03:46 UTC
I did not ignore this bug, just did not move it into the proper milestone and status... :)

You should use the new ovirt-engine-extension-aaa-ldap component, there is no automatic migration sequence from legacy.

Instructions are available[1][2].

I suggest you install upstream ovirt-engine within the same environment and start testing this even before the downstream version, there is no different in that regard.

[1] http://gerrit.ovirt.org/gitweb?p=ovirt-engine-extension-aaa-ldap.git;a=blob;f=README;hb=HEAD
[2] http://www.ovirt.org/Features/AAA

Comment 15 Ondra Machacek 2014-12-18 11:06:42 UTC
I've got ~14s for legacy ad and ~6s for new provider which used ad ldap simple.
For user with 160groups.

Comment 16 Alon Bar-Lev 2014-12-18 11:42:22 UTC
(In reply to Ondra Machacek from comment #15)
> I've got ~14s for legacy ad and ~6s for new provider which used ad ldap
> simple.
> For user with 160groups.

you should also try concurrent :)

Comment 17 Ondra Machacek 2014-12-18 12:18:26 UTC
you mean concurrent login ?

Comment 18 Alon Bar-Lev 2014-12-18 12:25:54 UTC
(In reply to Ondra Machacek from comment #17)
> you mean concurrent login ?

yes and also sequential, the new provider use connection pool that can be adjusted to balance the load, not to mention that it can communicate with several ldap servers based on various serverset settings.

but at minimum see "POOL OPTIONS" within README.profile so you can optimize the # of connections. you can also in most cases enable auth-check.default.reuse-connections and gain even better response times.

Comment 19 Ondra Machacek 2014-12-18 13:56:35 UTC
I tested with rest api and new provider performance is significant.
I used 4 users and set up 4 connection to ldap. Concurennt login of all 4 users was about ~2 sec. For the legacy it was ~18sec.

Sequential login for new provider with same config was about +2sec. For legacy about +10sec.

Comment 21 errata-xmlrpc 2015-02-11 18:12:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-0174.html


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