fix(apigatewayv2): handle BadRequestException (#1261)

Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-07-11 12:21:39 +02:00
committed by GitHub
parent ff33f426e5
commit 2a8a7d844b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ extra7156(){
# "Check if API Gateway V2 has Access Logging enabled "
for regx in $REGIONS; do
LIST_OF_API_GW=$($AWSCLI apigatewayv2 get-apis $PROFILE_OPT --region $regx --query Items[*].ApiId --output text 2>&1)
if [[ $(echo "$LIST_OF_API_GW" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
if [[ $(echo "$LIST_OF_API_GW" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|BadRequestException') ]]; then
textInfo "$regx: Access Denied trying to get APIs" "$regx"
continue
fi
@@ -54,4 +54,4 @@ extra7156(){
textInfo "$regx: No API Gateway found" "$regx"
fi
done
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ CHECK_CAF_EPIC_extra7157='IAM'
extra7157(){
for regx in $REGIONS; do
LIST_OF_API_GW=$($AWSCLI apigatewayv2 get-apis $PROFILE_OPT --region $regx --query "Items[*].ApiId" --output text 2>&1)
if [[ $(echo "$LIST_OF_API_GW" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError') ]]; then
if [[ $(echo "$LIST_OF_API_GW" | grep -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|BadRequestException') ]]; then
textInfo "$regx: Access Denied trying to get APIs" "$regx"
continue
fi