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 872619 - sudoUser group and netgroup specifications don't work
Summary: sudoUser group and netgroup specifications don't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sssd
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jakub Hrozek
QA Contact: Kaushik Banerjee
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-02 15:27 UTC by Nikolai Kondrashov
Modified: 2020-05-02 17:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-26 18:19:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The reproduction script, base LDIF file, sssd.conf and logs from the reproduction script execution (66.98 KB, application/x-gzip)
2012-11-02 15:27 UTC, Nikolai Kondrashov
no flags Details
Reproduction script for LDAP sudo backend (1.36 KB, application/octet-stream)
2012-11-05 15:53 UTC, Nikolai Kondrashov
no flags Details
The corrected LDIF file with memberUid added (2.97 KB, text/x-ldif)
2012-11-15 18:55 UTC, Nikolai Kondrashov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 2666 0 None None None 2020-05-02 17:04:45 UTC

Description Nikolai Kondrashov 2012-11-02 15:27:03 UTC
Created attachment 637129 [details]
The reproduction script, base LDIF file, sssd.conf and logs from the reproduction script execution

Description of problem:
sudoUser %group_name and %#group_id values result in always denied access,
+netgroup_name values result in always allowed access.

Version-Release number of selected component (if applicable):
sssd-1.9.2-4.el6.x86_64
libsss_idmap-1.9.2-4.el6.x86_64
libsss_autofs-1.9.2-4.el6.x86_64
sssd-client-1.9.2-4.el6.x86_64
libsss_sudo-1.9.2-4.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Use attached LDIF file to fill LDAP directory
2. Use attached sssd.conf as the base for client configuration
3. Execute attached sudo_user_spec_test on the client
  
Actual results:
%group_user1: DENIED
%group_user2: DENIED
%#20001: DENIED
%#20002: DENIED
+netgroup_user1: ALLOWED
+netgroup_user2: ALLOWED

Expected results:
%group_user1: ALLOWED
%group_user2: DENIED
%#20001: ALLOWED
%#20002: DENIED
+netgroup_user1: ALLOWED
+netgroup_user2: DENIED

Comment 2 Nikolai Kondrashov 2012-11-05 15:53:26 UTC
Created attachment 638717 [details]
Reproduction script for LDAP sudo backend

The same directory entries work with sudo using LDAP backend instead of sssd. A reproduction script is attached.

Comment 3 Jakub Hrozek 2012-11-06 08:13:46 UTC
Pavel, this one is yours.

Comment 4 Jakub Hrozek 2012-11-08 10:26:31 UTC
Upstream ticket:
https://fedorahosted.org/sssd/ticket/1624

Comment 5 Pavel Březina 2012-11-15 11:36:43 UTC
Hi,
these LDAP values didn't work correctly for me even with direct sudo <-> ldap. I believe the ldif is wrong. Why do you use multivalued cn to express group membership? Instead of using multivalued cn, you should use memberUid attribute.

%group works fine for me with memberUid attribute
%#gid does not work, it is not yet implemented
+netgroups allow all rules containing netgroup, I will investigate that. It is a bug on sudo side.

Thank you.

Comment 6 Nikolai Kondrashov 2012-11-15 18:55:41 UTC
Created attachment 645827 [details]
The corrected LDIF file with memberUid added

The multiple cn's were the result of a bug in my test code which generated this directory state, sorry. However, removing them didn't affect the test outcome.

I was under the impression that memberUid wasn't required for group members which have the group as primary (have gidNumber set to the group's gidNumber). The regular tools I tried worked OK with this. Does SSSD require memberUid in this case? This isn't specified in the documentation.

Still, adding memberUid to posixGroup's didn't affect the outcome of the test (the executable attached to the bug).

I've attached the fixed directory contents I used this time.

Comment 7 Pavel Březina 2012-11-23 12:09:27 UTC
Hi,
memberUid surprisingly should not contain uid number, but username (or to be more precise value of user's uid attribute e.g. uid: user1). But you have a good point that it should recognize user's primary group without the need of memberUid attribute. I'll prepare a patch.

Netgroup issue is indeed a problem on sudo side, so we need to file sudo bug on that. We made a design decision that sssd will send all rules that contains +netgroup to sudo (this works ok) and sudo will filter them out (this does not happen).

Comment 8 Pavel Březina 2012-11-23 14:17:52 UTC
Upstream ticket for implementing %#gid support:
https://fedorahosted.org/sssd/ticket/1667

Comment 9 Jakub Hrozek 2012-11-26 09:42:21 UTC
(In reply to comment #8)
> Upstream ticket for implementing %#gid support:
> https://fedorahosted.org/sssd/ticket/1667

Can you either reword this bugzilla or close it and open a new one?

Comment 10 Nikolai Kondrashov 2012-11-26 12:13:16 UTC
I've submitted Bug 880150 on the netgroup issue.

Comment 11 Nikolai Kondrashov 2012-11-26 12:16:20 UTC
I've confirmed that adding "memberUid: user1" to "cn=group_user1,ou=Groups,dc=example,dc=com" makes "sudoUser: %group_user1" work, so I can make a bug on "memberUid" requirement.

However, it doesn't make "sudoUser: %#20001" work. Bare LDAP sudo backend works with this.

Shall I make another bug on this?

Comment 12 Nikolai Kondrashov 2012-11-26 12:21:08 UTC
Ah, sorry, I assume that https://fedorahosted.org/sssd/ticket/1667 was opened for that. Shall we submit a corresponding bug to Bugzilla?

Comment 14 Nikolai Kondrashov 2012-11-26 12:50:27 UTC
Bug 880176 opened for primary group memberUid issue.

Comment 15 Nikolai Kondrashov 2012-11-26 13:20:12 UTC
Fixing the component. Not sure how it changed.

Comment 16 Nikolai Kondrashov 2012-11-26 18:19:51 UTC
Split into three:

Bug 880150
Bug 880176
Bug 880335


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