From 721cafa0cdeb0e2d113c8512afec18fa73c1b3dd Mon Sep 17 00:00:00 2001 From: Pepe Fagoaga Date: Tue, 2 Aug 2022 12:30:53 +0200 Subject: [PATCH] fix(appstream): Handle timeout errors (#1296) --- checks/check_extra7190 | 2 +- checks/check_extra7191 | 2 +- checks/check_extra7192 | 2 +- checks/check_extra7193 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/checks/check_extra7190 b/checks/check_extra7190 index 8f78e0e191..df14b086a1 100644 --- a/checks/check_extra7190 +++ b/checks/check_extra7190 @@ -28,7 +28,7 @@ CHECK_CAF_EPIC_extra7190="Infrastructure Security" extra7190(){ for regx in $REGIONS; do LIST_OF_FLEETS_WITH_MAX_SESSION_DURATION_ABOVE_RECOMMENDED=$("${AWSCLI}" appstream describe-fleets $PROFILE_OPT --region "${regx}" --query 'Fleets[?MaxUserDurationInSeconds>=`36000`].Arn' --output text 2>&1) - if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL' <<< "${LIST_OF_FLEETS_WITH_MAX_SESSION_DURATION_ABOVE_RECOMMENDED}"; then + if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL|Connect timeout on endpoint URL' <<< "${LIST_OF_FLEETS_WITH_MAX_SESSION_DURATION_ABOVE_RECOMMENDED}"; then textInfo "${regx}: Access Denied trying to describe appstream fleet(s)" "${regx}" continue fi diff --git a/checks/check_extra7191 b/checks/check_extra7191 index 3d40fd875d..c93c647865 100644 --- a/checks/check_extra7191 +++ b/checks/check_extra7191 @@ -28,7 +28,7 @@ CHECK_CAF_EPIC_extra7191="Infrastructure Security" extra7191(){ for regx in $REGIONS; do LIST_OF_FLEETS_WITH_SESSION_DISCONNECT_DURATION_ABOVE_RECOMMENDED=$("${AWSCLI}" appstream describe-fleets $PROFILE_OPT --region "${regx}" --query 'Fleets[?DisconnectTimeoutInSeconds>`300`].Arn' --output text 2>&1) - if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL' <<< "${LIST_OF_FLEETS_WITH_SESSION_DISCONNECT_DURATION_ABOVE_RECOMMENDED}"; then + if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL|Connect timeout on endpoint URL' <<< "${LIST_OF_FLEETS_WITH_SESSION_DISCONNECT_DURATION_ABOVE_RECOMMENDED}"; then textInfo "${regx}: Access Denied trying to describe appstream fleet(s)" "${regx}" continue fi diff --git a/checks/check_extra7192 b/checks/check_extra7192 index 7ad8b4ea33..2c511ca5e7 100644 --- a/checks/check_extra7192 +++ b/checks/check_extra7192 @@ -28,7 +28,7 @@ CHECK_CAF_EPIC_extra7192="Infrastructure Security" extra7192(){ for regx in $REGIONS; do LIST_OF_FLEETS_WITH_SESSION_IDLE_DISCONNECT_DURATION_ABOVE_RECOMMENDED=$("${AWSCLI}" appstream describe-fleets $PROFILE_OPT --region "${regx}" --query 'Fleets[?IdleDisconnectTimeoutInSeconds>`600`].Arn' --output text 2>&1) - if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL' <<< "${LIST_OF_FLEETS_WITH_SESSION_IDLE_DISCONNECT_DURATION_ABOVE_RECOMMENDED}"; then + if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL|Connect timeout on endpoint URL' <<< "${LIST_OF_FLEETS_WITH_SESSION_IDLE_DISCONNECT_DURATION_ABOVE_RECOMMENDED}"; then textInfo "${regx}: Access Denied trying to describe appstream fleet(s)" "${regx}" continue fi diff --git a/checks/check_extra7193 b/checks/check_extra7193 index 8445841cdb..6d23449eb6 100644 --- a/checks/check_extra7193 +++ b/checks/check_extra7193 @@ -28,7 +28,7 @@ CHECK_CAF_EPIC_extra7193="Infrastructure Security" extra7193(){ for regx in $REGIONS; do LIST_OF_FLEETS_WITH_DEFAULT_INTERNET_ACCESS_ENABLED=$("${AWSCLI}" appstream describe-fleets $PROFILE_OPT --region "${regx}" --query 'Fleets[?EnableDefaultInternetAccess==`true`].Arn' --output text 2>&1) - if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL' <<< "${LIST_OF_FLEETS_WITH_DEFAULT_INTERNET_ACCESS_ENABLED}"; then + if grep -q -E 'AccessDenied|UnauthorizedOperation|AuthorizationError|Could not connect to the endpoint URL|Connect timeout on endpoint URL' <<< "${LIST_OF_FLEETS_WITH_DEFAULT_INTERNET_ACCESS_ENABLED}"; then textInfo "${regx}: Access Denied trying to describe appstream fleet(s)" "${regx}" continue fi