Bug 871208

Summary: ipa sudorule-add-user should accept external users
Product: Red Hat Enterprise Linux 8 Reporter: Scott Poore <spoore>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.0CC: abokovoy, blc, dpal, ipa-maint, jgalipea, ksiddiqu, ldelouw, mkosek, mpolovka, mvarun, ndehadra, pasik, pcech, pvoborni, rcritten, ssidhaye, tscherf, twoerner, wefleury
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.9.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:47:45 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 Scott Poore 2012-10-29 22:33:01 UTC
Description of problem:

ipa sudorule-add-user restricts users names to a limited variety of characters.  At the very least @ and \ should be included to cover username conventions used for AD trusted users.  When I try now, I see this:

[root@rhel6-1 failure1]#  ipa sudorule-add-user testrule --users=adtestuser1
ipa: ERROR: invalid 'user': may only include letters, numbers, _, -, . and $

In addition Simo mentioned in an email:

We should allow any character in this case.
These are external user/group names, we do not have any control on them.

If I want to add the user ätest@foo^^bar in /etc/passwd then I should be
allowed to use it in a sudo rule

Version-Release number of selected component (if applicable):
ipa-server-3.0.0-106.20121026T1837zgitf14dd98.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1.  Setup IPA Master
2.  ipa sudorule-add testrule
3.  ipa sudorule-add-user --users=test
  
Actual results:
error listed above

Expected results:
success

Additional info:

Comment 2 Dmitri Pal 2012-10-29 23:27:36 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/3226

Comment 3 Scott Poore 2012-10-30 14:53:10 UTC
After Sumit brought up a good point, I'm modifying this request.

Instead of modifying --users option functionality, I'd like to request a new --external (or similar) option.  This will allow a distinction between adding IPA users and External ones coming from other sources like AD.

I'd think we'd keep the option similar to the group-add one used when adding AD groups/users to a group in IPA.

Comment 7 Petr Vobornik 2017-02-23 15:12:45 UTC
The bugzilla doesn't have high enough priority in comparison to other bugs/RFEs for 7.4. Moving to next release. Without sufficient justification it can be moved again later.

Comment 22 Alexander Bokovoy 2021-01-27 09:44:22 UTC
Upstream design document: https://freeipa.readthedocs.io/en/latest/designs/adtrust/sudorules-with-ad-objects.html

Comment 28 Michal Polovka 2021-02-02 11:25:10 UTC
Verified using ipa-server-4.9.1-1.module+el8.4.0+9665+c9815399.x86_64 and ipa-server-trust-ad-4.9.1-1.module+el8.4.0+9665+c9815399.x86_64 in RHEL8.4 nightly build.

Passed 	test_integration/test_trust.py::TestTrust::()::test_sudorules_ad_users
Passed 	test_integration/test_trust.py::TestTrust::()::test_sudorules_ad_groups	
Passed 	test_integration/test_trust.py::TestTrust::()::test_sudorules_ad_runasuser
Passed 	test_integration/test_trust.py::TestTrust::()::test_sudorules_ad_runasuser_group
Passed 	test_integration/test_trust.py::TestTrust::()::test_sudorules_ad_runasgroup

Full test log is available as an attachment of this BZ.

Comment 31 errata-xmlrpc 2021-05-18 15:47:45 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 (Moderate: idm:DL1 and idm:client security, 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/RHSA-2021:1846