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
92 stars 30 forks source link

inspec2ckl does not read the --metadata as JSON #212

Closed b-mad closed 3 years ago

b-mad commented 3 years ago

Within PluginCLI, the read of the metadata file does not convert from JSON to a Hash. As a result all conversion downstream are not able to properly set attributes in the generated checklist when executing inspec2ckl --metadata file

Note the implementation here:

https://github.com/mitre/inspec_tools/blob/2862786fedefec4d488106bba8a9b580b95c74a6/lib/inspec_tools/plugin_cli.rb#L120-L125

TMVUONG-HI commented 2 years ago

Sorry about asking a beginner's (Inspec/Ruby) question here because I don't where to pose it - how do I set up Inspec_Tools on a Windows machine (running inspec-4.50.3.1-x64 and rubyinstaller-3.0.3-1-x64.exe)? I have recently started to use a Powershell script, but can't seem to get the call to inspec_tools command to work.

        $cklCommand = {inspec_tools inspec2ckl -j $reportFile -o $cklFile}
        Invoke-Command -ScriptBlock $cklCommand