RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1434992 - Wrong pam return code for user from subdomain with ad_access_filter
Summary: Wrong pam return code for user from subdomain with ad_access_filter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: SSSD Maintainers
QA Contact: shridhar
URL:
Whiteboard:
Depends On:
Blocks: 1450125
TreeView+ depends on / blocked
 
Reported: 2017-03-22 20:47 UTC by Jakub Hrozek
Modified: 2020-05-02 18:37 UTC (History)
8 users (show)

Fixed In Version: sssd-1.15.2-24.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1450125 (view as bug list)
Environment:
Last Closed: 2017-08-01 09:04:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 4362 0 None None None 2020-05-02 18:37:56 UTC
Red Hat Product Errata RHEA-2017:2294 0 normal SHIPPED_LIVE sssd bug fix and enhancement update 2017-08-01 12:39:55 UTC

Description Jakub Hrozek 2017-03-22 20:47:36 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/SSSD/sssd/issue/3331

SSSD configuration:
```text
    [sssd]
    config_file_version = 2
    services = nss, pam
    domains = $AD_DOMAIN1

    [domain/$AD_DOMAIN1]
    ldap_purge_cache_timeout = 0
    krb5_auth_timeout = 12

    debug_level = 0xfff0
    id_provider = ad
    use_fully_qualified_names = True
    krb5_auth_timeout = 15
    access_provider=ad
    ad_access_filter=(cn=user1_dom1-${JOB_ID})
```

AD domains:

* AD_DOMAIN1=sssdad.com
* AD_DOMAIN2=sssdad_tree.com
* AD_DOMAIN3=child1.sssdad.com

How to reproduce:

1. join sssd to AD_DOMAIN1
2. configure based on provided template
3. authenticate with various users from all domains user1_dom1-${JOB_ID}@$AD_DOMAIN1 user2_dom1-${JOB_ID}@$AD_DOMAIN1 user1_dom2-${JOB_ID}@$AD_DOMAIN2 user1_dom3-${JOB_ID}@$AD_DOMAIN3

Expected result:
Just first user is allowed and rest will get pam error code  6 (Permission denied)
```text
Mar 14 12:25:14 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:25:16 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom1-27496
Mar 14 12:25:16 localhost su: pam_unix(su:session): session opened for user user1_dom1-27496 by (uid=99)
Mar 14 12:25:16 localhost su: pam_unix(su:session): session closed for user user1_dom1-27496
Mar 14 12:25:16 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:25:16 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:25:17 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user2_dom1-27496
Mar 14 12:25:17 localhost su: pam_sss(su:account): Access denied for user user2_dom1-27496: 6 (Permission denied)
Mar 14 12:25:18 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:25:18 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:25:21 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom2-27496
Mar 14 12:25:21 localhost su: pam_sss(su:account): Access denied for user user1_dom2-27496: 6 (Permission denied)
Mar 14 12:25:22 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:25:22 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:25:25 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom3-27496.com
Mar 14 12:25:25 localhost su: pam_sss(su:account): Access denied for user user1_dom3-27496.com: 6 (Permission denied)
Mar 14 12:25:26 localhost su: pam_unix(su:session): session closed for user nobody
```

Actual result
User from AD_DOMAIN2 get pam error code:  10 (User not known to the underlying authentication module)
```text
Mar 14 12:12:38 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:12:40 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom1-27496
Mar 14 12:12:40 localhost su: pam_unix(su:session): session opened for user user1_dom1-27496 by (uid=99)
Mar 14 12:12:40 localhost su: pam_unix(su:session): session closed for user user1_dom1-27496
Mar 14 12:12:40 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:12:40 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:12:41 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user2_dom1-27496
Mar 14 12:12:41 localhost su: pam_sss(su:account): Access denied for user user2_dom1-27496: 6 (Permission denied)
Mar 14 12:12:42 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:12:42 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:12:44 localhost su: pam_sss(su:auth): authentication failure; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom2-27496
Mar 14 12:12:44 localhost su: pam_sss(su:auth): received for user user1_dom2-27496: 10 (User not known to the underlying authentication module)
Mar 14 12:12:45 localhost su: pam_unix(su:session): session closed for user nobody
Mar 14 12:12:45 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
Mar 14 12:12:48 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/6 ruser=nobody rhost= user=user1_dom3-27496.com
Mar 14 12:12:48 localhost su: pam_sss(su:account): Access denied for user user1_dom3-27496.com: 6 (Permission denied)
Mar 14 12:12:49 localhost su: pam_unix(su:session): session closed for user nobody
```

Comment 2 Lukas Slebodnik 2017-05-03 11:40:46 UTC
master:
* df4b24bed15f45bf286fb0102fd397218fdd4186

sssd-1-14:
* 4540d9f6817c78eef7b6e2d79245434811b59ad9

Comment 7 shridhar 2017-05-17 10:26:32 UTC
verified ad_forest job (ad_access_filter)
[root@qe-blade-11 ~]# rpm -q sssd
sssd-1.15.2-24.el7.x86_64

[root@qe-blade-11 ~]# ls
anaconda-ks.cfg  NETBOOT_METHOD.TXT  original-ks.cfg  RECIPE.TXT
[root@qe-blade-11 ~]# cat /etc/sssd/sssd.conf

[sssd]
config_file_version = 2
services = nss, pam
domains = sssdad.com

[domain/sssdad.com]
debug_level = 0x0180
id_provider = ad
use_fully_qualified_names = True
krb5_auth_timeout = 15

access_provider=ad
ad_access_filter=(cn=user1_dom1-1860200)

[root@qe-blade-11 ~]# cat /var/log/secure 
May 17 06:09:26 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
May 17 06:09:27 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/1 ruser=nobody rhost= user=user1_dom1-1860200
May 17 06:09:27 localhost su: pam_unix(su:session): session opened for user user1_dom1-1860200 by (uid=99)
May 17 06:09:27 localhost su: pam_unix(su:session): session closed for user user1_dom1-1860200
May 17 06:09:27 localhost su: pam_unix(su:session): session closed for user nobody
May 17 06:09:27 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
May 17 06:09:28 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/1 ruser=nobody rhost= user=user2_dom1-1860200
May 17 06:09:28 localhost su: pam_sss(su:account): Access denied for user user2_dom1-1860200: 6 (Permission denied)
May 17 06:09:29 localhost su: pam_unix(su:session): session closed for user nobody
May 17 06:09:29 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
May 17 06:09:30 localhost su: pam_unix(su:session): session closed for user nobody
May 17 06:09:30 localhost su: pam_unix(su:session): session opened for user nobody by (uid=0)
May 17 06:09:31 localhost su: pam_sss(su:auth): authentication success; logname= uid=99 euid=0 tty=pts/1 ruser=nobody rhost= user=user1_dom3-1860200.com
May 17 06:09:32 localhost su: pam_sss(su:account): Access denied for user user1_dom3-1860200.com: 6 (Permission denied)
May 17 06:09:33 localhost su: pam_unix(su:session): session closed for user nobody

Comment 8 errata-xmlrpc 2017-08-01 09:04:18 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://access.redhat.com/errata/RHEA-2017:2294


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