refactor: rename entra_password_hash_sync_enabled

This commit is contained in:
HugoPBrito committed 2025-03-13 20:52:54 +01:00
1 parent bf47642d46
commit 7a4f0399c5
4 files changed
+19 -19

No files matched your search

@@ -1,6 +1,6 @@
{
"Provider": "microsoft365",
"CheckID": "entra_password_hash_sync_enabled",
"CheckID": "entra_organization_password_hash_sync_enabled",
"CheckTitle": "Ensure that password hash sync is enabled for hybrid deployments.",
"CheckType": [],
"ServiceName": "entra",
@@ -4,7 +4,7 @@ from prowler.lib.check.models import Check, CheckReportMicrosoft365
from prowler.providers.microsoft365.services.entra.entra_client import entra_client
class entra_password_hash_sync_enabled(Check):
class entra_organization_password_hash_sync_enabled(Check):
"""
Check if password hash synchronization is enabled for hybrid Microsoft Entra deployments.
@@ -6,7 +6,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
)
class Test_entra_password_hash_sync_enabled:
class Test_entra_organization_password_hash_sync_enabled:
def test_password_hash_sync_enabled(self):
entra_client = mock.MagicMock()
@@ -16,12 +16,12 @@ class Test_entra_password_hash_sync_enabled:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled.entra_client",
"prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled import (
entra_password_hash_sync_enabled,
from prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled import (
entra_organization_password_hash_sync_enabled,
)
org = Organization(
@@ -31,7 +31,7 @@ class Test_entra_password_hash_sync_enabled:
)
entra_client.organizations = [org]
check = entra_password_hash_sync_enabled()
check = entra_organization_password_hash_sync_enabled()
result = check.execute()
assert len(result) == 1
@@ -54,12 +54,12 @@ class Test_entra_password_hash_sync_enabled:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled.entra_client",
"prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled import (
entra_password_hash_sync_enabled,
from prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled import (
entra_organization_password_hash_sync_enabled,
)
org1 = Organization(
@@ -74,7 +74,7 @@ class Test_entra_password_hash_sync_enabled:
)
entra_client.organizations = [org1, org2]
check = entra_password_hash_sync_enabled()
check = entra_organization_password_hash_sync_enabled()
result = check.execute()
assert len(result) == 2
@@ -106,12 +106,12 @@ class Test_entra_password_hash_sync_enabled:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled.entra_client",
"prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled import (
entra_password_hash_sync_enabled,
from prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled import (
entra_organization_password_hash_sync_enabled,
)
org = Organization(
@@ -121,7 +121,7 @@ class Test_entra_password_hash_sync_enabled:
)
entra_client.organizations = [org]
check = entra_password_hash_sync_enabled()
check = entra_organization_password_hash_sync_enabled()
result = check.execute()
assert len(result) == 1
@@ -145,15 +145,15 @@ class Test_entra_password_hash_sync_enabled:
return_value=set_mocked_microsoft365_provider(),
),
mock.patch(
"prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled.entra_client",
"prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled.entra_client",
new=entra_client,
),
):
from prowler.providers.microsoft365.services.entra.entra_password_hash_sync_enabled.entra_password_hash_sync_enabled import (
entra_password_hash_sync_enabled,
from prowler.providers.microsoft365.services.entra.entra_organization_password_hash_sync_enabled.entra_organization_password_hash_sync_enabled import (
entra_organization_password_hash_sync_enabled,
)
check = entra_password_hash_sync_enabled()
check = entra_organization_password_hash_sync_enabled()
result = check.execute()
assert len(result) == 0