Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
There are many cases where executing a command with sudo as a confined sysadm user doesn't work, usually most command executed as shown below:
$ sudo <program> <args...>
e.g.
$ sudo passwd
The root cause are missing contexts or transitions from "sysadm_sudo_t" (context of "sudo") to appropriate context (e.g. "passwd_t" through "passwd_exec_t" file).
With time, engineering comes up with adding more rules for domains, but since customers use very customized configuration, the policy is always late.
Last reported issue is with "passwd" when using cracklib database:
When executing "sudo passwd", the cracklib database cannot be read because "passwd" command executes in the context of "sudo" (sysadm_sudo_t) instead of "passwd (passwd_t").
As shown in the example below:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
type=PROCTITLE ... : proctitle=passwd <USERNAME>
type=PATH ... : item=0 name=/usr/share/cracklib/pw_dict.pwd.gz ... mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:crack_db_t:s0 ...
type=SYSCALL ... : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7ffde70cf450 a1=O_RDONLY ... uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root ... comm=passwd exe=/usr/bin/passwd subj=sysadm_u:sysadm_r:sysadm_sudo_t:s0-s0:c0.c1023 ...
type=AVC ... : avc: denied { read } for pid=13672 comm=passwd name=pw_dict.pwd.gz ... scontext=sysadm_u:sysadm_r:sysadm_sudo_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crack_d _t:s0 tclass=file permissive=0
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Version-Release number of selected component (if applicable):
RHEL8.3 policy, RHEL7.9 policy
How reproducible:
Always when using crack library.
Additional info:
We need to fix the policy again and again.
Note that I filed a RFE against sudo to always use the "SELinux aware" code: BZ #1910077
Implementing this RFE would solve **ALL** "sudo <command>" issues.
To backport:
commit 3b826a9f34d86388fde3a07a9dcfeccdc762bafe
Author: Zdenek Pytela <zpytela>
Date: Mon Dec 20 11:47:29 2021 +0100
Allow sudodomains execute passwd in the passwd domain
When an unprivileged user in the sysadm_r role executes passwd
through sudo, it transitions into sysadm_sudo_t domain by default.
With this commit, the process transitions back to sysadm_t.
Resolves: rhbz#1943572
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 (selinux-policy 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-2022:1995
Description of problem: There are many cases where executing a command with sudo as a confined sysadm user doesn't work, usually most command executed as shown below: $ sudo <program> <args...> e.g. $ sudo passwd The root cause are missing contexts or transitions from "sysadm_sudo_t" (context of "sudo") to appropriate context (e.g. "passwd_t" through "passwd_exec_t" file). With time, engineering comes up with adding more rules for domains, but since customers use very customized configuration, the policy is always late. Last reported issue is with "passwd" when using cracklib database: When executing "sudo passwd", the cracklib database cannot be read because "passwd" command executes in the context of "sudo" (sysadm_sudo_t) instead of "passwd (passwd_t"). As shown in the example below: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- type=PROCTITLE ... : proctitle=passwd <USERNAME> type=PATH ... : item=0 name=/usr/share/cracklib/pw_dict.pwd.gz ... mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:crack_db_t:s0 ... type=SYSCALL ... : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7ffde70cf450 a1=O_RDONLY ... uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root ... comm=passwd exe=/usr/bin/passwd subj=sysadm_u:sysadm_r:sysadm_sudo_t:s0-s0:c0.c1023 ... type=AVC ... : avc: denied { read } for pid=13672 comm=passwd name=pw_dict.pwd.gz ... scontext=sysadm_u:sysadm_r:sysadm_sudo_t:s0-s0:c0.c1023 tcontext=system_u:object_r:crack_d _t:s0 tclass=file permissive=0 -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Version-Release number of selected component (if applicable): RHEL8.3 policy, RHEL7.9 policy How reproducible: Always when using crack library. Additional info: We need to fix the policy again and again. Note that I filed a RFE against sudo to always use the "SELinux aware" code: BZ #1910077 Implementing this RFE would solve **ALL** "sudo <command>" issues.