Bug 1300663 - Improve sudo protocol to support configurations with default_domain_suffix
Summary: Improve sudo protocol to support configurations with default_domain_suffix
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd   
(Show other bugs)
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Březina
QA Contact: Steeve Goveas
Aneta Šteflová Petrová
URL:
Whiteboard:
Keywords:
: 1331174 (view as bug list)
Depends On:
Blocks: 1382285
TreeView+ depends on / blocked
 
Reported: 2016-01-21 11:41 UTC by Pavel Březina
Modified: 2018-02-28 15:30 UTC (History)
17 users (show)

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 07:15:11 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:2476 normal SHIPPED_LIVE sssd bug fix and enhancement update 2016-11-03 14:08:11 UTC

Description Pavel Březina 2016-01-21 11:41:00 UTC
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 09:17:02 UTC
*** Bug 1331174 has been marked as a duplicate of this bug. ***

Comment 7 Jakub Hrozek 2016-07-07 10:47:50 UTC
* master: 61913b8f0d1ba54d82640500d7486fac5f72b030

Comment 10 Alex Glotov 2016-08-10 14:11:31 UTC
Jakub, ack, clear. Resetting it here, and yes, it is indeed for 01599086.

Comment 11 Xiyang Dong 2016-09-21 13:04:29 UTC
Could you please provide steps to verify?

Comment 12 Pavel Březina 2016-09-22 07:15:45 UTC
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 14:19:35 UTC
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 12:50:39 UTC
Looks good to me.

Comment 22 errata-xmlrpc 2016-11-04 07:15:11 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://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.