Bug 1425891 - Support delivering non-POSIX users and groups through the IFP and PAM interfaces
Summary: Support delivering non-POSIX users and groups through the IFP and PAM interfaces
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: SSSD Maintainers
QA Contact: Dan Lavu
Aneta Šteflová Petrová
URL:
Whiteboard:
Depends On: 1436733
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-22 17:05 UTC by Jakub Hrozek
Modified: 2017-08-01 09:02 UTC (History)
9 users (show)

Fixed In Version: sssd-1.15.2-6.el7
Doc Type: Enhancement
Doc Text:
SSSD supports user and group resolution, authentication, and authorization in setups without UIDs or SIDs In traditional System Security Services Daemon (SSSD) deployments, users and groups either have POSIX attributes set or SSSD can resolve the users and groups based on Windows security identifiers (SID). With this update, in setups that use LDAP as the identity provider, SSSD now supports the following functionality even when UIDs or SIDs are not present in the LDAP directory: * User and group resolution through the D-Bus interface * Authentication and authorization through the plugabble authentication module (PAM) interface
Clone Of:
Environment:
Last Closed: 2017-08-01 09:02:33 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2294 normal SHIPPED_LIVE sssd bug fix and enhancement update 2017-08-01 12:39:55 UTC

Description Jakub Hrozek 2017-02-22 17:05:06 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/3310

Many projects depend on SSSD now to support application integration through Apache modules or directly through SSSD's D-Bus interface. And often, the users and groups in the directory have no POSIX attributes. We should support these use-cases, in particular:
 * look up users and groups through the D-Bus interface
 * look up group membership through the D-Bus interface including membership in non-POSIX groups
 * test authentication and access control through PAM

Comment 2 Jakub Hrozek 2017-03-30 12:12:36 UTC
* master:
    * 861ab44e8148208425b67c4711bc8fade10fd3ed
    * 3e39806177e1cd383743ff596cb96df44a6ce8c9
    * ed0cdfcacc44e4e13e1524e254efa744610a87c2
    * 901396366075dc3e3fcc0894345af1b51052ac69
    * 5f7f249f2a8a1c7284e991aa64dbf850d482b0aa
    * 3e789aa0bd6b7bb6e62f91458b76753498030fb5
    * 57eeec5d735c7a3bbe58299fded97414626d85f1
    * b010f24f4d96d15c5c85021bb4aa83db25cd3df5
    * 35f0f5ff9dac790f6c947190fcdc00d01ae9077c
    * cee85e8fb9534ec997e5388fce59f392cf029573
    * 825e8bf2f73a815c2eceb36ae805145fcbacf74d
    * 6324eaf1fb321c41ca9883966118df6d45259b7e

Comment 14 Dan Lavu 2017-06-02 14:10:25 UTC
Verified against sssd-1.15.2-33.el7.x86_64

# Testing GetUserGroups

[root@beast sssd]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserGroups string:sssd_noposix
method return sender=:1.206 -> dest=:1.215 reply_serial=2
   array [
      string "s-1-5-21-152790264-1257272937-3685563408-513"
   ]

[root@beast sssd]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserGroups string:sssd_posix
method return sender=:1.206 -> dest=:1.216 reply_serial=2
   array [
      string "s-1-5-21-152790264-1257272937-3685563408-513"
   ]

# Testing GetUserAttr

[root@beast sssd]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr string:sssd_posix array:string:telephoneNumber
method return sender=:1.206 -> dest=:1.217 reply_serial=2
   array [
      dict entry(
         string "telephoneNumber"
         variant             array [
               string "1111111111"
            ]
      )
   ]
[root@beast sssd]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr string:sssd_noposix array:string:telephoneNumber
method return sender=:1.206 -> dest=:1.218 reply_serial=2
   array [
      dict entry(
         string "telephoneNumber"
         variant             array [
               string "2222222222"
            ]
      )
   ]

Comment 15 Lukas Slebodnik 2017-06-07 07:39:04 UTC
(In reply to Dan Lavu from comment #14)
> Verified against sssd-1.15.2-33.el7.x86_64
>

Please test with the latest version of sssd. There was fixed bug related to GetUserGroups bz#1449729 

There is also missing info about users in ldap "sssd_noposix".
Non-posix user means that the users in LDAP will not have UID/GID.
(and  UID/GID cannot be generated by ID-mapping from SID).

Comment 16 Dan Lavu 2017-06-07 13:18:46 UTC
Lukas, 

Correct no posix, did not have the uid/gid/gecos attribute, will test again today.

Comment 17 Dan Lavu 2017-06-08 12:39:42 UTC
After Lukas's seal of approval I'll mark this as verified. 

Tested against sssd-1.15.2-43.el7.x86_64

# dbus returns group name not SID
dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserGroups string:sssd_noposix
method return sender=:1.86 -> dest=:1.100 reply_serial=2
   array [
      string "domain users"
   ]

# dbus returns non posix user uid when uidNumber gidNumber does not exist 
dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr  string:sssd_noposix array:string:uidNumber
method return sender=:1.86 -> dest=:1.99 reply_serial=2
   array [
      dict entry(
         string "uidNumber"
         variant             array [
               string "1196008529"
            ]
      )
   ]

# dbus returns uid and gid or posix user
dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr  string:sssd_posix array:string:uidNumber
method return sender=:1.86 -> dest=:1.98 reply_serial=2
   array [
      dict entry(
         string "uidNumber"
         variant             array [
               string "1196008528"
            ]
      )
   ]


# config
[sssd]
domains = appdomain.test, sssdad2012r2.com
config_file_version = 2
services = nss, pam, ifp

[pam]
pam_app_services = sss_test

[ifp]
user_attributes = +telephoneNumber

[application/appdomain.test]
inherit_from = sssdad2012r2.com 

[domain/sssdad2012r2.com]
ldap_user_extra_attrs = phone:telephoneNumber
ad_domain = sssdad2012r2.com
krb5_realm = SSSDAD2012R2.COM
realmd_tags = manages-system joined-with-samba 
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
use_fully_qualified_names = False 
fallback_homedir = /home/%u@%d
access_provider = ad


# ldap entries

# sssd noposix, Users, sssdad2012r2.com
dn: CN=sssd noposix,CN=Users,DC=sssdad2012r2,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: sssd noposix
sn: noposix
telephoneNumber: 2222222222
givenName: sssd
distinguishedName: CN=sssd noposix,CN=Users,DC=sssdad2012r2,DC=com
instanceType: 4
whenCreated: 20170601005247.0Z
whenChanged: 20170602040647.0Z
displayName: sssd noposix
uSNCreated: 867705
uSNChanged: 869210
name: sssd noposix
objectGUID:: ilSHNVwMYkaWkJ7H3VhXVA==
userAccountControl: 66048
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
lastLogon: 0
pwdLastSet: 131407519670117907
primaryGroupID: 513
objectSid:: AQUAAAAAAAUVAAAA+GQbCWl28EoQPK3bUSEAAA==
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: sssd_noposix
sAMAccountType: 805306368
userPrincipalName: sssd_noposix@sssdad2012r2.com
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=sssdad2012r2,DC=com
dSCorePropagationData: 16010101000000.0Z


# sssd posix, Users, sssdad2012r2.com
dn: CN=sssd posix,CN=Users,DC=sssdad2012r2,DC=com
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: sssd posix
sn: posix
telephoneNumber: 1111111111
givenName: sssd
distinguishedName: CN=sssd posix,CN=Users,DC=sssdad2012r2,DC=com
instanceType: 4
whenCreated: 20170601005223.0Z
whenChanged: 20170602040635.0Z
displayName: sssd posix
uSNCreated: 867694
uSNChanged: 869209
name: sssd posix
objectGUID:: +Wb0NLbJqEikSvWvHaDu/w==
userAccountControl: 66048
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 0
lastLogoff: 0
lastLogon: 0
pwdLastSet: 131407519433398894
primaryGroupID: 513
objectSid:: AQUAAAAAAAUVAAAA+GQbCWl28EoQPK3bUCEAAA==
accountExpires: 9223372036854775807
logonCount: 0
sAMAccountName: sssd_posix
sAMAccountType: 805306368
userPrincipalName: sssd_posix@sssdad2012r2.com
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=sssdad2012r2,DC=com
dSCorePropagationData: 16010101000000.0Z
unixUserPassword: ABCD!efgh12345$67890
uid: sssd_posix
msSFU30Name: sssd_posix
msSFU30NisDomain: sssdad2012r2
uidNumber: 10000
gidNumber: 10000
unixHomeDirectory: /home/sssd_posix
loginShell: /bin/sh

Comment 18 Lukas Slebodnik 2017-06-08 13:14:08 UTC
Dan,
you need to disable ID mapping:
    ldap_id_mapping = False

otherwise sssd will be able to generate UID/GID from SID.

Then you should be able to resolve "sssd posix@sssdad2012r2.com" but *NOT* "sssd noposix@sssdad2012r2.com".

You should be able to resolve both using "appdomain.test" But you cannot use glibc interface (getent passwd) because "sssd noposix@sssdad2012r2.com" does not have UID. So you need to test with dbus interface here. 
You will get phoneNumber and uidNumber for "sssd posix@appdomain.test" but only telephoneNumber for "sssd noposix@appdomain.test"

Comment 19 Dan Lavu 2017-06-08 13:55:25 UTC
Lukas,

Thanks for the clarification, marking this as verified. 

[root@hp-dl380pgen8-02-vm-10 ~]# id sssd_noposix
id: sssd_noposix: no such user

[root@hp-dl380pgen8-02-vm-10 ~]# id sssd_posix
uid=10000(sssd_posix) gid=10000(sssd_users) groups=10000(sssd_users)


# both returns phone numbers

[root@hp-dl380pgen8-02-vm-10 ~]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr string:sssd_posix array:string:telephoneNumber
method return sender=:1.124 -> dest=:1.125 reply_serial=2
   array [
      dict entry(
         string "telephoneNumber"
         variant             array [
               string "1111111111"
            ]
      )
   ]

[root@hp-dl380pgen8-02-vm-10 ~]# dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe /org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserAttr string:sssd_noposix array:string:telephoneNumber
method return sender=:1.128 -> dest=:1.127 reply_serial=2
   array [
      dict entry(
         string "telephoneNumber"
         variant             array [
               string "2222222222"
            ]
      )
   ]

Comment 20 errata-xmlrpc 2017-08-01 09:02:33 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.