sudo-detection for target execution #1870
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
inspec exec
without thetarget
option but against remote endpoints OR when executing it with thelocalhost://
target AND having--sudo
active it would abort the execution.--target
is a helper to set the Train parameters forbackend
,host
,user
,port
, and potentiallypassword
. The detection would fail on providing any of these separately without specifying--target
. The same holds true for thelocalhost
train backend or justlocalhost://
target.This type of detection has since moved to Train. The driving reason was to have this very useful check for localhost vs sudo run for any type of inspec (or for that matter: train) execution.
This PR depends on inspec/train#179 and the next release of train.
Strongly influenced by the original bugfix: #1741
Signed-off-by: Dominik Richter dominik.richter@gmail.com