Closed rcolanero closed 2 years ago
Hello, I'm in the middle of teaching class right now but my thought is that this might be a tag issue inside the XCCDF file. I had a similar issue while I was parsing the j boss stig. In the options you can list extra tags that might be inside the XML file that are causing parsnips. Try passing plaintext to see if letting the person know that this is a tag it doesn't have to worry about fixes the issue. If it persists please update the comment and will look into it a bit deeper.
On Thu, Sep 5, 2019, 12:36 PM Raymond Colanero notifications@github.com wrote:
Getting an error similar to #63 https://github.com/mitre/inspec_tools/issues/63 but instead of 'version' I'm seeing it for 'plaintext'.
inspec_tools xccdf2inspec -x CIS_Microsoft_Windows_server_2016_RTM_Release_1607_Benchmark_v1.1.0-xccdf.xml -o Windows_2016_v1.1.0
Traceback (most recent call last): 10: from /home/rcolanero/.gems/bin/inspec_tools:23:in
<main>' 9: from /home/rcolanero/.gems/bin/inspec_tools:23:in
load' 8: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/exe/inspec_tools:14:in<top (required)>' 7: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/base.rb:466:in
start' 6: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/command.rb:46:indispatch' 5: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor.rb:387:in
dispatch' 4: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/invocation.rb:126:ininvoke_command' 3: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/command.rb:27:in
run' 2: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/cli.rb:21:inxccdf2inspec' 1: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:36:in
to_inspec' /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:115:ininsert_json_metadata': undefined method
plaintext' for nil:NilClass (NoMethodError)Clean Ubuntu 16.04 tst machine, ruby 2.5.6p201 (2019-08-28 revision 67796) [x86_64-linux] gem list | grep inspec
inspec (4.16.0) inspec_tools (1.4.2)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitre/inspec_tools/issues/71?email_source=notifications&email_token=AALK42CVICO24U24EG5SNS3QIEYSJA5CNFSM4IUAAUH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJS4ZMA, or mute the thread https://github.com/notifications/unsubscribe-auth/AALK42G656WSRIGLN25AUMDQIEYSJANCNFSM4IUAAUHQ .
@kevin-j-smith can you reproduce this as well on your side?
hi just to confirm that I encounter the exact same behaviour on a different XCCDF result file. ~/work/ruby-inspec$ gem list | grep inspec inspec (4.18.51) inspec_tools (1.4.2)
~/work/ruby-inspec$ inspec_tools xccdf2inspec -x 20200202-green100-stig.xml -a attributes.yml -o profile -s false -a attributes.yml
Traceback (most recent call last):
10: from /home/seb/work/./ruby-inspec/bin/inspec_tools:23:in <main>' 9: from /home/seb/work/./ruby-inspec/bin/inspec_tools:23:in
load'
8: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/exe/inspec_tools:14:in <top (required)>' 7: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/base.rb:466:in
start'
6: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/command.rb:46:in dispatch' 5: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor.rb:387:in
dispatch'
4: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 3: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/command.rb:27:in
run'
2: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/cli.rb:21:in xccdf2inspec' 1: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:36:in
to_inspec'
/home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:115:in insert_json_metadata': undefined method
plaintext' for nil:NilClass (NoMethodError)
when using replace-tags option I fail as follow:
~/work/ruby-inspec$ inspec_tools xccdf2inspec -x 20200202-green100-stig.xml -a attributes.yml -o profile -s false -a attributes.yml --replace-tags=plaintext
Traceback (most recent call last):
11: from /home/seb/work/./ruby-inspec/bin/inspec_tools:23:in <main>' 10: from /home/seb/work/./ruby-inspec/bin/inspec_tools:23:in
load'
9: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/exe/inspec_tools:14:in <top (required)>' 8: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/base.rb:466:in
start'
7: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/command.rb:46:in dispatch' 6: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor.rb:387:in
dispatch'
5: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' 4: from /home/seb/work/ruby-inspec/rubygems/gems/thor-0.20.3/lib/thor/command.rb:27:in
run'
3: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/cli.rb:20:in xccdf2inspec' 2: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/cli.rb:20:in
new'
1: from /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:18:in initialize' /home/seb/work/ruby-inspec/rubygems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:94:in
replace_tags_in_xccdf': undefined method `each' for "plaintext":String (NoMethodError)
tx
Hi. In a little hacking on the code base right now so we'll see if we can roll this into our work
Raymond, can you also send us those input files via email so we can examine them a little more closely in the test bed. I think it might actually be a schema issue but I'd like to have a couple of the CIS xccdf files as reference
On Thu, Sep 5, 2019, 12:36 PM Raymond Colanero notifications@github.com wrote:
Getting an error similar to #63 https://github.com/mitre/inspec_tools/issues/63 but instead of 'version' I'm seeing it for 'plaintext'.
inspec_tools xccdf2inspec -x CIS_Microsoft_Windows_server_2016_RTM_Release_1607_Benchmark_v1.1.0-xccdf.xml -o Windows_2016_v1.1.0
Traceback (most recent call last): 10: from /home/rcolanero/.gems/bin/inspec_tools:23:in
<main>' 9: from /home/rcolanero/.gems/bin/inspec_tools:23:in
load' 8: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/exe/inspec_tools:14:in<top (required)>' 7: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/base.rb:466:in
start' 6: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/command.rb:46:indispatch' 5: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor.rb:387:in
dispatch' 4: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/invocation.rb:126:ininvoke_command' 3: from /home/rcolanero/.gems/gems/thor-0.20.3/lib/thor/command.rb:27:in
run' 2: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/cli.rb:21:inxccdf2inspec' 1: from /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:36:in
to_inspec' /home/rcolanero/.gems/gems/inspec_tools-1.4.2/lib/inspec_tools/xccdf.rb:115:ininsert_json_metadata': undefined method
plaintext' for nil:NilClass (NoMethodError)Clean Ubuntu 16.04 tst machine, ruby 2.5.6p201 (2019-08-28 revision 67796) [x86_64-linux] gem list | grep inspec
inspec (4.16.0) inspec_tools (1.4.2)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitre/inspec_tools/issues/71?email_source=notifications&email_token=AALK42CVICO24U24EG5SNS3QIEYSJA5CNFSM4IUAAUH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HJS4ZMA, or mute the thread https://github.com/notifications/unsubscribe-auth/AALK42G656WSRIGLN25AUMDQIEYSJANCNFSM4IUAAUHQ .
Hello all,
We do not have HappyMapper classes for the CIS xccdf schema, only STIG.
If you can attach the CIS XCCDF File that you are trying to convert we can add the required mapping.
@Bialogs does #246 also cover this issue with metadata or is it a conneted issue?
If this is still a concern please try this under the new SAF CLI
Getting an error similar to #63 but instead of 'version' I'm seeing it for 'plaintext'.
inspec_tools xccdf2inspec -x CIS_Microsoft_Windows_server_2016_RTM_Release_1607_Benchmark_v1.1.0-xccdf.xml -o Windows_2016_v1.1.0
Clean Ubuntu 16.04 tst machine, ruby 2.5.6p201 (2019-08-28 revision 67796) [x86_64-linux]
gem list | grep inspec