refactor: rename entra_managed_device_required_for_authentication

This commit is contained in:
HugoPBrito committed 2025-03-13 20:40:44 +01:00
1 parent 391b10d79f
commit dab3ae4872
4 files changed
+19 -19

No files matched your search

@@ -1,6 +1,6 @@
{
"Provider": "microsoft365",
"CheckID": "entra_managed_device_required_for_authentication",
"CheckID": "entra_capolicy_managed_device_required_for_authentication",
"CheckTitle": "Ensure that only managed devices are required for authentication",
"CheckType": [],
"ServiceName": "entra",
@@ -7,7 +7,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
)
class entra_managed_device_required_for_authentication(Check):
class entra_capolicy_managed_device_required_for_authentication(Check):
"""Check if Conditional Access policies deny access to the Microsoft 365
This check ensures that Conditional Access policies are in place to enforce managed device requirement for authentication.
@@ -20,7 +20,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
)
class Test_entra_managed_device_required_for_authentication:
class Test_entra_capolicy_managed_device_required_for_authentication:
def test_entra_no_conditional_access_policies(self):
entra_client = mock.MagicMock
entra_client.audited_tenant = "audited_tenant"
@@ -31,17 +31,17 @@ class Test_entra_managed_device_required_for_authentication:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication.entra_client",
"prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication import (
entra_managed_device_required_for_authentication,
from prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication import (
entra_capolicy_managed_device_required_for_authentication,
)
entra_client.conditional_access_policies = {}
check = entra_managed_device_required_for_authentication()
check = entra_capolicy_managed_device_required_for_authentication()
result = check.execute()
assert len(result) == 1
assert result[0].status == "FAIL"
@@ -66,12 +66,12 @@ class Test_entra_managed_device_required_for_authentication:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication.entra_client",
"prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication import (
entra_managed_device_required_for_authentication,
from prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication import (
entra_capolicy_managed_device_required_for_authentication,
)
from prowler.providers.microsoft365.services.entra.entra_service import (
ConditionalAccessPolicy,
@@ -112,7 +112,7 @@ class Test_entra_managed_device_required_for_authentication:
)
}
check = entra_managed_device_required_for_authentication()
check = entra_capolicy_managed_device_required_for_authentication()
result = check.execute()
assert len(result) == 1
assert result[0].status == "FAIL"
@@ -138,12 +138,12 @@ class Test_entra_managed_device_required_for_authentication:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication.entra_client",
"prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication import (
entra_managed_device_required_for_authentication,
from prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication import (
entra_capolicy_managed_device_required_for_authentication,
)
from prowler.providers.microsoft365.services.entra.entra_service import (
ConditionalAccessPolicy,
@@ -189,7 +189,7 @@ class Test_entra_managed_device_required_for_authentication:
)
}
check = entra_managed_device_required_for_authentication()
check = entra_capolicy_managed_device_required_for_authentication()
result = check.execute()
assert len(result) == 1
assert result[0].status == "FAIL"
@@ -219,12 +219,12 @@ class Test_entra_managed_device_required_for_authentication:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication.entra_client",
"prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_managed_device_required_for_authentication.entra_managed_device_required_for_authentication import (
entra_managed_device_required_for_authentication,
from prowler.providers.microsoft365.services.entra.entra_capolicy_managed_device_required_for_authentication.entra_capolicy_managed_device_required_for_authentication import (
entra_capolicy_managed_device_required_for_authentication,
)
from prowler.providers.microsoft365.services.entra.entra_service import (
ConditionalAccessPolicy,
@@ -270,7 +270,7 @@ class Test_entra_managed_device_required_for_authentication:
)
}
check = entra_managed_device_required_for_authentication()
check = entra_capolicy_managed_device_required_for_authentication()
result = check.execute()
assert len(result) == 1
assert result[0].status == "PASS"