dev-sec / cis-docker-benchmark

CIS Docker Benchmark - InSpec Profile
https://dev-sec.io/baselines/docker/
Apache License 2.0
488 stars 114 forks source link

load_with_context': undefined method `each' for nil:NilClass (NoMethodError) exception in cis-docker-benchmark-master/controls/container_runtime.rb:194 #37

Closed nandeshguru closed 7 years ago

nandeshguru commented 7 years ago

load_with_context': undefined method `each' for nil:NilClass (NoMethodError) exception in cis-docker-benchmark-master/controls/container_runtime.rb:194

> inspec exec https://github.com/dev-sec/cis-docker-benchmark/archive/master.zip
cis-docker-benchmark-master/controls/container_runtime.rb:194:in `block (2 levels) in load_with_context': undefined method `each' for nil:NilClass (NoMethodError)
    from cis-docker-benchmark-master/controls/container_runtime.rb:191:in `each'
    from cis-docker-benchmark-master/controls/container_runtime.rb:191:in `block in load_with_context'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/rule.rb:49:in `instance_eval'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/rule.rb:49:in `initialize'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/control_eval_context.rb:71:in `new'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/control_eval_context.rb:71:in `block (2 levels) in create'
    from cis-docker-benchmark-master/controls/container_runtime.rb:180:in `load_with_context'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile_context.rb:146:in `instance_eval'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile_context.rb:146:in `load_with_context'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile_context.rb:130:in `load_control_file'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile.rb:151:in `block in collect_tests'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile.rb:148:in `each'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/profile.rb:148:in `collect_tests'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/runner.rb:89:in `block in load'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/runner.rb:78:in `each'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/runner.rb:78:in `load'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/runner.rb:99:in `run'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/base_cli.rb:83:in `run_tests'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/lib/inspec/cli.rb:159:in `exec'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
    from /opt/cloudcoreo/inspec/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.36.1/bin/inspec:12:in `<top (required)>'
    from ./inspec:23:in `load'
    from ./inspec:23:in `<main>'
atomic111 commented 7 years ago

38 fixed it

Nowheresly commented 6 years ago

We are unfortunately still experiencing NoMethodError. PR #49 could fix the remaining issue.