From 2a8a7d844b3eeb0abce81cc9cddd79003c008041 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <38561120+sergargar@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:21:39 +0200 Subject: [PATCH] fix(apigatewayv2): handle BadRequestException (#1261) Co-authored-by: sergargar --- checks/check_extra7156 | 4 ++-- checks/check_extra7157 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/checks/check_extra7156 b/checks/check_extra7156 index 7c8de499b1..5787f6eb9d 100644 --- a/checks/check_extra7156 +++ b/checks/check_extra7156 @@ -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 -} \ No newline at end of file +} diff --git a/checks/check_extra7157 b/checks/check_extra7157 index 755435c5f1..e73f83059f 100644 --- a/checks/check_extra7157 +++ b/checks/check_extra7157 @@ -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