From 85195096be3edf031e7409e3aee3af66cc292efb Mon Sep 17 00:00:00 2001 From: "Hugo P.Brito" Date: Wed, 8 Apr 2026 12:37:49 +0100 Subject: [PATCH] fix(m365): move KNOWN_PLATFORMS to entra_service and normalize case Move the constant from the check module to the service module so it can be reused, and switch to a lowercase frozenset for case-insensitive comparison. --- .../entra_conditional_access_policy_unknown_device_blocked.py | 3 +-- prowler/providers/m365/services/entra/entra_service.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/prowler/providers/m365/services/entra/entra_conditional_access_policy_unknown_device_blocked/entra_conditional_access_policy_unknown_device_blocked.py b/prowler/providers/m365/services/entra/entra_conditional_access_policy_unknown_device_blocked/entra_conditional_access_policy_unknown_device_blocked.py index e9e192cdbd..4e960f751f 100644 --- a/prowler/providers/m365/services/entra/entra_conditional_access_policy_unknown_device_blocked/entra_conditional_access_policy_unknown_device_blocked.py +++ b/prowler/providers/m365/services/entra/entra_conditional_access_policy_unknown_device_blocked/entra_conditional_access_policy_unknown_device_blocked.py @@ -1,12 +1,11 @@ from prowler.lib.check.models import Check, CheckReportM365 from prowler.providers.m365.services.entra.entra_client import entra_client from prowler.providers.m365.services.entra.entra_service import ( + KNOWN_PLATFORMS, ConditionalAccessGrantControl, ConditionalAccessPolicyState, ) -KNOWN_PLATFORMS = {"android", "iOS", "windows", "macOS", "linux"} - class entra_conditional_access_policy_unknown_device_blocked(Check): """Check if at least one Conditional Access policy blocks unknown device platforms. diff --git a/prowler/providers/m365/services/entra/entra_service.py b/prowler/providers/m365/services/entra/entra_service.py index 7ea9c75356..0bfac17aef 100644 --- a/prowler/providers/m365/services/entra/entra_service.py +++ b/prowler/providers/m365/services/entra/entra_service.py @@ -1004,6 +1004,9 @@ class PlatformConditions(BaseModel): allow_population_by_field_name = True +KNOWN_PLATFORMS = frozenset({"android", "ios", "windows", "macos", "linux"}) + + class TransferMethod(Enum): """Transfer methods for authentication flows in Conditional Access policies."""