Bug 1826272
| Summary: | [RFE] support non-posix groups in sudo rules | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Divya Mittal <dmittal> |
| Component: | sssd | Assignee: | Pavel Březina <pbrezina> |
| Status: | CLOSED ERRATA | QA Contact: | shridhar <sgadekar> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 8.0 | CC: | abokovoy, asakure, atikhono, bthekkep, dave, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, sbose, sgoveas, tmihinto, tscherf |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | sync-to-jira | ||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-05-18 15:03:54 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
Divya Mittal
2020-04-21 11:04:35 UTC
Upstream ticket migrated to https://github.com/SSSD/sssd/issues/5119 Non-posix groups are now supported in SSSD. However, the notation is slightly different from what sudo manual page says. In order to add non-posix group to sudoUser attribute, just use %non-posixgroup which is the same notation as for posix groups. Note that the support is also present in older SSSD versions since it was a side effect of other patches. But now it is officially supported. [root@vm-10-0-111-154 ~]# rpm -q sssd
sssd-2.4.0-6.el8.x86_64
[root@vm-10-0-111-154 ~]# id sudo_user1
uid=37202(sudo_user1) gid=37202(sudo_group2) groups=37202(sudo_group2)
[root@vm-10-0-111-154 ~]# cat /etc/sssd/sssd.conf
[sssd]
domains = sgadekar2012r2.com
config_file_version = 2
services = nss, pam, sudo
[domain/sgadekar2012r2.com]
ad_domain = sgadekar2012r2.com
krb5_realm = SGADEKAR2012R2.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_id_mapping = false
use_fully_qualified_names = False
fallback_homedir = /home/%u@%d
access_provider = ad
sudo_provider = ad
debug_level = 9
[root@vm-10-0-111-154 ~]# id sudo_user1
uid=37202(sudo_user1) gid=37202(sudo_group2) groups=37202(sudo_group2)
[root@vm-10-0-111-154 ~]# sudo -l -U sudo_user1
Matching Defaults entries for sudo_user1 on vm-10-0-111-154:
!visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, 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 sudo_user1 may run the following commands on vm-10-0-111-154:
(root) NOPASSWD: /usr/bin/head
[root@vm-10-0-111-154 ~]# ldapsearch -x -h ad-server -D 'Administrator' -b 'ou=sudoers,dc=sgadekar2012r2,dc=com' -w Secret123 'cn=%head_non*'
# extended LDIF
#
# LDAPv3
# base <ou=sudoers,dc=sgadekar2012r2,dc=com> with scope subtree
# filter: cn=%head_non*
# requesting: ALL
#
# %head_nonposix_rule, Sudoers, sgadekar2012r2.com
dn: CN=%head_nonposix_rule,OU=Sudoers,DC=sgadekar2012r2,DC=com
objectClass: top
objectClass: sudoRole
cn: %head_nonposix_rule
distinguishedName: CN=%head_nonposix_rule,OU=Sudoers,DC=sgadekar2012r2,DC=com
instanceType: 4
whenCreated: 20210125150700.0Z
whenChanged: 20210125150700.0Z
uSNCreated: 16889
uSNChanged: 16892
name: %head_nonposix_rule
objectGUID:: +QsGvEvVEEOU8WOsvo6lXQ==
objectCategory: CN=sudoRole,CN=Schema,CN=Configuration,DC=sgadekar2012r2,DC=co
m
dSCorePropagationData: 16010101000000.0Z
sudoCommand: /usr/bin/head
sudoHost: ALL
sudoUser: %sudo_groupx
sudoUser: %sudo_groupx
sudoOption: !authenticate
sudoOption: !requiretty
# search result
search: 2
result: 0 Success
marking verified.
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-2021:1666 |