From 44a4c0670b570bc90535dc1bc972e47af6fe0e1f Mon Sep 17 00:00:00 2001 From: Pepe Fagoaga Date: Mon, 11 Dec 2023 09:38:23 +0100 Subject: [PATCH] fix(cloudtrail): Handle UnsupportedOperationException (#3166) --- .../aws/services/cloudtrail/cloudtrail_service.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/prowler/providers/aws/services/cloudtrail/cloudtrail_service.py b/prowler/providers/aws/services/cloudtrail/cloudtrail_service.py index 2e6bc028..8d225dd5 100644 --- a/prowler/providers/aws/services/cloudtrail/cloudtrail_service.py +++ b/prowler/providers/aws/services/cloudtrail/cloudtrail_service.py @@ -140,7 +140,16 @@ class Cloudtrail(AWSService): error.response["Error"]["Code"] == "InsightNotEnabledException" ): - continue + logger.warning( + f"{client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}" + ) + elif ( + error.response["Error"]["Code"] + == "UnsupportedOperationException" + ): + logger.warning( + f"{client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}" + ) else: logger.error( f"{client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"