From efc7eba050cab1296d11a579c7f2fc0df9963f4b Mon Sep 17 00:00:00 2001 From: "Morley, Jonathan" Date: Fri, 30 Sep 2016 15:18:14 -0400 Subject: [PATCH] Add shell options --- README.md | 3 +++ lib/inspec/base_cli.rb | 6 ++++++ www/tutorial/app/responses/inspec_help_detect.txt | 5 ++++- www/tutorial/app/responses/inspec_help_exec.txt | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30e12caac..f740be4e4 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,9 @@ inspec exec test.rb -t docker://container_id # run with sudo inspec exec test.rb --sudo [--sudo-password ...] [--sudo-options ...] [--sudo_command ...] + +# run in a subshell +inspec exec test.rb --shell [--shell-options ...] [--shell-command ...] ``` ### detect diff --git a/lib/inspec/base_cli.rb b/lib/inspec/base_cli.rb index 69d62394d..359d020ef 100644 --- a/lib/inspec/base_cli.rb +++ b/lib/inspec/base_cli.rb @@ -32,6 +32,12 @@ module Inspec desc: 'Additional sudo options for a remote scan.' option :sudo_command, type: :string, desc: 'Alternate command for sudo.' + option :shell, type: :boolean, + desc: 'Run scans in a subshell. Only activates on Unix.' + option :shell_options, type: :string, + desc: 'Additional shell options.' + option :shell_command, type: :string, + desc: 'Specify a particular shell to use.' option :ssl, type: :boolean, desc: 'Use SSL for transport layer encryption (WinRM).' option :self_signed, type: :boolean, diff --git a/www/tutorial/app/responses/inspec_help_detect.txt b/www/tutorial/app/responses/inspec_help_detect.txt index 8c29b7bab..cff4c07d4 100644 --- a/www/tutorial/app/responses/inspec_help_detect.txt +++ b/www/tutorial/app/responses/inspec_help_detect.txt @@ -14,11 +14,14 @@ Options: [--sudo-password=SUDO_PASSWORD] # Specify a sudo password, if it is required. [--sudo-options=SUDO_OPTIONS] # Additional sudo options for a remote scan. [--sudo-command=SUDO_COMMAND] # Alternate command for sudo. + [--shell], [--no-shell] # Run scans in a subshell. Only activates on Unix. + [--shell-options=SHELL_OPTIONS] # Additional shell options. + [--shell-command=SHELL_COMMAND] # Specify a particular shell to use. [--ssl], [--no-ssl] # Use SSL for transport layer encryption (WinRM). [--self-signed], [--no-self-signed] # Allow remote scans with self-signed certificates (WinRM). [--json-config=JSON_CONFIG] # Read configuration from JSON file (`-` reads from stdin). l, [--log-level=LOG_LEVEL] # Set the log level: info (default), debug, warn, error - [--format=FORMAT] + [--format=FORMAT] l, [--log-level=LOG_LEVEL] # Set the log level: info (default), debug, warn, error [--log-location=LOG_LOCATION] # Location to send diagnostic log messages to. (default: STDOUT or STDERR) [--diagnose], [--no-diagnose] # Show diagnostics (versions, configurations) diff --git a/www/tutorial/app/responses/inspec_help_exec.txt b/www/tutorial/app/responses/inspec_help_exec.txt index c650b7635..3d25073cb 100644 --- a/www/tutorial/app/responses/inspec_help_exec.txt +++ b/www/tutorial/app/responses/inspec_help_exec.txt @@ -14,6 +14,9 @@ Options: [--sudo-password=SUDO_PASSWORD] # Specify a sudo password, if it is required. [--sudo-options=SUDO_OPTIONS] # Additional sudo options for a remote scan. [--sudo-command=SUDO_COMMAND] # Alternate command for sudo. + [--shell], [--no-shell] # Run scans in a subshell. Only activates on Unix. + [--shell-options=SHELL_OPTIONS] # Additional shell options. + [--shell-command=SHELL_COMMAND] # Specify a particular shell to use. [--ssl], [--no-ssl] # Use SSL for transport layer encryption (WinRM). [--self-signed], [--no-self-signed] # Allow remote scans with self-signed certificates (WinRM). [--json-config=JSON_CONFIG] # Read configuration from JSON file (`-` reads from stdin).