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 1766489 - rpmverifyfile probe needs update to handle symlinks returned by rpmdb
Summary: rpmverifyfile probe needs update to handle symlinks returned by rpmdb
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openscap
Version: 7.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 7.8
Assignee: Jan Černý
QA Contact: Matus Marhefka
URL:
Whiteboard:
Depends On:
Blocks: 1776308
TreeView+ depends on / blocked
 
Reported: 2019-10-29 09:18 UTC by Jan Černý
Modified: 2020-11-14 05:43 UTC (History)
5 users (show)

Fixed In Version: openscap-1.2.17-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1776308 (view as bug list)
Environment:
Last Closed: 2020-03-31 20:11:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1183 0 None None None 2020-03-31 20:11:19 UTC

Description Jan Černý 2019-10-29 09:18:24 UTC
Description of problem:
Based on discussion https://bugzilla.redhat.com/show_bug.cgi?id=1693026 which is about rule file_permissions_unauthorized_suid we have designed a solution which needs update of OpenSCAP rpmverifyfileprobe.

The probe doesn't handle path returned by rpmdb if the path isn't canonical, eg. contains symlinks.

I have found that this rpmverifyfile_object does not match anything:

    <lin-def:rpmverifyfile_object id="oval:x:obj:3" version="1" comment="all files with suid set that come from a RPM package">
      <lin-def:behaviors nolinkto="true" nomd5="true" nosize="true" nouser="true" nogroup="true" nomtime="true" nomode="true" nordev="true" nofiledigest="true" nocaps="true" />
      <lin-def:name operation="pattern match">.*</lin-def:name>
      <lin-def:epoch operation="pattern match">.*</lin-def:epoch>
      <lin-def:version operation="pattern match">.*</lin-def:version>
      <lin-def:release operation="pattern match">.*</lin-def:release>
      <lin-def:arch operation="pattern match">.*</lin-def:arch>
      <lin-def:filepath>/usr/sbin/mount.nfs</lin-def:filepath>
    </lin-def:rpmverifyfile_object>

OTOH the similar object but with /sbin/mount.nfs matches the nfs-utils package.

But rpm -qf can find the nfs-utils package for both paths.

Version-Release number of selected component (if applicable):
1.2.17-2.el7

How reproducible:
always

Steps to Reproduce:
1. evaluate rules file_permissions_unauthorized_suid and file_permissions_unauthorized_sgid proposed in https://github.com/ComplianceAsCode/content/pull/4648
2.
3.

Actual results:
Probe reports false positives such as "/sbin/mount.nfs is not owned by any RPM" when the OVAL content from https://github.com/ComplianceAsCode/content/pull/4648 is evaluated.

Expected results:
Probe handles paths than contain symlinks and doesn't report files that are owned by RPM package as files that aren't owned by any RPM.


Additional info:
The fix has been proposed upstream in https://github.com/OpenSCAP/openscap/pull/1412

Comment 2 Jan Černý 2019-10-30 15:57:33 UTC
The fix has been merged upstream https://github.com/OpenSCAP/openscap/pull/1412

Comment 8 errata-xmlrpc 2020-03-31 20:11:09 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, 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-2020:1183


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