mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
fix code
This commit is contained in:
@@ -21,14 +21,15 @@ extra713(){
|
||||
# Guardduty Regions are not the same as REGIONS
|
||||
PYTHON=$(which python)
|
||||
if [ ! -z "${PYTHON}" ]; then
|
||||
#textInfo "Using python and boto3 for getting Guardduty Available Regions"
|
||||
GD_REGIONS=($($PYTHON -c "import boto3 ; session = boto3.session.Session() ; print (session.get_available_regions('guardduty'))"))
|
||||
for GD_REGION in "${GD_REGIONS[@]}"; do GD_REGIONS_PARSED+="$(echo "$GD_REGION" | cut -d \' -f 2 | cut -d \' -f 1 && echo " ")"; done
|
||||
else
|
||||
GD_REGIONS=$REGIONS
|
||||
GD_REGIONS_PARSED=$REGIONS
|
||||
fi
|
||||
|
||||
# "Check if GuardDuty is enabled (Not Scored) (Not part of CIS benchmark)"
|
||||
for GD_REGION in "${GD_REGIONS[@]}"; do
|
||||
regx="$(echo "$GD_REGION" | cut -d \' -f 2 | cut -d \' -f 1)"
|
||||
for regx in $GD_REGIONS_PARSED; do
|
||||
LIST_OF_GUARDDUTY_DETECTORS=$($AWSCLI guardduty list-detectors $PROFILE_OPT --region $regx --output text 2> /dev/null | cut -f2)
|
||||
if [[ $LIST_OF_GUARDDUTY_DETECTORS ]];then
|
||||
while read -r detector;do
|
||||
|
||||
Reference in New Issue
Block a user