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.

Bug 2025925

Summary: Confined sysadm users cannot execute Pacemaker commands
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: lvrabec, mmalik, ssekidde
Target Milestone: rcKeywords: Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-21 18:35:14 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:
Bug Depends On:    
Bug Blocks: 1778780    

Description Renaud Métrich 2021-11-23 12:12:15 UTC
Description of problem:

When a user is confined to *sysadm_u* and tries, after sudoing, to execute various Pacemaker commands, they fail or show nothing, e.g.:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# id -Z
sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023

# pcs stonith status
Error: unable to get cluster status from crm_mon
crm_mon: Error: cluster is not available on this node

# crm_mon
Waiting until cluster is available on this node ...
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The root cause is *sysadm_t* is not able to connect to the Unix socket hold by *cluster_t* (Pacemaker daemons):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
type=PROCTITLE msg=audit(11/23/2021 13:09:29.151:4608) : proctitle=crm_mon 
type=SYSCALL msg=audit(11/23/2021 13:09:29.151:4608) : arch=x86_64 syscall=connect success=no exit=EACCES(Permission denied) a0=0x3 a1=0x7ffea4eaef30 a2=0x6e a3=0x0 items=0 ppid=29071 pid=29110 auid=sysadm uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts3 ses=41 comm=crm_mon exe=/usr/sbin/crm_mon subj=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(11/23/2021 13:09:29.151:4608) : avc:  denied  { connectto } for  pid=29110 comm=crm_mon path=pacemakerd scontext=sysadm_u:sysadm_r:sysadm_t:s0-s0:c0.c1023 tcontext=system_u:system_r:cluster_t:s0 tclass=unix_stream_socket permissive=0 
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

The fix is to let it connect to the socket:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# cat local_pacemaker_sysadm.cil 
(allow sysadm_t cluster_t (unix_stream_socket (connectto)))
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

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

selinux-policy-3.14.3-80.el8.noarch


How reproducible:

Always

Comment 1 Zdenek Pytela 2021-12-21 18:35:14 UTC
rhel8# rpm -q selinux-policy
selinux-policy-3.14.3-85.el8.noarch
rhel8# sesearch -A -s sysadm_t -t cluster_t -c unix_stream_socket -p connectto
allow sysadm_t cluster_domain:unix_stream_socket connectto;

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