Closed jan-cerny closed 8 years ago
The issue appears on OpenSCAP 1.2.8, but from git log I don't see if there was something done about that since 1.2.8 has been released.
It will probably cause changes in same lines as fixing r3005.
I will assign it to myself, because it seems to be related to problem I am dealing with.
Remote(http) components - (not only OVAL)
<component-ref id="scap_gov.nist_cref_r2910-oval.xml" xlink:href="http://scap.nist.gov/validation/downloads/r2910-external-oval-component.xml"/>
are required during oscap info
. We can add --fetch-remote-resources
to be in datastream session too. But what if remote component is referenced from datastream and --fetch-remote-resources is not enabled?
Warn and skip IMO.
To be transparent:
oscap info
downloading progress do mess in outputFail after skip:
WARNING: Skipping 'http://localhost:8000/validation/downloads/r2910-external-oval-component.xml' file which is referenced from datastream
OpenSCAP Error: Internal error: Could not acquire handle to xccdf.xml source. [ds_sds_session.c:216]
Mess in output: Downloading: http://localhost:8000/validation/downloads/r2910-external-oval-component.xml ... ok
$ myoscap info --fetch-remote-resources ./r2910-datastream.xml
Document type: Source Data Stream
Imported: 2016-09-19T15:27:23
Stream: scap_gov.nist_datastream_r2910-datastream
Generated: 2016-05-25T14:00:00
Version: 1.2
Checklists:
Ref-Id: scap_gov.nist_cref_r2910-oval.xml
Downloading: http://localhost:8000/validation/downloads/r2910-external-oval-component.xml ... ok Status: draft
Generated: 2016-06-27
Resolved: true
Profiles:
standard
pci-dss
C2S
rht-ccp
common
stig-rhel7-workstation-upstream
stig-rhel7-server-gui-upstream
stig-rhel7-server-upstream
ospp-rhel7-server
nist-cl-il-al
cjis-rhel7-server
I suggest to postpone fixing of the "mess bug", because we don't have many external components.
Part of changes here https://github.com/OpenSCAP/openscap/pull/531
It should be already done. Before merging I want to wait for https://github.com/OpenSCAP/openscap/pull/547 which contains related changes.
The remote resources support in datastreams is incomplete in OpenSCAP in my opinion.
I have run into this issue when examining test content from the SCAP validation test suite released by NIST. The following snippet is copy-pasted for NIST validation test suite, requirement R2910. Explanation of the problem will follow below.
XCCDF Rules in this datastream reference the OVAL check as eg.
<xccdf:check-content-ref href="r2910-oval.xml" name="oval:nist.validation.variable:def:11"/>
.However the "r2910-oval.xml" is not a local file, but it is a remote resource and it needs to be downloaded from the internet.
I will now explain how OpenSCAP should figure out that "r2910-oval.xml" is a remote resource.
<checklist>
element to find an XCCDF checklist.name="r2910-oval.xml"
maps touri="#scap_gov.nist_cref_r2910-oval.xml"
, because<cat:uri>
element says that.uri="#scap_gov.nist_cref_r2910-oval.xml"
, it should find a ds:component-ref element withid="scap_gov.nist_cref_r2910-oval.xml"
<component-ref id="scap_gov.nist_cref_r2910-oval.xml" xlink:href="http://scap.nist.gov/validation/downloads/r2910-external-oval-component.xml"/>
it should see that it needs to download some file.Please have a look to SCAP 1.2 scarification, page 16, table 9, definition of the "catalog" element. http://dx.doi.org/10.6028/NIST.SP.800-126r2