mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-13 00:05:04 +00:00
Replace -J flag with junit-xml output format
Rearrange output functions so they support outputting text alongside other formats, if specified Add a convenience function for checking if JUnit output is enabled Move monochrome setting into loop so it better supports multiple formats Update README
This commit is contained in:
19
prowler
19
prowler
@@ -45,7 +45,6 @@ SEP=','
|
||||
KEEPCREDREPORT=0
|
||||
EXITCODE=0
|
||||
SEND_TO_SECURITY_HUB=0
|
||||
GENERATE_JUNIT=0
|
||||
SCRIPT_START_TIME=$( date -u +"%Y-%m-%dT%H:%M:%S%z" )
|
||||
TITLE_ID=""
|
||||
TITLE_TEXT="CALLER ERROR - UNSET TITLE"
|
||||
@@ -66,7 +65,7 @@ USAGE:
|
||||
-f <filterregion> specify an AWS region to run checks against
|
||||
(i.e.: us-west-1)
|
||||
-m <maxitems> specify the maximum number of items to return for long-running requests (default: 100)
|
||||
-M <mode> output mode: text (default), mono, json, json-asff, csv. They can be used combined comma separated.
|
||||
-M <mode> output mode: text (default), mono, json, json-asff, junit-xml, csv. They can be used combined comma separated.
|
||||
(separator is ","; data is on stdout; progress on stderr).
|
||||
-k keep the credential report
|
||||
-n show check numbers to sort easier
|
||||
@@ -79,7 +78,6 @@ USAGE:
|
||||
-V show version number & exit
|
||||
-s show scoring report
|
||||
-S send check output to AWS Security Hub - only valid when the output mode is json-asff (i.e. "-M json-asff -S")
|
||||
-J generate JUnit reports, readable by Jenkins or other CI tools. Files are written to ./junit-reports
|
||||
-x specify external directory with custom checks (i.e. /my/own/checks, files must start by "check")
|
||||
-q suppress info messages and passing test output
|
||||
-A account id for the account where to assume a role, requires -R and -T
|
||||
@@ -94,7 +92,7 @@ USAGE:
|
||||
exit
|
||||
}
|
||||
|
||||
while getopts ":hlLkqp:r:c:g:f:m:M:E:enbVsSJxI:A:R:T:" OPTION; do
|
||||
while getopts ":hlLkqp:r:c:g:f:m:M:E:enbVsSxI:A:R:T:" OPTION; do
|
||||
case $OPTION in
|
||||
h )
|
||||
usage
|
||||
@@ -154,9 +152,6 @@ while getopts ":hlLkqp:r:c:g:f:m:M:E:enbVsSJxI:A:R:T:" OPTION; do
|
||||
S )
|
||||
SEND_TO_SECURITY_HUB=1
|
||||
;;
|
||||
J )
|
||||
GENERATE_JUNIT=1
|
||||
;;
|
||||
x )
|
||||
EXTERNAL_CHECKS_PATH=$OPTARG
|
||||
;;
|
||||
@@ -280,12 +275,12 @@ execute_check() {
|
||||
fi
|
||||
fi
|
||||
show_check_title ${alternate_name}
|
||||
if [[ "${GENERATE_JUNIT}" -eq 1 ]]; then
|
||||
if is_junit_output_enabled; then
|
||||
prepare_junit_check_output "$1"
|
||||
fi
|
||||
# Execute the check
|
||||
${alternate_name}
|
||||
if [[ "${GENERATE_JUNIT}" -eq 1 ]]; then
|
||||
if is_junit_output_enabled; then
|
||||
finalise_junit_check_output "$1"
|
||||
fi
|
||||
else
|
||||
@@ -300,12 +295,12 @@ execute_check() {
|
||||
fi
|
||||
fi
|
||||
show_check_title $1
|
||||
if [[ "${GENERATE_JUNIT}" -eq 1 ]]; then
|
||||
if is_junit_output_enabled; then
|
||||
prepare_junit_check_output "$1"
|
||||
fi
|
||||
# Execute the check
|
||||
$1
|
||||
if [[ "${GENERATE_JUNIT}" -eq 1 ]]; then
|
||||
if is_junit_output_enabled; then
|
||||
finalise_junit_check_output "$1"
|
||||
fi
|
||||
else
|
||||
@@ -443,7 +438,7 @@ if [[ "$SEND_TO_SECURITY_HUB" -eq 1 ]]; then
|
||||
checkSecurityHubCompatibility
|
||||
fi
|
||||
|
||||
if [[ "${GENERATE_JUNIT}" -eq 1 ]]; then
|
||||
if is_junit_output_enabled; then
|
||||
prepare_junit_output
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user