Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspec2xccdf errors when cci tag is not an array #237

Closed
rlakey opened this issue Jul 19, 2021 · 1 comment
Closed

inspec2xccdf errors when cci tag is not an array #237

rlakey opened this issue Jul 19, 2021 · 1 comment

Comments

@rlakey
Copy link

rlakey commented Jul 19, 2021

Scenario
A profile created with csv2inspec does not create the cci tag as an array so then taking the same profile and using inspec2xccdf results in the following errors:

Traceback (most recent call last):
14: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/bin/inspec_tools:23:in <main>' 13: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/bin/inspec_tools:23:in load'
12: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/exe/inspec_tools:14:in <top (required)>' 11: from C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/inspec-core-4.26.13/lib/inspec/base_cli.rb:35:in start'
10: from C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/base.rb:485:in start' 9: from C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in dispatch'
8: from C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command' 7: from C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in run'
6: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/inspec_tools/plugin_cli.rb:69:in inspec2xccdf' 5: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/inspec_tools/inspec.rb:44:in to_xccdf'
4: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/utilities/xccdf/to_xccdf.rb:18:in to_xml' 3: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/utilities/xccdf/to_xccdf.rb:58:in build_groups'
2: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/utilities/xccdf/to_xccdf.rb:58:in each' 1: from C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/utilities/xccdf/to_xccdf.rb:76:in block in build_groups'
C:/Users/rlakey/AppData/Local/chefdk/gem/ruby/2.7.0/gems/inspec_tools-2.3.7/lib/utilities/xccdf/to_xccdf.rb:126:in `build_rule_idents': CCI-000044 is not an Array type. (RuntimeError)

A profile created from xccdf2inspec does have the cci tag as an array when using an officially published STIG xccdf file.

@Bialogs
Copy link
Contributor

Bialogs commented Aug 9, 2021

This was just fixed with #241 by performing type checking on the CCI field before it gets written to inspec.

@Bialogs Bialogs closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants