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 1298523

Summary: Missing SELinux context transition from logrotate to RabbitMQ
Product: Red Hat Enterprise Linux 7 Reporter: Robert Scheck <redhat-bugzilla>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: asadawar, lvrabec, mgrepl, mmalik, plautrba, pvrabec, robert.scheck, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-18 09:53:41 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 Robert Scheck 2016-01-14 10:35:33 UTC
Description of problem:
After installing the rabbitmq-server, the logrotate fails on RHEL 7 daily
with an e-mail like this:

--- snipp ---
Date: Wed, 13 Jan 2016 03:38:10 +0100 (CET)
From: Anacron <root.net>
To: root.net
Subject: Anacron job 'cron.daily' on tux.example.net
Message-Id: <20160113023810.77068405B3.net>

/etc/cron.daily/logrotate:

su: avc.c:74: avc_context_to_sid_raw: Assertion `avc_running' failed.
/usr/sbin/rabbitmqctl: line 44:  9328 Aborted                 su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
error: error running shared postrotate script for '/var/log/rabbitmq/*.log '
--- snapp ---

type=AVC msg=audit(1452737286.080:2916): avc:  denied  { create } for  pid=21548 comm="su" scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tclass=netlink_selinux_socket
type=SYSCALL msg=audit(1452737286.080:2916): arch=c000003e syscall=41 success=no exit=-13 a0=10 a1=80003 a2=7 a3=1 items=0 ppid=21536 pid=21548 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=74 comm="su" exe="/usr/bin/su" subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)
type=USER_AVC msg=audit(1452737286.080:2917): pid=21548 uid=0 auid=0 ses=74 subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 msg='avc:  can't open netlink socket: 13 (Permission denied)  exe="/usr/bin/su" sauid=0 hostname=? addr=? terminal=?'
type=ANOM_ABEND msg=audit(1452737286.081:2918): auid=0 uid=0 gid=0 ses=74 subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 pid=21548 comm="su" reason="memory violation" sig=6

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.13.1-60.el7.noarch
rabbitmq-server-3.3.5-15.el7.noarch

How reproducible:
Everytime during logrotate, see above and below

Actual results:
Missing SELinux context transition from logrotate to RabbitMQ.

Expected results:
SELinux context transition from logrotate to RabbitMQ or some exception.

Additional info:
Above AVC denied messages where gathered while SELinux was enforced, it
seems like the rabbitmq-server is still working without impact (as far as
we can tell currently). Nevertheless the SELinux policy should address
this one or the other way for the future.

Comment 2 Robert Scheck 2016-01-14 10:37:22 UTC
Cross-filed case 01566784 on the Red Hat customer portal.

Comment 3 Simon Sekidde 2016-01-14 16:25:43 UTC
Robert, 

Are you able to provide the raw audit messages when in permissive mode? 

 logrotate -d -f /etc/logrotate.conf

Comment 4 Robert Scheck 2016-01-14 17:11:55 UTC
Unfortunately '-d' avoids that anything is being done. I just tried '-f'
now, but this didn't bring any audit denied. Will check with my colleague
tomorrow how to reproduce in a non-production environment best :)

Comment 5 Milos Malik 2016-01-14 17:57:51 UTC
I believe that's the same problem as described in BZ#1283134. Any logrotate script which runs su directly or indirectly will trigger such AVC.

Comment 6 Miroslav Grepl 2016-01-18 09:53:41 UTC

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