Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspec fails to run due to undefined method 'passwords' #5

Closed
michael-c-hoffman opened this issue Mar 12, 2018 · 1 comment
Closed

Comments

@michael-c-hoffman
Copy link

Even if i try to wrapp the inspec profile and skip_control all that utilize passwords it still fails.
Changing all instances of passwords to password and ensuring '&' is changed to '&&' resolves the issue.

os: centos7.4
rpm -q inspec
inspec-2.0.45-1.el7.x86_64

inspec exec cis-dil-benchmark
cis-dil-benchmark/controls/5_4_user_accounts_and_environments.rb:40:in block (3 levels) in load_with_context': undefined method passwords' for #<#Class:0x00000000043159a8:0x000000000432c1d0> (NoMethodError)
from cis-dil-benchmark-master/controls/5_4_user_accounts_and_environments.rb:39:in each' from cis-dil-benchmark-master/controls/5_4_user_accounts_and_environments.rb:39:in block (2 levels) in load_with_context'
from cis-dil-benchmark-master/controls/5_4_user_accounts_and_environments.rb:38:in each' from cis-dil-benchmark-master/controls/5_4_user_accounts_and_environments.rb:38:in block in load_with_context'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/rule.rb:50:in instance_eval' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/rule.rb:50:in initialize'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/control_eval_context.rb:75:in new' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/control_eval_context.rb:75:in block (2 levels) in create'
from cis-dil-benchmark-master/controls/5_4_user_accounts_and_environments.rb:26:in load_with_context' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile_context.rb:157:in instance_eval'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile_context.rb:157:in load_with_context' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile_context.rb:141:in load_control_file'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile.rb:167:in block in collect_tests' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile.rb:164:in each'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile.rb:164:in collect_tests' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/dependencies/dependency_set.rb:65:in block in each'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/dependencies/dependency_set.rb:64:in each' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/dependencies/dependency_set.rb:64:in each'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/profile.rb:162:in collect_tests' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/runner.rb:93:in block in load'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/runner.rb:82:in each' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/runner.rb:82:in load'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/runner.rb:103:in run' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/lib/inspec/cli.rb:168:in exec'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start'
from /opt/inspec/embedded/lib/ruby/gems/2.4.0/gems/inspec-2.0.45/bin/inspec:12:in <top (required)>' from /usr/bin/inspec:72:in load'
from /usr/bin/inspec:72:in `

'

@chris-rock
Copy link
Member

Fixed by #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants