Bug 1300663 - Improve sudo protocol to support configurations with default_domain_suffix
Improve sudo protocol to support configurations with default_domain_suffix
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd (Show other bugs)
7.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Pavel Březina
Steeve Goveas
Aneta Šteflová Petrová
:
: 1331174 (view as bug list)
Depends On:
Blocks: 1382285
  Show dependency treegraph
 
Reported: 2016-01-21 06:41 EST by Pavel Březina
Modified: 2016-11-04 03:15 EDT (History)
17 users (show)

See Also:
Fixed In Version: sssd-1.14.0-1.el7
Doc Type: Bug Fix
Doc Text:
*sudo* rules now work correctly when `default_domain_suffix` is set or when including a fully-qualified name Previously, the *sudo* utility did not correctly evaluate a *sudo* rule in these situations: * When the `default_domain_suffix` option was used in the `/etc/sssd/sssd.conf` file * When the *sudo* rule used a fully-qualified user name As a consequence, the *sudo* rule did not work. With this update, the System Security Services Daemon (SSSD) modifies *sudo* rules so that *sudo* evaluates them correctly in the described situation.
Story Points: ---
Clone Of:
: 1382285 (view as bug list)
Environment:
Last Closed: 2016-11-04 03:15:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Březina 2016-01-21 06:41:00 EST
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/2919

One BZ showed that current sudo protocol we use does not provide enough information to sudo to process rules that does not contain fully qualified names when the login does. We should improve the protocol and logic so it is more clear what does sssd and what does sudo.
Comment 6 Jakub Hrozek 2016-05-11 05:17:02 EDT
*** Bug 1331174 has been marked as a duplicate of this bug. ***
Comment 7 Jakub Hrozek 2016-07-07 06:47:50 EDT
* master: 61913b8f0d1ba54d82640500d7486fac5f72b030
Comment 10 Alex Glotov 2016-08-10 10:11:31 EDT
Jakub, ack, clear. Resetting it here, and yes, it is indeed for 01599086.
Comment 11 Xiyang Dong 2016-09-21 09:04:29 EDT
Could you please provide steps to verify?
Comment 12 Pavel Březina 2016-09-22 03:15:45 EDT
Create user, say user-1, in domain LDAP.
Create rule with sudoUser: user-1.

su user-1
sudo -l -- works

Set default_domain_suffix = LDAP
su user-1
sudo -l -- won't work without this fix
Comment 13 Xiyang Dong 2016-09-22 10:19:35 EDT
Verified on sssd-1.14.0-43.el7:
[root@vm-idm-002 ~]# su tuser
sh-4.2$ sudo -l
[sudo] password for tuser: 
Sorry, user tuser may not run sudo on vm-idm-002.
[root@vm-idm-002 ~]# ipa sudorule-add trule --usercat=all --hostcat=all --cmdcat=all
-----------------------
Added Sudo Rule "trule"
-----------------------
  Rule name: trule
  Enabled: TRUE
  User category: all
  Host category: all
  Command category: all
[root@vm-idm-002 ~]# service sssd restart
Redirecting to /bin/systemctl restart  sssd.service
[root@vm-idm-002 ~]# su tuser
sh-4.2$ sudo -l
Matching Defaults entries for tuser on this host:
    !visiblepw, always_set_home, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS
    LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME
    LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin

User tu[root@vm-idm-002 ~]# cat /etc/sssd/sssd.conf | grep "default_domain_suffix"
default_domain_suffix = testrelm.test
[root@vm-idm-002 ~]# service sssd restart
Redirecting to /bin/systemctl restart  sssd.service
[root@vm-idm-002 ~]# su tuser
sh-4.2$ sudo -l
Matching Defaults entries for tuser on this host:
    !visiblepw, always_set_home, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS
    LC_CTYPE", env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME
    LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY", secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin

User tuser may run the following commands on this host:
    (root) ALL
Comment 16 Pavel Březina 2016-10-12 08:50:39 EDT
Looks good to me.
Comment 22 errata-xmlrpc 2016-11-04 03:15:11 EDT
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-2016-2476.html

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