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

updating check for container_info networkings port #38

Closed nandeshguru closed 7 years ago

nandeshguru commented 7 years ago

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

atomic111 commented 7 years ago

@coolguru Thank you for your PR. i think it should be like if !container_info... because i test there if the object empty. May be i am wrong?

atomic111 commented 7 years ago

@coolguru Sorry, to early for me today. you are right.

inspec> docker.object('40c6ad921df7428069626637cc2d43b8d2d9404aa440e00fd0eb37d11406e14c')['NetworkSettings']['Ports']
=> {}
inspec> docker.object('40c6ad921df7428069626637cc2d43b8d2d9404aa440e00fd0eb37d11406e14c')['NetworkSettings']['Ports'].nil?
=> false