openscap icon indicating copy to clipboard operation
openscap copied to clipboard

Oscap reports (JSON)

Open olgadodin opened this issue 5 years ago • 5 comments

Hi, just a question - are there any plans to have an option to convert oscap xml report to json format?

olgadodin avatar Jul 02 '20 08:07 olgadodin

Yes, there are plans for this. Can't say anything about time-line here, but the feature in the "active" part of the backlog (not tracked in GH, tho).

Any particular details you are expecting from it (structure, schema etc)?

evgenyz avatar Jul 02 '20 08:07 evgenyz

Also it would be interesting to know where you're going to integrate the scanner in such a manner. Would it be possible for you to give us some information?

evgenyz avatar Jul 02 '20 08:07 evgenyz

We would be interested easily extract to json output information related to a specific benchmark results, like Rule ID, Result, Time, Severity, Identifiers, Description, Rationale - whatever we can view from HTML report while following the link for specific result details. Having this info in json format we can pass it to a dashboard where we have a status for all systems in organization in a single view. For a specific system details we can refer from this dashboard to HTML report collected from this system. We have Ansible automation in place to run OpenScap scanning on our inventory and collect reports. But oscap standard output lack of information we need. Parsing XML results or HTML report files to extract all required values looks challenging. Any advice on how to find information above in XML/HTML files generated by oacap command is appreciated.

olgadodin avatar Jul 02 '20 09:07 olgadodin

You could create your own json files. I suggest looking into using xmlstarlet, htmltotext, and jq. A mix of bash and python were used in my workplace but it could be done purely in one language. We consolidated all the results into a single summary report to make easier for reporting. There were other things created but that was the most useful thing we did.

WSLUser avatar Jul 21 '20 15:07 WSLUser

I did, for the information I need in json Ansible regex worked finally good enough.

olgadodin avatar Jul 22 '20 06:07 olgadodin

why was that closed? was this functionality added?

dparv avatar Mar 18 '24 08:03 dparv

why was that closed? was this functionality added?

It was added to https://github.com/OpenSCAP/openscap-report. Most likely it won't be added to openscap. We've closed stale issues.

evgenyz avatar Mar 18 '24 08:03 evgenyz