mitre / aws-foundations-cis-baseline

InSpec profile to validate your VPC to the standards of the CIS Amazon Web Services Foundations Benchmark
Other
77 stars 30 forks source link

no implicit conversion of Symbol into String #36

Closed JoshuaSeidel closed 3 years ago

JoshuaSeidel commented 4 years ago

Using Inspec 4.19 on MacOS 10.15 When running

inspec exec . --input-file=attributes.yml -t aws://

i get

Traceback (most recent call last): 27: from /usr/local/bin/inspec:210:in

' 26: from /usr/local/bin/inspec:210:in load' 25: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-bin-4.19.0/bin/inspec:11:in<top (required)>' 24: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/base_cli.rb:35:in start' 23: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:instart' 22: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 21: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:ininvoke_command' 20: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 19: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/cli.rb:279:inexec' 18: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:129:in run' 17: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:122:inload' 16: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:122:in each' 15: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:123:inblock in load' 14: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:283:in register_rule' 13: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:283:inflat_map' 12: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:283:in each' 11: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:284:inblock in register_rule' 10: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:276:in get_check_example' 9: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:316:inadd_resource' 8: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:316:in map' 7: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner.rb:317:inblock in add_resource' 6: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-core-4.19.0/lib/inspec/runner_rspec.rb:28:in example_group' 5: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:271:inblock in define_example_group_method' 4: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:397:in subclass' 3: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:442:inset_it_up' 2: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:838:in assign_const' 1: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:861:inbase_name_for' /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/rspec-core-3.9.2/lib/rspec/core/example_group.rb:861:in +': no implicit conversion of Symbol into String (TypeError)

JoshuaSeidel commented 4 years ago

Problem seems to be associated to these peices of various files

trail_log_group_name = aws_cloudtrail_trail(trail).cloud_watch_logs_log_group_arn.scan(/log-group:(.+):/).last.first unless aws_cloudtrail_trail(trail).cloud_watch_logs_log_group_arn.nil?

JoshuaSeidel commented 4 years ago

@rx294 Can you take a look?

aaronlippold commented 4 years ago

@rx294 can you take a look. Thanks.

rx294 commented 4 years ago

Hey @JoshuaSeidel, thanks for the report we are working on the issue. I was unable to reproduce the issue on my side, tried matching you Inpec and ruby version.

We a customer facing a similar issue. Will try to diagnose on their machine.

Meanwhile plz try to update ur inspec version and see if the issue goes away.

karikarshivani commented 3 years ago

Resolved