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 1970529 - oscap complains about missing resources even though they were downloaded locally
Summary: oscap complains about missing resources even though they were downloaded locally
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: openscap
Version: 8.4
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jan Černý
QA Contact: Matus Marhefka
Jan Fiala
URL:
Whiteboard:
: 2027259 (view as bug list)
Depends On:
Blocks: 2015518 2015802 2030226 2030596
TreeView+ depends on / blocked
 
Reported: 2021-06-10 16:12 UTC by Renaud Métrich
Modified: 2024-12-20 20:13 UTC (History)
8 users (show)

Fixed In Version: openscap-1.3.5-10.el8
Doc Type: Enhancement
Doc Text:
.OpenSCAP can read local files OpenSCAP can now consume local files instead of remote SCAP source data stream components. Previously, you could not perform a complete evaluation of SCAP source data streams containing remote components on systems that have no internet access. On these systems, OpenSCAP could not evaluate some of the rules in these data streams because the remote components needed to be downloaded from the internet. With this update, you can download and copy the remote SCAP source data stream components to the target system before performing the OpenSCAP scan and provide them to OpenSCAP by using the `--local-files` option with the `oscap` command.
Clone Of:
: 2015518 (view as bug list)
Environment:
Last Closed: 2022-05-10 13:50:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:1844 0 None None None 2022-05-10 13:50:24 UTC

Internal Links: 1722003

Description Renaud Métrich 2021-06-10 16:12:16 UTC
This bug was initially created as a copy of Bug #1970527

I am copying this bug because: 

Also applies, the difference being it doesn't complain bout using the local file anymore, but still the first warning is confusing:


With no local file:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml' points out to the remote 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml' file which is referenced from datastream
WARNING: Skipping ./security-data-oval-com.redhat.rhsa-RHEL8.xml file which is referenced from XCCDF content
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

With local file:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
WARNING: Datastream component 'scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml' points out to the remote 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml'. Use '--fetch-remote-resources' option to download it.
WARNING: Skipping 'https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml' file which is referenced from datastream
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Description of problem:

When scanning offline systems, the resources have to be downloaded locally (explained in KCS https://access.redhat.com/solutions/5185891).
Unfortunately the scan continues to complain badly with the "WARNING: Skipping ..." messages, which is extremely confusing (hence the Severity High here).

I understand a message should pop up because there is no way to know the validity of the file, but the message should be different, something like "WARNING: Using local resource XXX.xml file, make sure the file is up-to-date".


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

openscap-1.2.17-13.el7_9.x86_64 and later


How reproducible:

N/A

Comment 1 Jan Černý 2021-07-29 06:49:01 UTC
The fix has been promoted to a documented feature and it has been merged into upstrem, see https://github.com/OpenSCAP/openscap/pull/1769

Comment 2 Jan Černý 2021-08-05 10:41:14 UTC
Note for person who will fix the bug in RHEL: Please don't forget about https://github.com/OpenSCAP/openscap/pull/1786

Comment 3 Jan Černý 2021-08-05 11:24:34 UTC
I'm changing priority and severity to low because I think it's an user experience problem and it doesn't mean that the user isn't able to run the scan.

Comment 4 Paulo Andrade 2021-09-21 16:00:04 UTC
  Even after downloading the remote files, because openscap cannot
know if the files are up to date, the warning is still printed.

  There is a problem with ansible, because the messages are still
printed to stderr, and it treats it as an error. Workaround is to
use ansible with 'ignore_errors: true' what does not look ideal.

  Might need to clone and reassign this bug to use alternate options
https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html

Comment 6 Matus Marhefka 2021-10-26 15:51:56 UTC
@jcerny: What about updating https://github.com/OpenSCAP/openscap/blob/maint-1.3/src/DS/sds.c#L410 to not print only in the verbose mode, but rather print it as a warning to the user?

Comment 7 Jan Černý 2021-11-09 08:23:59 UTC
Ad Comment 6: https://github.com/OpenSCAP/openscap/pull/1826

Comment 15 Jan Černý 2021-11-29 10:24:06 UTC
*** Bug 2027259 has been marked as a duplicate of this bug. ***

Comment 23 errata-xmlrpc 2022-05-10 13:50: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 (openscap bug fix and enhancement update), 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:1844


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