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 1919122 - Permission denied+AVC seen when executing "sudo authconfig" as a confined user (staff_u or sysadm_u)
Summary: Permission denied+AVC seen when executing "sudo authconfig" as a confined use...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: 8.6
Assignee: Zdenek Pytela
QA Contact: Amith
URL:
Whiteboard:
Depends On:
Blocks: 1778780
TreeView+ depends on / blocked
 
Reported: 2021-01-22 08:11 UTC by Renaud Métrich
Modified: 2024-03-25 17:56 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.14.3-86.el8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:14:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1910077 1 high CLOSED sudoing as sysadm_r still requires specifying "-r sysadm_r" parameter 2023-10-09 15:18:00 UTC
Red Hat Product Errata RHBA-2022:1995 0 None None None 2022-05-10 15:15:13 UTC

Description Renaud Métrich 2021-01-22 08:11:45 UTC
Description of problem:

Executing "sudo authconfig" as a confined user ends up having a Permission denied  + AVC:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
$ sudo authconfig --test
[sudo] password for staff: 
sudo: unable to execute /sbin/authconfig: Permission denied
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

AVC:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
time->Fri Jan 22 09:03:35 2021
type=PROCTITLE msg=audit(1611302615.729:148): proctitle=7375646F0061757468636F6E666967002D2D74657374
type=SYSCALL msg=audit(1611302615.729:148): arch=c000003e syscall=59 success=no exit=-13 a0=559e79623e78 a1=559e7961de78 a2=559e79673930 a3=1 items=0 ppid=1963 pid=1987 auid=1001 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="sudo" exe="/usr/bin/sudo" subj=staff_u:staff_r:staff_sudo_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1611302615.729:148): avc:  denied  { execute_no_trans } for  pid=1987 comm="sudo" path="/usr/lib/python3.6/site-packages/authselect/authcompat.py" dev="dm-0" ino=18148211 scontext=staff_u:staff_r:staff_sudo_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=file permissive=0
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The reason for this is having /sbin/authconfig be a symlink to /usr/lib/python3.6/site-packages/authselect/authcompat.py which is labeled with lib_t, preventing the execution by staff_sudo_t.
Same happens when being sysadm_sudo_t.

Version-Release number of selected component (if applicable):

authselect-compat-1.2.1-2.el8.x86_64


How reproducible:

Always

Steps to Reproduce:
1. Create a confined user that can sudo

  # useradd -Z staff_u -G wheel staff
  # echo "pass" | passwd --stdin staff

2. Switch to the user

  # ssh staff@localhost
  staff@localhost's password: pass
  $ id -Z
  staff_u:staff_r:staff_t:s0-s0:c0.c1023

3. Execute authconfig through sudo

  $ sudo authconfig --test
  [sudo] password for staff: pass
  sudo: unable to execute /sbin/authconfig: Permission denied


Actual results:

  sudo: unable to execute /sbin/authconfig: Permission denied
  + AVC

Expected results:

  works fine

Comment 1 Pavel Březina 2021-02-01 12:12:56 UTC
Thank you. Switching to selinux-policy.

Comment 4 Markus Iturriaga 2021-06-14 13:23:41 UTC
Interestingly, if the sysadm_u user can change to root via sudo -i, they *can* run the authconfig command while running a root shell:

> sudo authconfig --test
[sudo] password for user:
sudo: unable to execute /sbin/authconfig: Permission denied

> sudo -i

> whoami
root

> id -Z
sysadm_u:sysadm_r:sysadm_t:s0

> authconfig --test
Running authconfig compatibility tool.
[...]

Why would that be the case?

Comment 6 Zdenek Pytela 2021-12-22 12:41:52 UTC
Will be resolved by labeling
/usr/lib/python3.6/site-packages/authselect/authcompat.py

but in RHEL 8 only as there is no authselect-compat in current releases.

Comment 20 errata-xmlrpc 2022-05-10 15:14:56 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 (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


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