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 2003153 - Confined sysadm users cannot execute postfix administration commands
Summary: Confined sysadm users cannot execute postfix administration commands
Keywords:
Status: CLOSED DUPLICATE of bug 1965251
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.6
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1778780
TreeView+ depends on / blocked
 
Reported: 2021-09-10 13:18 UTC by Renaud Métrich
Modified: 2024-12-20 21:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-21 18:43:36 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 Issue Tracker RHELPLAN-96869 0 None None None 2021-09-10 13:18:48 UTC

Description Renaud Métrich 2021-09-10 13:18:21 UTC
Description of problem:

When a user is confined to sysadm_u and sudo'es, he still cannot execute administrative postfix commands such as the ones below:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# id -Z
sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023

# /sbin/postsuper
-bash: /sbin/postsuper: Permission denied

# /usr/bin/newaliases
postalias: fatal: open database /etc/aliases.db: Permission denied
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

For `postsuper`, it's due to not having a rule to execute "postfix_master_exec_t" file.

For `newaliases`, it's due to not having a rule to be able to create the file in `/etc` when file doesn't exist.


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

selinux-policy-3.14.3-67.el8_4.1.noarch


How reproducible:

Always, see above.

Additional info:

This is problematic when root has been disabled. Since it's not possible to transition to "unconfined_r" role, no sysadm_u user can execute such commands.

Comment 1 Zdenek Pytela 2021-12-21 18:43:36 UTC
rhel8# rpm -q selinux-policy
selinux-policy-3.14.3-85.el8.noarch
rhel8# /sbin/postsuper
rhel8# touch /etc/aliases
rhel8# /usr/bin/newaliases
rhel8#

*** This bug has been marked as a duplicate of bug 1965251 ***

Comment 2 Renaud Métrich 2022-05-05 10:06:01 UTC
Hi Zdenek,

I don't understand why you closed this as a dup of some unrelated BZ (the other BZ is on sosreport).
Do you plan to fix this in that BZ instead?

Just FYI the solution here is to allow user_mail_t to manage etc_aliases_t:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
policy_module(user_mail_allow_creating_etc_aliases, 1.0)

gen_require(`
	type user_mail_t;
	type etc_aliases_t;
')

manage_files_pattern(user_mail_t, etc_aliases_t, etc_aliases_t)
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


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