mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
Improved whitelisting by splitting ignores by newline instead of spaces only @urjitbhatia
Split ignores by newline instead of spaces only
This commit is contained in:
@@ -111,19 +111,19 @@ textFail(){
|
|||||||
## ignore whitelists for current check
|
## ignore whitelists for current check
|
||||||
level="FAIL"
|
level="FAIL"
|
||||||
colorcode="$BAD"
|
colorcode="$BAD"
|
||||||
for i in $IGNORES; do
|
while read -r i; do
|
||||||
ignore_check_name="${i%:*}"
|
ignore_check_name="${i%:*}"
|
||||||
ignore_value="${i#*${CHECK_NAME}:}"
|
ignore_value="${i#*${CHECK_NAME}:}"
|
||||||
if [[ ${ignore_check_name} != "${CHECK_NAME}" ]]; then
|
if [[ ${ignore_check_name} != "${CHECK_NAME}" ]]; then
|
||||||
# not for this check
|
# not for this check
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [[ $1 =~ ${ignore_value} ]]; then
|
if [[ $1 =~ .*"${ignore_value}".* ]]; then
|
||||||
level="WARNING"
|
level="WARNING"
|
||||||
colorcode="$WARNING"
|
colorcode="$WARNING"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done <<< "$IGNORES"
|
||||||
|
|
||||||
# only set non-0 exit code on FAIL mode, WARN is ok
|
# only set non-0 exit code on FAIL mode, WARN is ok
|
||||||
if [[ "$level" == "FAIL" ]]; then
|
if [[ "$level" == "FAIL" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user