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 1053804

Summary: ausearch issues found by ausearch-test
Product: Red Hat Enterprise Linux 7 Reporter: Steve Grubb <sgrubb>
Component: auditAssignee: Steve Grubb <sgrubb>
Status: CLOSED CURRENTRELEASE QA Contact: Ondrej Moriš <omoris>
Severity: medium Docs Contact:
Priority: urgent    
Version: 7.0CC: omoris, sforsber, sgrubb, svenkatr
Target Milestone: rcKeywords: Rebase
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: audit-2.3.3-2.el7 Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Story Points: ---
Clone Of: 1049916 Environment:
Last Closed: 2014-06-13 09:54:50 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: 829175    
Bug Blocks:    
Attachments:
Description Flags
Test case none

Description Steve Grubb 2014-01-15 19:39:40 UTC
+++ This bug was initially created as a clone of Bug #1049916 +++

Description of problem:

Using ausearch-test [1], we found out that ausearch -f ignores specific records, for instance:

# cat audit.log
...
type=AVC msg=audit(1314775502.467:64991): avc:  denied  { read } for  pid=24194 comm="cat" name="log" dev=cciss/c0d0p2 ino=2433983 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=file
...
# ausearch -if ./audit.log -f "log"
<no matches>

[1] http://people.redhat.com/sgrubb/audit/ausearch-test-0.4.tar.gz

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

audit-2.2-2.el6

How reproducible:

100%

Steps to Reproduce:
1. See above

Actual results:

<no matches>

Expected results:

type=AVC msg=audit(1314775502.467:64991): avc:  denied  { read } for  pid=24194 comm="cat" name="log" dev=cciss/c0d0p2 ino=2433983 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=file

--- Additional comment from Ondrej Moriš on 2014-01-08 08:58:22 EST ---

I am changing summary to a more general one and adding the full summary of issues found using attached testing audit.log (many event types are missing, but the most common ones are included).

# ./ausearch-test 
Starting the test

Failed to locate a record
Current test option: -f "log"
Command used: ausearch -if ./audit.log -a 64991 -m AVC -p 24194 -c "cat" -f "log"
Full record being tested: type=AVC msg=audit(1314775502.467:64991): avc:  denied  { read } for  pid=24194 comm="cat" name="log" dev=cciss/c0d0p2 ino=2433983 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=file

Failed to locate a record
Current test option: -se system_u:system_r:logwatch_t:s0-s0:c0.c1023
Command used: ausearch -if ./audit.log -a 64991 -m AVC -p 24194 -c "cat" -f "log" -se system_u:system_r:logwatch_t:s0-s0:c0.c1023
Full record being tested: type=AVC msg=audit(1314775502.467:64991): avc:  denied  { read } for  pid=24194 comm="cat" name="log" dev=cciss/c0d0p2 ino=2433983 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=file

Failed to locate a record
Current test option: -se unconfined_u:object_r:var_spool_t:s0
Command used: ausearch -if ./audit.log -a 64991 -m AVC -p 24194 -c "cat" -f "log" -se system_u:system_r:logwatch_t:s0-s0:c0.c1023 -se unconfined_u:object_r:var_spool_t:s0
Full record being tested: type=AVC msg=audit(1314775502.467:64991): avc:  denied  { read } for  pid=24194 comm="cat" name="log" dev=cciss/c0d0p2 ino=2433983 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_spool_t:s0 tclass=file

Comment 6 Steve Grubb 2014-01-20 18:41:41 UTC
audit-2.3.3-1.el7 was built to resolve this issue.

Comment 8 Steve Grubb 2014-01-23 17:21:23 UTC
Created attachment 854509 [details]
Test case

This file can be used to detect a problem with ausearch. The following will trigger it:

ausearch -if deleted.log -f '/var/lib/gdm/ffiYm0CQK (deleted)'

Comment 9 Ondrej Moriš 2014-02-14 12:26:03 UTC
Just a remark - this bug depends on Bug 829175 which is related to AUDIT_USER_MAC_CONFIG_CHANGE event.

Comment 10 Ondrej Moriš 2014-03-03 08:54:21 UTC
Note for QE: Since Bug 829175 has recently changed its proposed target from 7.0 to 7.1, I will just sanity check that part of this bug which is related to Bug 829175.

Comment 11 Ondrej Moriš 2014-03-10 08:41:38 UTC
Successfully verified with audit-2.3.3-2.el7:

- Documentation updates

Sanity testing via manpage-check.

- Add AUDIT_USER_MAC_CONFIG_CHANGE event for MAC policy changes

Sanity only - see Comments 9 and 10. 

- Remove CAP_COMPROMISE_KERNEL interpretation
- Update automake files to automake-1.13.4

Verified manually by a code review.

- Update interpreting scheduler policy names
- Parse name field in AVC's (#1049916)
- Add missing typedef for auparse_type_t enumeration (#1053424)
- Fix parsing encoded filenames in records
- original bug description

Verified automatically.

Comment 12 Ludek Smid 2014-06-13 09:54:50 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.