Bug 1791617

Summary: Failed user login throws two stderr messages on user terminal due to unreadable GPO
Product: Red Hat Enterprise Linux 8 Reporter: Kaushik Banerjee <kbanerje>
Component: sssdAssignee: Paweł Poławski <ppolawsk>
Status: CLOSED ERRATA QA Contact: Dan Lavu <dlavu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: atikhono, dlavu, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, sgoveas, thalman, tscherf
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira qereview
Fixed In Version: sssd-2.3.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:04:28 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:

Description Kaushik Banerjee 2020-01-16 09:31:18 UTC
Description of problem:
Failed user login does not return to prompt on login denial due to unreadable GPO

Version-Release number of selected component (if applicable):
sssd-ad-2.2.3-6.el8

How reproducible:
Always

Steps to Reproduce:

1. Setup unreadable GPO

2. Setup sssd with following config:
# cat /etc/sssd/sssd.conf 
[sssd]
domains = td5e5666.com
config_file_version = 2
services = nss, pam

[domain/td5e5666.com]
ad_domain = td5e5666.com
krb5_realm = TD5E5666.COM
realmd_tags = manages-system joined-with-adcli 
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_sasl_authid = CI-VM-10-0-155-$
ldap_id_mapping = True
use_fully_qualified_names = True
fallback_homedir = /home/%u@%d
access_provider = ad
ad_gpo_access_control = enforcing
ad_gpo_ignore_unreadable = false

3. Try to login using any one of the users
# ssh -l kaushik.allow localhost
kaushik.allow@localhost's password: 

Broadcast message from systemd-journald.upshift.rdu2.redhat.com (Thu 2020-01-16 03:51:24 EST):

sssd[be[td5e5666.com]][20578]: Group Policy Container with DN [cn={922D526B-A7C5-4919-BE2D-9E87ED3394BC},cn=policies,cn=system,DC=td5e5666,DC=com] is unreadable or has unreadable or missing attributes. In order to fix this make sure that this AD object has following attributes readable: nTSecurityDescriptor, cn, gPCFileSysPath, gPCMachineExtensionNames, gPCFunctionalityVersion, flags. Alternatively if you do not have access to the server or can not change permissions on this object, you can use option ad_gpo_ignore_unreadable = True which will skip this GPO. See ad_gpo_ignore_unreadable in 'man sssd-ad' for details.

Connection closed by ::1 port 22
[root@ci-vm-10-0-155-109 ~]# 
Message from syslogd@hostname1-8e4a41 at Jan 16 03:51:24 ...
 sssd[be[td5e5666.com]][20578]:Group Policy Container with DN [cn={922D526B-A7C5-4919-BE2D-9E87ED3394BC},cn=policies,cn=system,DC=td5e5666,DC=com] is unreadable or has unreadable or missing attributes. In order to fix this make sure that this AD object has following attributes readable: nTSecurityDescriptor, cn, gPCFileSysPath, gPCMachineExtensionNames, gPCFunctionalityVersion, flags. Alternatively if you do not have access to the server or can not change permissions on this object, you can use option ad_gpo_ignore_unreadable = True which will skip this GPO. See ad_gpo_ignore_unreadable in 'man sssd-ad' for details.


Actual results:
The stderr appears twice on the user terminal and the user is not returned to the prompt

Expected results:
1. Sanitized output instead of showing the same stderr generated 
2. The output should also be shown only once.

Additional info:

Comment 2 Tomas Halman 2020-01-16 15:17:10 UTC
Upstream ticket

https://pagure.io/SSSD/sssd/issue/4133

Comment 8 Pavel Březina 2020-03-04 11:54:49 UTC
* `master`
    * 9188aa17d9c4dfec1d5744981ea8855465965808 - GPO: Duplicated error message for unreadable GPO

Comment 11 Dan Lavu 2020-08-10 23:15:29 UTC
Verified against sssd-2.3.0-7.el8.x86_64

[root@ci-vm-10-0-104-249 ad_gpo_hbac]# ssh allowed_user@localhost 
allowed_user@localhost's password: 
Connection closed by ::1 port 22


Contains no error message output

Logs contain the error message.

(2020-08-10 19:11:46): [be[adgpo12r83.com]] [ad_gpo_missing_or_unreadable_attr] (0x0020): Group Policy Container with DN [cn={89F1BEFA-DE36-4C85-84A0-03D9EB37650C},cn=policies,cn=system,DC=adgpo12r83,DC=com] is unreadable or has unreadable or missing attributes. In order to fix this make sure that this AD object has following attributes readable: nTSecurityDescriptor, cn, gPCFileSysPath, gPCMachineExtensionNames, gPCFunctionalityVersion, flags. Alternatively if you do not have access to the server or can not change permissions on this object, you can use option ad_gpo_ignore_unreadable = True which will skip this GPO. See ad_gpo_ignore_unreadable in 'man sssd-ad' for details.

Comment 15 errata-xmlrpc 2020-11-04 02:04:28 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 (sssd bug fix and enhancement 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/RHBA-2020:4569