Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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
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
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