[SECRES-3850] Handle non-interactive shells gracefully #158
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.
This PR adds a check during
scfw runfor whether we're running in a non-interactive shell. This is relevant when the user must provide interactive input to confirm a command with only warning-level findings. Instead of erroring out, SCFW now defaults to blocking in this situation. Users can change this default behavior by adding--allow-on-warningto their SCFW command-line.For cases where users are unable or unwilling to update their command lines, this PR also allows users to configure this auto-allow/auto-block behavior by setting a new environment variable
SCFW_ON_WARNINGto"ALLOW"or"BLOCK".The command-line options and environment variables determine the warning-level action as follows:
--block-on-warningor--allow-on-warningis set, behave accordinglySCFW_ON_WARNINGis set and valid, behave accordinglyBLOCK,Other changes include: