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 1258958 - openscap-1.0.* does not seem to be able to produce the HTML report when evaluating OVAL document directly
Summary: openscap-1.0.* does not seem to be able to produce the HTML report when evalu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openscap
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Šimon Lukašík
QA Contact: Marek Haicman
URL:
Whiteboard:
Depends On:
Blocks: 1303680
TreeView+ depends on / blocked
 
Reported: 2015-09-01 15:27 UTC by Jan Lieskovsky
Modified: 2016-05-10 20:53 UTC (History)
2 users (show)

Fixed In Version: openscap-1.2.7-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1303680 (view as bug list)
Environment:
Last Closed: 2016-05-10 20:53:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:0806 0 normal SHIPPED_LIVE openscap bug fix and enhancement update 2016-05-10 22:38:33 UTC

Description Jan Lieskovsky 2015-09-01 15:27:19 UTC
Description of problem:

From the oscap(8) manual page:
"..
OVAL OPERATIONS
       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
                     File.

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

              --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.

              --skip-valid
                     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):
openscap-1.0.10-3.el6.x86_64


How reproducible:
Always

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
openscap-1.0.10-3.el6.x86_64
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 $?
0
[root@localhost ~]# oscap oval generate report /tmp/results.xml > /tmp/report.html
[root@localhost ~]# echo $?
0
[root@localhost ~]# file /tmp/report.html 
/tmp/report.html: xHTML document text

Comment 1 Šimon Lukašík 2015-09-02 08:09:47 UTC
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 17:01:07 UTC
Verified fix in version openscap-1.2.8-1.el6

Comment 5 errata-xmlrpc 2016-05-10 20:53:26 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://rhn.redhat.com/errata/RHEA-2016-0806.html


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