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

xccdf2inspec fails on OpenSCAP xccdf results with undefined method #190

Closed cawwot closed 4 years ago

cawwot commented 4 years ago

When trying to convert an OpenSCAP .xml xccdf file to InSpec format, ruby throws an undefined method error. Not sure how to diagnose, except to say that the xml is valid.


        10: from /usr/local/bin/inspec_tools:23:in `<main>'
         9: from /usr/local/bin/inspec_tools:23:in `load'
         8: from /var/lib/gems/2.5.0/gems/inspec_tools-2.0.3/exe/inspec_tools:14:in `<top (required)>'
         7: from /var/lib/gems/2.5.0/gems/inspec-core-4.19.0/lib/inspec/base_cli.rb:35:in `start'
         6: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
         5: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         4: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         3: from /var/lib/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         2: from /var/lib/gems/2.5.0/gems/inspec_tools-2.0.3/lib/inspec_tools/plugin_cli.rb:42:in `xccdf2inspec'
         1: from /var/lib/gems/2.5.0/gems/inspec_tools-2.0.3/lib/inspec_tools/xccdf.rb:35:in `to_inspec'
/var/lib/gems/2.5.0/gems/inspec_tools-2.0.3/lib/inspec_tools/xccdf.rb:114:in `insert_json_metadata': undefined method `plaintext' for nil:NilClass (NoMethodError)```
rx294 commented 4 years ago

Hey @cawwot the xccdf2inspec is to convert STIG XCCDF xml files; the file you are able to open on a STIGViewer.

Its is not designed to work for OpenSCAP xmls.

cawwot commented 4 years ago

@rx294 Ah, that explains it. Looking closer at the docs i guess it does say that... Thanks Rony