From 7874707310c70c8ef1a3e04085dd71471d58809f Mon Sep 17 00:00:00 2001 From: Prowler Bot Date: Wed, 12 Mar 2025 11:35:32 +0100 Subject: [PATCH] chore(sentry): ignore new exceptions in Sentry (#7189) Co-authored-by: Sergio Garcia --- api/src/backend/config/settings/sentry.py | 47 +++++++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/api/src/backend/config/settings/sentry.py b/api/src/backend/config/settings/sentry.py index de1478a7fb..bb76173b6c 100644 --- a/api/src/backend/config/settings/sentry.py +++ b/api/src/backend/config/settings/sentry.py @@ -2,6 +2,8 @@ import sentry_sdk from config.env import env IGNORED_EXCEPTIONS = [ + # Provider is not connected due to credentials errors + "is not connected", # Authentication Errors from AWS "InvalidToken", "AccessDeniedException", @@ -11,18 +13,47 @@ IGNORED_EXCEPTIONS = [ "AuthFailure", "InvalidClientTokenId", "AccessDenied", - # Shodan Check - "No Shodan API Key", - # For now we don't want to log the RequestLimitExceeded errors - "RequestLimitExceeded", + "No Shodan API Key", # Shodan Check + "RequestLimitExceeded", # For now we don't want to log the RequestLimitExceeded errors "ThrottlingException", "Rate exceeded", - # The following comes from urllib3 - # eu-west-1 -- HTTPClientError[126]: An HTTP Client raised an unhandled exception: AWSHTTPSConnectionPool(host='hostname.s3.eu-west-1.amazonaws.com', port=443): Pool is closed. - "Pool is closed", - # Errors from the GCP API + "SubscriptionRequiredException", + "UnknownOperationException", + "OptInRequired", + "ReadTimeout", + "LimitExceeded", + "ConnectTimeoutError", + "ExpiredToken", + "IncompleteSignature", + "RegionDisabledException", + "TooManyRequestsException", + "SignatureDoesNotMatch", + "InvalidParameterValueException", + "InvalidInputException", + "ValidationException", + "AWSSecretAccessKeyInvalidError", + "InvalidAction", + "Pool is closed", # The following comes from urllib3: eu-west-1 -- HTTPClientError[126]: An HTTP Client raised an unhandled exception: AWSHTTPSConnectionPool(host='hostname.s3.eu-west-1.amazonaws.com', port=443): Pool is closed. + # Authentication Errors from GCP + "ClientAuthenticationError", + "AuthorizationFailed", + "Reauthentication is needed", "Permission denied to get service", "API has not been used in project", + "HttpError 404 when requesting", + "GCPNoAccesibleProjectsError", + # Authentication Errors from Azure + "ClientAuthenticationError", + "AuthorizationFailed", + "Subscription Not Registered", + "AzureNotValidClientIdError", + "AzureNotValidClientSecretError", + "AzureNotValidTenantIdError", + "AzureTenantIdAndClientSecretNotBelongingToClientIdError", + "AzureTenantIdAndClientIdNotBelongingToClientSecretError", + "AzureClientIdAndClientSecretNotBelongingToTenantIdError", + "AzureHTTPResponseError", + "Error with credentials provided", ]