Bug 1258958 - openscap-1.0.* does not seem to be able to produce the HTML report when evaluating OVAL document directly
openscap-1.0.* does not seem to be able to produce the HTML report when evalu...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openscap (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Šimon Lukašík
Marek Haicman
Depends On:
Blocks: 1303680
  Show dependency treegraph
Reported: 2015-09-01 11:27 EDT by Jan Lieskovsky
Modified: 2016-05-10 16:53 EDT (History)
2 users (show)

See Also:
Fixed In Version: openscap-1.2.7-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1303680 (view as bug list)
Last Closed: 2016-05-10 16:53:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Lieskovsky 2015-09-01 11:27:19 EDT
Description of problem:

From the oscap(8) manual page:
       eval [options] INPUT_FILE
              Probe the system and evaluate all definitions from OVAL 
              Definition file. Print result of each definition to standard
              output. The  return code is 0 after a  successful evaluation.
              On error, value 1 is returned.

              INPUT_FILE can be either OVAL Definition File or SCAP Source
              Datastream, it depends on used options.

              Unless  --skip-valid  is  used, the INPUT_FILE is validated
              using XSD schemas (depending on document type of INPUT_FILE)
              and rejected if invalid.

              --id DEFINITION-ID
                     Evaluate ONLY specified OVAL Definition from OVAL
                     Definition File.

              --variables FILE
                     Provide external variables expected by OVAL Definition

              --directives FILE
                     Use OVAL Directives content to specify desired results

              --results FILE
                     Write OVAL Results into file.

              --report FILE
                     Create human readable (HTML) report from OVAL Results.

              --datastream-id ID
                     Uses a datastream with that particular ID from the given
                     datastream collection. If not given the first datastream
                     is used.  Only applies if you give source datastream in
                     place of an OVAL file.

              --oval-id ID
                     Takes  component ref with given ID from checks. This
                     allows to select a particular OVAL component even in
                     cases where there are 2 OVALs in one datastream.

                     Do not validate input/output files.

The above description suggests running oscap command like the following:

  oscap oval eval --report /tmp/report.html input_oval.xml

should generate HTML report document of the OVAL scan located in the /tmp directory.

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

How reproducible:

Steps to Reproduce:
1. [root@localhost ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.7 (Santiago)
2. [root@localhost ~]# rpm -q openscap
3. [root@localhost ~]# wget -q https://www.redhat.com/security/data/oval/Red_Hat_Enterprise_Linux_6.xml
4. [root@localhost ~]# oscap oval eval --report /tmp/report.html Red_Hat_Enterprise_Linux_6.xml 
Definition oval:com.redhat.rhsa:def:20151700: false
Evaluation done.
[root@localhost ~]# 

Actual results:
HTML report of the OVAL scan is not created when requested just HTML file without intermediate XML results file:

[root@localhost ~]# file /tmp/report.html
/tmp/report.html: cannot open `/tmp/report.html' (No such file or directory)

Expected results:
HTML report file of the OVAL system scan file created also without specifying the intermediary XML results file.

Or manual page is updated to reflect this situation (that XML file with OVAL results need to be created first, and OVAL HTML report file can be created only subsequently from the results file).

Additional info:

Creating OVAL HTML report file from intermediary XML results file works fine:

[root@localhost ~]# oscap oval eval --results /tmp/results.xml Red_Hat_Enterprise_Linux_6.xml > /dev/null
[root@localhost ~]# echo $?
[root@localhost ~]# oscap oval generate report /tmp/results.xml > /tmp/report.html
[root@localhost ~]# echo $?
[root@localhost ~]# file /tmp/report.html 
/tmp/report.html: xHTML document text
Comment 1 Šimon Lukašík 2015-09-02 04:09:47 EDT
Thanks for report.

 - Not a regression.
 - Easy workaround: (use `--results /tmp/testresult.xccdf.xml` )
 - Recently fixed in upstream at https://github.com/OpenSCAP/openscap/commit/42895cc157905036b0c7e11772fa9e9cbabb3f30

Will not be fixed in 1.0.x line. Will be fixed if the rebase bug 1259037 gets approved.
Comment 3 Marek Haicman 2016-02-01 12:01:07 EST
Verified fix in version openscap-1.2.8-1.el6
Comment 5 errata-xmlrpc 2016-05-10 16:53:26 EDT
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.


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