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 2070706 - Default systemd service config blocks audit watch rules in some directories (rhel 9.0)
Summary: Default systemd service config blocks audit watch rules in some directories (...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: audit
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Sergio Correia
QA Contact: Martin Zelený
URL:
Whiteboard:
Depends On: 2070705
Blocks: 2071725
TreeView+ depends on / blocked
 
Reported: 2022-03-31 17:32 UTC by Sergio Correia
Modified: 2022-05-17 16:23 UTC (History)
6 users (show)

Fixed In Version: audit-3.0.7-101.el9_0.2
Doc Type: No Doc Update
Doc Text:
Clone Of: 2070705
: 2071725 (view as bug list)
Environment:
Last Closed: 2022-05-17 15:55:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-117563 0 None None None 2022-03-31 17:36:29 UTC
Red Hat Issue Tracker SECENGSP-4483 0 None None None 2022-03-31 17:36:42 UTC
Red Hat Product Errata RHBA-2022:3963 0 None None None 2022-05-17 15:55:43 UTC

Description Sergio Correia 2022-03-31 17:32:48 UTC
+++ This bug was initially created as a clone of Bug #2070705 +++

Description of problem:

With the default audit configuration, watch rules in some directories are blocked.

This issue was reported upstream here [1] and fixed here [2].

Current auditd systemd service has a "ProtectHome=true" directive, which, as per systemd.exec(5) man page, "If true, the directories /home/, /root, and /run/user are made inaccessible and empty for processes invoked by this unit."

As Paul explains in [1], "What is happening is that when you load an audit rule to watch a file like you are doing here, the kernel leverages some internal functionality to "tag" the file so that the audit subsystem is notified when it is accessed. With the systemd config above the "/home" and "/root" directories are not the same between when the audit rules are loaded and when the system is available for interactive use."


Version-Release number of selected component (if applicable): audit-3.0.7-3.el8

How reproducible: always

Steps to Reproduce:
1. Create a /etc/audit/rules.d/extra.rules file with the following content:

-w /root/testfile -p rwxa -k test-root
-w /home/testfile -p rwxa -k test-home

2. Restart the audit daemon: # service auditd restart

3. Write to both files:
# start=$(date "+%T")
# echo 1 >  /root/testfile
# echo 2 > /home/testfile
# end=$(date "+%T")

4. Use ausearch to search for the test keys:
# ausearch -ts ${start} -te ${end} -k test-root --format text
# ausearch -ts ${start} -te ${end} -k test-home --format text


Actual results:
# ausearch -ts ${start} -te ${end} -k test-root --format text
<no matches>

# ausearch -ts ${start} -te ${end} -k test-home --format text
<no matches>

Expected results:
# ausearch -ts ${start} -te ${end} -k test-root --format text
At 13:22:58 03/31/2022 root successfully opened-file /root/testfile using bash

# ausearch -ts ${start} -te ${end} -k test-home --format text
At 13:23:01 03/31/2022 root successfully opened-file /home/testfile using bash


Additional info: This change was introduced in 3.0.3 [3].


[1] https://github.com/linux-audit/audit-userspace/issues/256 
[2] https://github.com/linux-audit/audit-userspace/commit/12cf14eda9fadeb7337a44653a80a57456afbb34
[3] https://github.com/linux-audit/audit-userspace/commit/3fcaa9

Comment 16 errata-xmlrpc 2022-05-17 15:55:31 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 (new packages: audit), 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:3963


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