dev-sec / cis-docker-benchmark

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

method_missing: undefined local variable or method docker #50

Closed mmukherjee closed 6 years ago

mmukherjee commented 6 years ago

Hello,

Trying this on my local mac machine. Getting this error straightaway. Am I doing something wrong here?

$ inspec version
1.4.1
$ inspec exec cis-docker-benchmark
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/rspec-expectations-3.5.0/lib/rspec/matchers.rb:967:in `method_missing': undefined local variable or method `docker' for #<#<Class:0x007f8f9cc284d0>:0x007f8f9a00b438> (NameError)
        from cis-docker-benchmark/controls/docker_daemon_configuration.rb:387:in `block in load_with_context'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/rule.rb:51:in `instance_eval'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/rule.rb:51:in `initialize'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/control_eval_context.rb:73:in `new'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/control_eval_context.rb:73:in `block (2 levels) in create'
        from cis-docker-benchmark/controls/docker_daemon_configuration.rb:374:in `load_with_context'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile_context.rb:146:in `instance_eval'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile_context.rb:146:in `load_with_context'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile_context.rb:130:in `load_control_file'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile.rb:114:in `block in collect_tests'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile.rb:111:in `each'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/profile.rb:111:in `collect_tests'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/runner.rb:85:in `block in load'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/runner.rb:79:in `each'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/runner.rb:79:in `load'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/runner.rb:95:in `run'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/base_cli.rb:84:in `run_tests'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/lib/inspec/cli.rb:164:in `exec'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/inspec-1.4.1/bin/inspec:12:in `<top (required)>'
        from /usr/local/bin/inspec:50:in `load'
        from /usr/local/bin/inspec:50:in `<main>'
mmukherjee commented 6 years ago

I guess I was with an older version of inspec. Updated it and now this error goes away, but another one shows up. Let me create a new ticket for that one.