From 96ce1461b941e95895a8bb50b4ac04a13e2a0c43 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:58:05 +0200 Subject: [PATCH] chore(sentry): add powershell user auth module connection errors to ignored list (#8420) --- api/CHANGELOG.md | 3 +++ api/src/backend/config/settings/sentry.py | 3 +++ prowler/CHANGELOG.md | 1 + prowler/providers/m365/lib/powershell/m365_powershell.py | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/CHANGELOG.md b/api/CHANGELOG.md index f9a456fb2a..47b91c8518 100644 --- a/api/CHANGELOG.md +++ b/api/CHANGELOG.md @@ -8,6 +8,9 @@ All notable changes to the **Prowler API** are documented in this file. - Github provider support [(#8271)](https://github.com/prowler-cloud/prowler/pull/8271) - Integration with Amazon S3, enabling storage and retrieval of scan data via S3 buckets [(#8056)](https://github.com/prowler-cloud/prowler/pull/8056) +### Fixed +- Avoid sending errors to Sentry in M365 provider when user authentication fails [(#8420)](https://github.com/prowler-cloud/prowler/pull/8420) + --- ## [1.10.2] (Prowler v5.9.2) diff --git a/api/src/backend/config/settings/sentry.py b/api/src/backend/config/settings/sentry.py index f6752f0646..98666c08de 100644 --- a/api/src/backend/config/settings/sentry.py +++ b/api/src/backend/config/settings/sentry.py @@ -69,6 +69,9 @@ IGNORED_EXCEPTIONS = [ "AzureClientIdAndClientSecretNotBelongingToTenantIdError", "AzureHTTPResponseError", "Error with credentials provided", + # PowerShell Errors in User Authentication + "Microsoft Teams User Auth connection failed: Please check your permissions and try again.", + "Exchange Online User Auth connection failed: Please check your permissions and try again.", ] diff --git a/prowler/CHANGELOG.md b/prowler/CHANGELOG.md index b723e3bd28..acb6287be6 100644 --- a/prowler/CHANGELOG.md +++ b/prowler/CHANGELOG.md @@ -38,6 +38,7 @@ All notable changes to the **Prowler SDK** are documented in this file. - Way of counting FAILED/PASS reqs from `kisa_isms_p_2023_aws` table [(#8382)](https://github.com/prowler-cloud/prowler/pull/8382) - Use default tenant domain instead of first domain in list for Azure and M365 providers [(#8402)](https://github.com/prowler-cloud/prowler/pull/8402) - Avoid multiple module error calls in M365 provider [(#8353)](https://github.com/prowler-cloud/prowler/pull/8353) +- Avoid sending errors to Sentry in M365 provider when user authentication fails [(#8420)](https://github.com/prowler-cloud/prowler/pull/8420) - Tweaks from Prowler ThreatScore in order to handle the correct reqs [(#8401)](https://github.com/prowler-cloud/prowler/pull/8401) - Make `setup_assumed_session` static for the AWS provider [(#8419)](https://github.com/prowler-cloud/prowler/pull/8419) diff --git a/prowler/providers/m365/lib/powershell/m365_powershell.py b/prowler/providers/m365/lib/powershell/m365_powershell.py index f8c4ec5ff0..7692700988 100644 --- a/prowler/providers/m365/lib/powershell/m365_powershell.py +++ b/prowler/providers/m365/lib/powershell/m365_powershell.py @@ -286,7 +286,7 @@ class M365PowerShell(PowerShellSession): return True else: logger.error( - "Microsoft Teams connection failed: Please check your permissions and try again." + "Microsoft Teams User Auth connection failed: Please check your permissions and try again." ) return connection # Application Auth @@ -398,7 +398,7 @@ class M365PowerShell(PowerShellSession): return True else: logger.error( - "Exchange Online connection failed: Please check your permissions and try again." + "Exchange Online User Auth connection failed: Please check your permissions and try again." ) return False # Application Auth