mitre / inspec_tools

A command-line and ruby API of utilities, converters and tools for creating, converting and processing security baseline formats, results and data
https://inspec-tools.mitre.org/
Other
91 stars 30 forks source link

Create a generic JSON import method for InSpec JSONs. #165

Closed rbclark closed 2 years ago

rbclark commented 4 years ago

Currently we parse the InSpec JSON differently depending on if we are generating a XCCDF output

https://github.com/mitre/inspec_tools/blob/bd2c1adb6618c5324871d798d1b4b36765c2d892/lib/utilities/inspec_util.rb#L49-L54

or a CKL output

https://github.com/mitre/inspec_tools/blob/bd2c1adb6618c5324871d798d1b4b36765c2d892/lib/utilities/inspec_util.rb#L88-L93

Instead of ingesting our data differently depending on the output, we should instead parse the inspec JSON in a single manner and then map it to an internal class that we create, and create helper output methods on that object type. This will mean that changes to the Inspec JSON schema will only have to be updated in 1 place, and methods like summary will no longer break if an output format changes (see #164)

camdenmoors commented 2 years ago

This is now part of hdf-converters and uses the base converter