diff --git a/README.md b/README.md index e5dec18..9f9c1e5 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,16 @@ verifier: You can also decide to only run specific controls, instead of a full profile. This is done by specifying a list of controls: ``` -verifier: - name: inspec - controls: - - control-id1 - - control-id4 +suites: + - name: supermarket + run_list: + - recipe[apt] + - recipe[ssh-hardening] + verifier: + inspec_tests: + - name: dev-sec/ssh-baseline + controls: + - sshd-46 ... ``` diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index 3eb2ce2..82cb5f4 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -186,7 +186,7 @@ def runner_options(transport, state = {}, platform = nil, suite = nil) # rubocop runner_options["format"] = config[:format] unless config[:format].nil? runner_options["output"] = config[:output] % { platform: platform, suite: suite } unless config[:output].nil? runner_options["profiles_path"] = config[:profiles_path] unless config[:profiles_path].nil? - runner_options["controls"] = config[:controls] + runner_options[:controls] = config[:controls] end end diff --git a/spec/kitchen/verifier/inspec_spec.rb b/spec/kitchen/verifier/inspec_spec.rb index 94d7a18..3b97b4c 100644 --- a/spec/kitchen/verifier/inspec_spec.rb +++ b/spec/kitchen/verifier/inspec_spec.rb @@ -209,7 +209,7 @@ expect(Inspec::Runner).to receive(:new) .with( hash_including( - "controls" => %w{a control} + controls: %w{a control} ) ) .and_return(runner)