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 1826272 - [RFE] support non-posix groups in sudo rules
Summary: [RFE] support non-posix groups in sudo rules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Pavel Březina
QA Contact: shridhar
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-21 11:04 UTC by Divya Mittal
Modified: 2024-03-25 16:04 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:03:54 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 5119 0 None closed sudo: support non-posix groups in sudo rules 2021-02-14 14:17:22 UTC
Red Hat Issue Tracker SSSD-2499 0 None None None 2024-03-25 16:04:26 UTC
Red Hat Issue Tracker SSSD-2500 0 None None None 2024-03-25 16:04:11 UTC

Description Divya Mittal 2020-04-21 11:04:35 UTC
1. Proposed title of this feature request

[RFE] Group Policy Plugin in sssd


2. Who is the customer behind the request?

Account: RBOS FM ,#729867
TAM customer: yes
CSM customer: yes
Strategic:    yes
 
3. What is the nature and description of the request?

This request is for an enhancement to sssd-ad that would enable it to honour the 'nonunix_group' and 'nonunix_gid' syntax directives detailed in the sudoers man page, allowing non-POSIX groups to be specified in sudoers rules.


The default Sudo security policy plugin (sudoers) provides for the implementation of 'group provider' plugins specifically to enable non-UNIX group lookups (for more details see https://www.sudo.ws/man/sudo_plugin.man.html#Sudoers_group_plugin_API)


Please note that this request has been raised specifically to track upstream ticket https://pagure.io/SSSD/sssd/issue/4164  

4. Why does the customer need this? (List the business requirements here)

The banking sector is necessarily highly regulated, change control is the often subject to extreme scrutiny, audits are frequent. A fundamental requirement is that we are able, for a period of several years after the event, to provide full details of all changes made to production systems - what, when, by whom and with what authorisation. To that end, my company has already made a significant investment in a centralised system for managing privileged/elevated access across most of our platforms, which grants privilege using Active Directory group membership.


We would very much like to use the same system to manage privileged access across our Linux estate, where native sudo is the privilege escalation tool of choice, but for a number of mainly non-technical reasons the POSIX groups that are consumed by our Linux servers are not managed in Active Directory. Therefore in order for those servers to have their privileged access managed by the aforementioned centralised system, they would need to specify non-POSIX groups in their sudo rules.


The only viable alternative solutions at this stage are commercial products, eg Quest Authentication Services, which would entail a significant cost overhead in a large environment such as ours.



5. How would the customer like to achieve this? (List the functional requirements here)

The standard sudoers file format allows for the following directives to be used when specifying the User part of a sudoers rule:


         '!'* %:nonunix_group |
         '!'* %:#nonunix_gid |
...and, continuing the sudoers man page: 



The actual nonunix_group and nonunix_gid syntax depends on the underlying group provider plugin. For instance, the QAS AD plugin supports the following formats:





Group in the same domain: "%:Group Name"

Group in any domain: "%:Group Name.DOMAIN"

Group SID: "%:S-1-2-34-5678901234-5678901234-5678901234-567"



Obviously the sssd-ad implementation wouldn’t need to follow the QAS example precisely (although it is fairly comprehensive and useful), but from a personal perspective my main requirement is that it is able to rapidly resolve membership of non-POSIX groups, including indirect membership (suggesting use of an extensible match filter using OID 1.2.840.113556.1.4.1941)



6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

NA

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

NA

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

No specific timeline, just as soon as possible please.


RHEL 8



9. Is the sales team involved in this request and do they have any additional input?

No

10. List any affected packages or components.

sssd

11. Would the customer be able to assist in testing this functionality if implemented?

Yes

Comment 2 dave 2020-05-04 15:15:30 UTC
Upstream ticket migrated to https://github.com/SSSD/sssd/issues/5119

Comment 4 Pavel Březina 2020-10-21 14:25:29 UTC
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.

Comment 18 shridhar 2021-01-25 15:47:21 UTC
[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.

Comment 20 errata-xmlrpc 2021-05-18 15:03:54 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 (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


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