mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
Merge branch 'master' of https://github.com/toniblyx/prowler
This commit is contained in:
@@ -76,6 +76,10 @@ output_junit_failure() {
|
|||||||
output_junit_test_case "$1" "<failure message=\"$(xml_escape "$1")\"/>"
|
output_junit_test_case "$1" "<failure message=\"$(xml_escape "$1")\"/>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_junit_skipped() {
|
||||||
|
output_junit_test_case "$1" "<skipped message=\"$(xml_escape "$1")\"/>"
|
||||||
|
}
|
||||||
|
|
||||||
get_junit_classname() {
|
get_junit_classname() {
|
||||||
# <section>.<check_id> naturally follows a Java package structure, so it is suitable as a package name
|
# <section>.<check_id> naturally follows a Java package structure, so it is suitable as a package name
|
||||||
echo "$TITLE_ID"
|
echo "$TITLE_ID"
|
||||||
|
|||||||
@@ -106,13 +106,13 @@ textFail(){
|
|||||||
FAIL_COUNTER=$((FAIL_COUNTER+1))
|
FAIL_COUNTER=$((FAIL_COUNTER+1))
|
||||||
EXITCODE=3
|
EXITCODE=3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $2 ]]; then
|
if [[ $2 ]]; then
|
||||||
REPREGION=$2
|
REPREGION=$2
|
||||||
else
|
else
|
||||||
REPREGION=$REGION
|
REPREGION=$REGION
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${MODES[@]}" =~ "csv" ]]; then
|
if [[ "${MODES[@]}" =~ "csv" ]]; then
|
||||||
echo "$PROFILE${SEP}$ACCOUNT_NUM${SEP}$REPREGION${SEP}$TITLE_ID${SEP}${level}${SEP}$ITEM_SCORED${SEP}$ITEM_LEVEL${SEP}$TITLE_TEXT${SEP}$1" | tee -a ${OUTPUT_FILE_NAME}.${EXTENSION_CSV}
|
echo "$PROFILE${SEP}$ACCOUNT_NUM${SEP}$REPREGION${SEP}$TITLE_ID${SEP}${level}${SEP}$ITEM_SCORED${SEP}$ITEM_LEVEL${SEP}$TITLE_TEXT${SEP}$1" | tee -a ${OUTPUT_FILE_NAME}.${EXTENSION_CSV}
|
||||||
fi
|
fi
|
||||||
@@ -126,8 +126,12 @@ textFail(){
|
|||||||
sendToSecurityHub "${JSON_ASFF_OUTPUT}"
|
sendToSecurityHub "${JSON_ASFF_OUTPUT}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if is_junit_output_enabled && [[ "$level" == "FAIL" ]]; then
|
if is_junit_output_enabled; then
|
||||||
output_junit_failure "$1"
|
if [[ "${level}" == "FAIL" ]]; then
|
||||||
|
output_junit_failure "$1"
|
||||||
|
elif [[ "${level}" == "WARNING" ]]; then
|
||||||
|
output_junit_skipped "$1"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${MODES[@]}" =~ "mono" ]]; then
|
if [[ "${MODES[@]}" =~ "mono" ]]; then
|
||||||
echo " $colorcode ${level}! $1 $NORMAL" | tee -a ${OUTPUT_FILE_NAME}.$EXTENSION_TEXT
|
echo " $colorcode ${level}! $1 $NORMAL" | tee -a ${OUTPUT_FILE_NAME}.$EXTENSION_TEXT
|
||||||
@@ -218,6 +222,11 @@ generateJsonAsffOutput(){
|
|||||||
# Replace any successive non-conforming characters with a single underscore
|
# Replace any successive non-conforming characters with a single underscore
|
||||||
local message=$1
|
local message=$1
|
||||||
local status=$2
|
local status=$2
|
||||||
|
|
||||||
|
if [[ "$status" == "FAIL" ]]; then
|
||||||
|
status="FAILED"
|
||||||
|
fi
|
||||||
|
|
||||||
local severity=$3
|
local severity=$3
|
||||||
jq -M -c \
|
jq -M -c \
|
||||||
--arg ACCOUNT_NUM "$ACCOUNT_NUM" \
|
--arg ACCOUNT_NUM "$ACCOUNT_NUM" \
|
||||||
|
|||||||
Reference in New Issue
Block a user