From 97958796283ab1cee61ec17af0045bc8b84c788b Mon Sep 17 00:00:00 2001 From: "Jeremy J. Miller" Date: Sun, 15 May 2016 07:22:18 -0400 Subject: [PATCH] add sudo_command option --- README.md | 2 +- docs/ctl_inspec.rst | 3 +++ lib/utils/base_cli.rb | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 748334c47..52400cdb9 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ inspec exec test.rb -t winrm://Administrator@windowshost --password 'your-passwo inspec exec test.rb -t docker://container_id # run with sudo -inspec exec test.rb --sudo [--sudo-password ...] [--sudo-options ...] +inspec exec test.rb --sudo [--sudo-password ...] [--sudo-options ...] [--sudo_command ...] ``` ### detect diff --git a/docs/ctl_inspec.rst b/docs/ctl_inspec.rst index 5a3bf0485..cc01ad909 100644 --- a/docs/ctl_inspec.rst +++ b/docs/ctl_inspec.rst @@ -41,6 +41,9 @@ The following options may be used with any of the InSpec CLI subcommands: ``--sudo_password`` The sudo password, if required. +``--sudo_command`` + Altnerate sudo command, if required. + ``-t``, ``--target`` The URI for the target of a remote scan, preceded by the target's backend. For example: ``backend://user:pass@host:port``, where ``backend`` is one of ``docker``, ``local``, ``ssh``, or ``winrm``. diff --git a/lib/utils/base_cli.rb b/lib/utils/base_cli.rb index d776356f1..0bbafe72c 100644 --- a/lib/utils/base_cli.rb +++ b/lib/utils/base_cli.rb @@ -29,6 +29,8 @@ module Inspec desc: 'Specify a sudo password, if it is required.' option :sudo_options, type: :string, desc: 'Additional sudo options for a remote scan.' + option :sudo_command, type: :string, + desc: 'Altnerate command for sudo.' option :ssl, type: :boolean, desc: 'Use SSL for transport layer encryption (WinRM).' option :self_signed, type: :boolean,