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

add sudo_command option #754

Merged
merged 2 commits into from
May 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/ctl_inspec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Alternate 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``.

Expand Down
2 changes: 2 additions & 0 deletions lib/utils/base_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def self.target_options
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: 'Alternate command for sudo.'
option :ssl, type: :boolean,
desc: 'Use SSL for transport layer encryption (WinRM).'
option :self_signed, type: :boolean,
Expand Down