mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-11 14:04:17 +00:00
Fix #940 handling error when can not list functions
This commit is contained in:
1 parent
78faa8f365
commit
49ea3d8589
1 file changed
+5
-1
@@ -31,7 +31,11 @@ extra760(){
|
||||
fi
|
||||
|
||||
for regx in $REGIONS; do
|
||||
LIST_OF_FUNCTIONS=$($AWSCLI lambda list-functions $PROFILE_OPT --region $regx --query Functions[*].FunctionName --output text)
|
||||
LIST_OF_FUNCTIONS=$($AWSCLI lambda list-functions $PROFILE_OPT --region $regx --query Functions[*].FunctionName --output text 2>&1)
|
||||
if [[ $(echo "$LIST_OF_FUNCTIONS" | grep AccessDenied) ]]; then
|
||||
textFail "$regx: Access Denied trying to list Lambda functions" "$regx" "$lambdafunction"
|
||||
continue
|
||||
fi
|
||||
if [[ $LIST_OF_FUNCTIONS ]]; then
|
||||
for lambdafunction in $LIST_OF_FUNCTIONS;do
|
||||
LAMBDA_FUNCTION_FOLDER="$SECRETS_TEMP_FOLDER/extra760-$lambdafunction-$regx"
|
||||
|
||||
Reference in new issue
Block a user