Skip to content

Commit

Permalink
Merge pull request #1 from spark1security/ms/new-flags
Browse files Browse the repository at this point in the history
Added new flags: timeout, limit and insecure
  • Loading branch information
blupants authored Jun 24, 2024
2 parents 5d5a958 + 39ca151 commit 3d363a7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ inputs:
description: 'Output report format. Supported formats: n0s1, SARIF, gitlab'
required: false
default: ''
timeout:
description: 'HTTP request timeout in seconds'
required: false
default: ''
limit:
description: 'The limit of the number of pages to return per HTTP request'
required: false
default: ''
insecure:
description: 'Insecure mode. Ignore SSL certificate verification'
required: false
default: ''

runs:
using: 'docker'
Expand All @@ -81,3 +93,6 @@ runs:
- '-m ${{ inputs.show-matched-secret-on-logs }}'
- '-n ${{ inputs.debug }}'
- '-o ${{ inputs.report-format }}'
- '-p ${{ inputs.timeout }}'
- '-q ${{ inputs.limit }}'
- '-r ${{ inputs.insecure }}'
21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:z:" o; do
o)
export reportFormat=${OPTARG}
;;
p)
export timeout=${OPTARG}
;;
q)
export limit=${OPTARG}
;;
r)
export insecure=${OPTARG}
;;
esac
done

Expand All @@ -65,6 +74,9 @@ export label="${label}"
export showMatchedSecretOnLogs="${showMatchedSecretOnLogs}"
export debug="${debug}"
export reportFormat="${reportFormat}"
export timeout="${timeout}"
export limit="${limit}"
export insecure="${insecure}"


ARGS=""
Expand Down Expand Up @@ -114,6 +126,15 @@ fi
if [ $reportFormat ];then
ARGS="$ARGS --report-format $reportFormat"
fi
if [ $timeout ];then
ARGS="$ARGS --timeout $timeout"
fi
if [ $limit ];then
ARGS="$ARGS --limit $limit"
fi
if [ $insecure ];then
ARGS="$ARGS --insecure"
fi

echo "Running n0s1 with options: n0s1 ${scanTarget} ${ARGS}" | sed "s/$passwordKey/<REDACTED>/g"
n0s1 ${scanTarget} ${ARGS}
Expand Down

0 comments on commit 3d363a7

Please sign in to comment.