Bug 1892793

Summary: Authentication and login times are over several seconds due to unindexed ipaExternalMember [rhel-7.9.z]
Product: Red Hat Enterprise Linux 7 Reporter: Sandi Wallendahl <pwallend>
Component: ipaAssignee: Florence Blanc-Renaud <frenaud>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: high Docs Contact:
Priority: medium    
Version: 7.9CC: jreznik, ksiddiqu, pcech, rcritten, sumenon, tmihinto, tscherf
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.8-5.el7_9.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-16 13:56:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
TestSystem-Logs none

Description Sandi Wallendahl 2020-10-29 16:22:06 UTC
Description of problem:
High login times are encountered for user accounts that are fetched from AD using the trust between IPA and AD realms, when the AD realm has lots (e.g. thousands) of user accounts.


Version-Release number of selected component (if applicable):
ipa-server 4.6.6


How reproducible:
Always


Steps to Reproduce:
1. Install and configure IPA server, use default configuration
2. Install and configure IPA client, use default configuration
3. Have a Microsoft Active Directory instance with a high amount (e.g. thousands) of users
3. Create a trust between IPA and AD and set up AD users to be able to login through the trust
4. Try to login with an AD user account


Actual results:
Login over ssh takes 5-10 seconds


Expected results:
Login should not take this long, expected login time is about one second


Additional info:
The issue is caused by ipaExternalMember entry being unindexed and can be mitigated on the IPA server-side with the following:

Create a file: 90-index-ipaExternalMember.update
--------------------------------------------------------------------------------------------
dn: cn=ipaExternalMember,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
default: cn: ipaExternalMember
default: objectClass: top
default: objectClass: nsIndex
default: nsSystemIndex: false
default: nsIndexType: eq
--------------------------------------------------------------------------------------------

Apply it by running the following as root on all of IPA servers:
  # ipa-ldap-updater ./90-index-ipaExternalMember.update

Since the version 4.6.5 of IPA there's an auto-indexing feature. So after this schema-update is put in place, IPA automatically creates a task for itself to index ipaExternalMember entries.

/var/log/ipaupgrade.log can be followed to verify the task has started:

  <timestamp> DEBUG Creating task cn=indextask_<taskid>,cn=index,cn=tasks,cn=config to index attributes: ipaExternalMember


This issue has been fixed in upstream with: https://github.com/freeipa/freeipa/commit/9f0ec27e9f13ed40b8e58162d99bf9b0e8b4afd5

Comment 4 François Cami 2021-01-22 19:21:21 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/8677

Comment 5 Florence Blanc-Renaud 2021-01-26 09:15:39 UTC
Fixed upstream
ipa-4-6:
https://pagure.io/freeipa/c/2c802ab10479342e6d0e7e6d1589f0d31a608c1b

Comment 9 Sudhir Menon 2021-03-01 10:50:07 UTC
Created attachment 1759933 [details]
TestSystem-Logs

Comment 13 errata-xmlrpc 2021-03-16 13:56: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 (Moderate: ipa security and bug fix update), 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://access.redhat.com/errata/RHSA-2021:0860