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 1393417

Summary: FS_RELABEL audit message does not appear after filesystem relabel
Product: Red Hat Enterprise Linux 6 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED WONTFIX QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: dwalsh, lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-09 15:48: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 Milos Malik 2016-11-09 13:56:31 UTC
Description of problem:
* the "fixfiles restore" command generates FS_LABEL audit message on both RHELs
* but the filesystem relabel during reboot does not generate such a message on RHEL-6.8

Version-Release number of selected component (if applicable):
policycoreutils-2.0.83-29.el6.x86_64

How reproducible:
* always

Steps to Reproduce:
1. fixfiles restore
2. fixfiles onboot
3. reboot

Actual results on RHEL-6.8:
# ausearch -m fs_relabel -i
----
type=FS_RELABEL msg=audit(11/09/2016 07:54:55.582:197) : user pid=1623 uid=root auid=root ses=2 subj=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 msg='op=mass relabel exe=/sbin/setfiles hostname=? addr=? terminal=pts/0 res=success' 
----

Actual results on RHEL-7.3:
# ausearch -m fs_relabel -i
----
type=FS_RELABEL msg=audit(11/09/2016 07:55:02.366:282) : pid=1773 uid=root auid=root ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=mass relabel exe=/usr/sbin/setfiles hostname=? addr=? terminal=pts/0 res=success' 
----
type=FS_RELABEL msg=audit(11/09/2016 07:58:10.386:12) : pid=1143 uid=root auid=unset ses=unset subj=system_u:system_r:unconfined_service_t:s0 msg='op=mass relabel exe=/usr/sbin/setfiles hostname=? addr=? terminal=console res=success' 
----

Comment 1 Petr Lautrbach 2016-11-09 15:48:41 UTC
The relabel in rhel-6 happens in rc.sysinit which is run before any service including auditd is started so it can't be logged. The following workaround would fix it but I don't think it's appropriate for this phase of RHEL-6:

# diff -u /etc/rc.d/rc.sysinit.orig /etc/rc.d/rc.sysinit
--- /etc/rc.d/rc.sysinit.orig   2016-11-09 16:46:57.619932397 +0100
+++ /etc/rc.d/rc.sysinit        2016-11-09 16:47:39.088114173 +0100
@@ -525,6 +525,7 @@
 # Check to see if a full relabel is needed
 if [ -n "$SELINUX_STATE" -a "$READONLY" != "yes" ]; then
     if [ -f /.autorelabel ] || strstr "$cmdline" autorelabel ; then
+       service auditd start
        relabel_selinux
     fi
 else