mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-03-30 03:49:48 +00:00
Compare commits
22 Commits
dependabot
...
PRWLR-6455
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf80c41ce8 | ||
|
|
d6dc91062c | ||
|
|
2d10e4023a | ||
|
|
5f88e5a628 | ||
|
|
e420ff31d1 | ||
|
|
be204fec1c | ||
|
|
bfabc65324 | ||
|
|
6e22d0839a | ||
|
|
0db303b926 | ||
|
|
97616bc541 | ||
|
|
7a4f0399c5 | ||
|
|
bf47642d46 | ||
|
|
49cd10136d | ||
|
|
55a8310334 | ||
|
|
b69f79f0fa | ||
|
|
b39ec544cf | ||
|
|
dab3ae4872 | ||
|
|
391b10d79f | ||
|
|
4ab392a4c1 | ||
|
|
f0d4c2cfda | ||
|
|
1ab91b0cae | ||
|
|
3bf62f7b70 |
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_admin_portals_role_limited_access",
|
||||
"CheckID": "entra_capolicy_admin_portals_role_limited_access",
|
||||
"CheckTitle": "Ensure that only administrative roles have access to Microsoft Admin Portals",
|
||||
"CheckAliases": [
|
||||
"entra_admin_portals_role_limited_access"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -7,7 +7,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
)
|
||||
|
||||
|
||||
class entra_admin_portals_role_limited_access(Check):
|
||||
class entra_capolicy_admin_portals_role_limited_access(Check):
|
||||
"""Check if Conditional Access policies deny access to the Microsoft 365 admin center for users with limited access roles.
|
||||
|
||||
This check ensures that Conditional Access policies are in place to deny access to the Microsoft 365 admin center for users with limited access roles.
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_admin_users_sign_in_frequency_enabled",
|
||||
"CheckID": "entra_capolicy_admin_users_sign_in_frequency_enabled",
|
||||
"CheckTitle": "Ensure Sign-in frequency periodic reauthentication is enabled and properly configured.",
|
||||
"CheckAliases": [
|
||||
"entra_admin_users_sign_in_frequency_enabled"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -8,7 +8,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
)
|
||||
|
||||
|
||||
class entra_admin_users_sign_in_frequency_enabled(Check):
|
||||
class entra_capolicy_admin_users_sign_in_frequency_enabled(Check):
|
||||
"""Check if Conditional Access policies enforce sign-in frequency for admin users."""
|
||||
|
||||
def execute(self) -> list[CheckReportMicrosoft365]:
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_admin_mfa_enabled_for_administrative_roles",
|
||||
"CheckID": "entra_capolicy_administrative_roles_have_mfa_enabled",
|
||||
"CheckTitle": "Ensure multifactor authentication is enabled for all users in administrative roles.",
|
||||
"CheckAliases": [
|
||||
"entra_admin_mfa_enabled_for_administrative_roles"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -9,7 +9,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
)
|
||||
|
||||
|
||||
class entra_admin_mfa_enabled_for_administrative_roles(Check):
|
||||
class entra_capolicy_administrative_roles_have_mfa_enabled(Check):
|
||||
"""
|
||||
Ensure multifactor authentication is enabled for all users in administrative roles.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_policy_ensure_default_user_cannot_create_tenants",
|
||||
"CheckID": "entra_capolicy_ensure_default_user_cannot_create_tenants",
|
||||
"CheckTitle": "Ensure that 'Restrict non-admin users from creating tenants' is set to 'Yes'",
|
||||
"CheckAliases": [
|
||||
"entra_policy_ensure_default_user_cannot_create_tenants"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -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_policy_ensure_default_user_cannot_create_tenants(Check):
|
||||
class entra_capolicy_ensure_default_user_cannot_create_tenants(Check):
|
||||
"""Check if default users are restricted from creating tenants.
|
||||
|
||||
This check verifies whether the authorization policy prevents non-admin users
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_identity_protection_sign_in_risk_enabled",
|
||||
"CheckID": "entra_capolicy_identity_protection_sign_in_risk_enabled",
|
||||
"CheckTitle": "Ensure that Identity Protection sign-in risk policies are enabled",
|
||||
"CheckAliases": [
|
||||
"entra_identity_protection_sign_in_risk_enabled"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -8,7 +8,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
)
|
||||
|
||||
|
||||
class entra_identity_protection_sign_in_risk_enabled(Check):
|
||||
class entra_capolicy_identity_protection_sign_in_risk_enabled(Check):
|
||||
"""Check if at least one Conditional Access policy is a Identity Protection sign-in risk policy.
|
||||
|
||||
This check ensures that at least one Conditional Access policy is a Identity Protection sign-in risk policy.
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_identity_protection_user_risk_enabled",
|
||||
"CheckID": "entra_capolicy_identity_protection_user_risk_enabled",
|
||||
"CheckTitle": "Ensure that Identity Protection user risk policies are enabled",
|
||||
"CheckAliases": [
|
||||
"entra_identity_protection_user_risk_enabled"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -8,7 +8,7 @@ from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
)
|
||||
|
||||
|
||||
class entra_identity_protection_user_risk_enabled(Check):
|
||||
class entra_capolicy_identity_protection_user_risk_enabled(Check):
|
||||
"""Check if at least one Conditional Access policy is a Identity Protection user risk policy.
|
||||
|
||||
This check ensures that at least one Conditional Access policy is a Identity Protection user risk policy.
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"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",
|
||||
"CheckAliases": [
|
||||
"entra_managed_device_required_for_authentication"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -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.
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_admin_consent_workflow_enabled",
|
||||
"CheckID": "entra_enterpriseapps_admin_consent_workflow_enabled",
|
||||
"CheckTitle": "Ensure the admin consent workflow is enabled.",
|
||||
"CheckAliases": [
|
||||
"entra_admin_consent_workflow_enabled"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
"ResourceIdTemplate": "",
|
||||
"Severity": "high",
|
||||
"ResourceType": "Organization Settings",
|
||||
"ResourceType": "Enterprise Applications Settings",
|
||||
"Description": "Ensure that the admin consent workflow is enabled in Microsoft Entra to allow users to request admin approval for applications requiring consent.",
|
||||
"Risk": "If the admin consent workflow is not enabled, users may be blocked from accessing applications that require admin consent, leading to potential work disruptions or unauthorized workarounds.",
|
||||
"RelatedUrl": "https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/configure-admin-consent-workflow",
|
||||
@@ -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_admin_consent_workflow_enabled(Check):
|
||||
class entra_enterpriseapps_admin_consent_workflow_enabled(Check):
|
||||
"""
|
||||
Ensure the admin consent workflow is enabled in Microsoft Entra.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_dynamic_group_for_guests_created",
|
||||
"CheckID": "entra_groups_dynamicgroup_for_guests_created",
|
||||
"CheckTitle": "Ensure a dynamic group for guest users is created.",
|
||||
"CheckAliases": [
|
||||
"entra_dynamicgroup_for_guests_created"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -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_dynamic_group_for_guests_created(Check):
|
||||
class entra_groups_dynamicgroup_for_guests_created(Check):
|
||||
"""
|
||||
Check if a dynamic group for guest users is created in Microsoft Entra.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"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.",
|
||||
"CheckAliases": [
|
||||
"entra_password_hash_sync_enabled"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
@@ -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.
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "entra_thirdparty_integrated_apps_not_allowed",
|
||||
"CheckTitle": "Ensure third party integrated applications are not allowed",
|
||||
"CheckID": "entra_users_thirdparty_integrated_apps_not_allowed",
|
||||
"CheckTitle": "Ensure only administrators or appropriately delegated users can register third-party applications.",
|
||||
"CheckAliases": [
|
||||
"entra_thirdparty_integrated_apps_not_allowed"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "entra",
|
||||
"SubServiceName": "",
|
||||
"ResourceIdTemplate": "",
|
||||
"Severity": "high",
|
||||
"ResourceType": "User settings",
|
||||
"ResourceType": "Users settings",
|
||||
"Description": "Require administrators or appropriately delegated users to register third-party applications.",
|
||||
"Risk": "It is recommended to only allow an administrator to register custom-developed applications. This ensures that the application undergoes a formal security review and approval process prior to exposing Azure Active Directory data. Certain users like developers or other high-request users may also be delegated permissions to prevent them from waiting on an administrative user. Your organization should review your policies and decide your needs.",
|
||||
"RelatedUrl": "https://learn.microsoft.com/en-us/entra/identity-platform/how-applications-are-added#who-has-permission-to-add-applications-to-my-microsoft-entra-instance",
|
||||
@@ -15,7 +18,7 @@
|
||||
"Code": {
|
||||
"CLI": "",
|
||||
"NativeIaC": "",
|
||||
"Other": "1. From Entra select the Portal Menu 2. Select Azure Active Directory 3. Select Users 4. Select User settings 5. Ensure that Users can register applications is set to No",
|
||||
"Other": "1. Navigate to Microsoft Entra admin center https://entra.microsoft.com/. 2. Click to expand Identity > Users select Users settings. 3. Set Users can register applications to No. 4. Click Save.",
|
||||
"Terraform": ""
|
||||
},
|
||||
"Recommendation": {
|
||||
@@ -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_thirdparty_integrated_apps_not_allowed(Check):
|
||||
class entra_users_thirdparty_integrated_apps_not_allowed(Check):
|
||||
"""Check if third-party integrated apps are not allowed for non-admin users in Entra.
|
||||
|
||||
This check verifies that non-admin users are not allowed to create third-party apps.
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "sharepoint_external_sharing_managed",
|
||||
"CheckID": "sharepoint_settings_external_sharing_managed",
|
||||
"CheckAliases": [
|
||||
"sharepoint_external_sharing_managed"
|
||||
],
|
||||
"CheckTitle": "Ensure SharePoint external sharing is managed through domain whitelists/blacklists.",
|
||||
"CheckType": [],
|
||||
"ServiceName": "sharepoint",
|
||||
@@ -6,7 +6,7 @@ from prowler.providers.microsoft365.services.sharepoint.sharepoint_client import
|
||||
)
|
||||
|
||||
|
||||
class sharepoint_external_sharing_managed(Check):
|
||||
class sharepoint_settings_external_sharing_managed(Check):
|
||||
"""
|
||||
Check if Microsoft 365 SharePoint external sharing is managed through domain whitelists/blacklists.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "sharepoint_external_sharing_restricted",
|
||||
"CheckID": "sharepoint_settings_external_sharing_restricted",
|
||||
"CheckTitle": "Ensure external content sharing is restricted.",
|
||||
"CheckAliases": [
|
||||
"sharepoint_external_sharing_restricted"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "sharepoint",
|
||||
"SubServiceName": "",
|
||||
@@ -6,7 +6,7 @@ from prowler.providers.microsoft365.services.sharepoint.sharepoint_client import
|
||||
)
|
||||
|
||||
|
||||
class sharepoint_external_sharing_restricted(Check):
|
||||
class sharepoint_settings_external_sharing_restricted(Check):
|
||||
"""
|
||||
Check if Microsoft 365 SharePoint restricts external sharing at organization level.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "sharepoint_guest_sharing_restricted",
|
||||
"CheckID": "sharepoint_settings_guest_sharing_restricted",
|
||||
"CheckTitle": "Ensure that SharePoint guest users cannot share items they don't own.",
|
||||
"CheckAliases": [
|
||||
"sharepoint_guest_sharing_restricted"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "sharepoint",
|
||||
"SubServiceName": "",
|
||||
@@ -6,7 +6,7 @@ from prowler.providers.microsoft365.services.sharepoint.sharepoint_client import
|
||||
)
|
||||
|
||||
|
||||
class sharepoint_guest_sharing_restricted(Check):
|
||||
class sharepoint_settings_guest_sharing_restricted(Check):
|
||||
"""
|
||||
Check if Microsoft 365 SharePoint guest sharing is restricted.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"Provider": "microsoft365",
|
||||
"CheckID": "sharepoint_modern_authentication_required",
|
||||
"CheckID": "sharepoint_settings_modern_authentication_required",
|
||||
"CheckTitle": "Ensure modern authentication for SharePoint applications is required.",
|
||||
"CheckAliases": [
|
||||
"sharepoint_modern_authentication_required"
|
||||
],
|
||||
"CheckType": [],
|
||||
"ServiceName": "sharepoint",
|
||||
"SubServiceName": "",
|
||||
@@ -6,7 +6,7 @@ from prowler.providers.microsoft365.services.sharepoint.sharepoint_client import
|
||||
)
|
||||
|
||||
|
||||
class sharepoint_modern_authentication_required(Check):
|
||||
class sharepoint_settings_modern_authentication_required(Check):
|
||||
"""
|
||||
Check if Microsoft 365 SharePoint requires modern authentication.
|
||||
|
||||
@@ -20,7 +20,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_admin_portals_role_limited_access:
|
||||
class Test_entra_capolicy_admin_portals_role_limited_access:
|
||||
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_admin_portals_role_limited_access:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access import (
|
||||
entra_admin_portals_role_limited_access,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access import (
|
||||
entra_capolicy_admin_portals_role_limited_access,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {}
|
||||
|
||||
check = entra_admin_portals_role_limited_access()
|
||||
check = entra_capolicy_admin_portals_role_limited_access()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -66,12 +66,12 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access import (
|
||||
entra_admin_portals_role_limited_access,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access import (
|
||||
entra_capolicy_admin_portals_role_limited_access,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -112,7 +112,7 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_portals_role_limited_access()
|
||||
check = entra_capolicy_admin_portals_role_limited_access()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -138,12 +138,12 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access import (
|
||||
entra_admin_portals_role_limited_access,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access import (
|
||||
entra_capolicy_admin_portals_role_limited_access,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -186,7 +186,7 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_portals_role_limited_access()
|
||||
check = entra_capolicy_admin_portals_role_limited_access()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -215,12 +215,12 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_portals_role_limited_access.entra_admin_portals_role_limited_access import (
|
||||
entra_admin_portals_role_limited_access,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_portals_role_limited_access.entra_capolicy_admin_portals_role_limited_access import (
|
||||
entra_capolicy_admin_portals_role_limited_access,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -263,7 +263,7 @@ class Test_entra_admin_portals_role_limited_access:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_portals_role_limited_access()
|
||||
check = entra_capolicy_admin_portals_role_limited_access()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -20,7 +20,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
class Test_entra_capolicy_admin_users_sign_in_frequency_enabled:
|
||||
def test_entra_no_conditional_access_policies(self):
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.audited_tenant = "audited_tenant"
|
||||
@@ -31,18 +31,18 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {}
|
||||
entra_client.audit_config = {"sign_in_frequency": 4}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -68,12 +68,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -114,7 +114,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -141,12 +141,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -204,7 +204,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -235,12 +235,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -300,7 +300,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -330,12 +330,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -393,7 +393,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -423,12 +423,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -486,7 +486,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -517,12 +517,12 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_users_sign_in_frequency_enabled.entra_admin_users_sign_in_frequency_enabled import (
|
||||
entra_admin_users_sign_in_frequency_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_admin_users_sign_in_frequency_enabled.entra_capolicy_admin_users_sign_in_frequency_enabled import (
|
||||
entra_capolicy_admin_users_sign_in_frequency_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -582,7 +582,7 @@ class Test_entra_admin_users_sign_in_frequency_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_users_sign_in_frequency_enabled()
|
||||
check = entra_capolicy_admin_users_sign_in_frequency_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -21,7 +21,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
class Test_entra_capolicy_administrative_roles_have_mfa_enabled:
|
||||
def test_no_conditional_access_policies(self):
|
||||
"""No conditional access policies configured: expected FAIL."""
|
||||
entra_client = mock.MagicMock
|
||||
@@ -34,17 +34,17 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -70,12 +70,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -114,7 +114,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -144,12 +144,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -188,7 +188,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -218,12 +218,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -263,7 +263,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -298,12 +298,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -342,7 +342,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -375,12 +375,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -435,7 +435,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -468,12 +468,12 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_mfa_enabled_for_administrative_roles.entra_admin_mfa_enabled_for_administrative_roles import (
|
||||
entra_admin_mfa_enabled_for_administrative_roles,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_administrative_roles_have_mfa_enabled.entra_capolicy_administrative_roles_have_mfa_enabled import (
|
||||
entra_capolicy_administrative_roles_have_mfa_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {
|
||||
@@ -527,7 +527,7 @@ class Test_entra_admin_mfa_enabled_for_administrative_roles:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_admin_mfa_enabled_for_administrative_roles()
|
||||
check = entra_capolicy_administrative_roles_have_mfa_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -10,7 +10,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
class Test_entra_capolicy_ensure_default_user_cannot_create_tenants:
|
||||
def test_entra_empty_tenant(self):
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.authorization_policy = {}
|
||||
@@ -21,15 +21,15 @@ class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_policy_ensure_default_user_cannot_create_tenants,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_capolicy_ensure_default_user_cannot_create_tenants,
|
||||
)
|
||||
|
||||
check = entra_policy_ensure_default_user_cannot_create_tenants()
|
||||
check = entra_capolicy_ensure_default_user_cannot_create_tenants()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -52,12 +52,12 @@ class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_policy_ensure_default_user_cannot_create_tenants,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_capolicy_ensure_default_user_cannot_create_tenants,
|
||||
)
|
||||
|
||||
entra_client.authorization_policy = AuthorizationPolicy(
|
||||
@@ -69,7 +69,7 @@ class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
),
|
||||
)
|
||||
|
||||
check = entra_policy_ensure_default_user_cannot_create_tenants()
|
||||
check = entra_capolicy_ensure_default_user_cannot_create_tenants()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -92,12 +92,12 @@ class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_policy_ensure_default_user_cannot_create_tenants.entra_policy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_policy_ensure_default_user_cannot_create_tenants,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_ensure_default_user_cannot_create_tenants.entra_capolicy_ensure_default_user_cannot_create_tenants import (
|
||||
entra_capolicy_ensure_default_user_cannot_create_tenants,
|
||||
)
|
||||
|
||||
entra_client.authorization_policy = AuthorizationPolicy(
|
||||
@@ -109,7 +109,7 @@ class Test_entra_policy_ensure_default_user_cannot_create_tenants:
|
||||
),
|
||||
)
|
||||
|
||||
check = entra_policy_ensure_default_user_cannot_create_tenants()
|
||||
check = entra_capolicy_ensure_default_user_cannot_create_tenants()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -21,7 +21,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
class Test_entra_capolicy_identity_protection_sign_in_risk_enabled:
|
||||
def test_entra_no_conditional_access_policies(self):
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.audited_tenant = "audited_tenant"
|
||||
@@ -32,17 +32,17 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled import (
|
||||
entra_identity_protection_sign_in_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled import (
|
||||
entra_capolicy_identity_protection_sign_in_risk_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {}
|
||||
|
||||
check = entra_identity_protection_sign_in_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_sign_in_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -55,7 +55,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
assert result[0].resource_id == "conditionalAccessPolicies"
|
||||
assert result[0].location == "global"
|
||||
|
||||
def test_entra_identity_protection_user_risk_policy_disabled(self):
|
||||
def test_entra_identity_protection_sign_in_risk_policy_disabled(self):
|
||||
id = str(uuid4())
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.audited_tenant = "audited_tenant"
|
||||
@@ -67,12 +67,12 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled import (
|
||||
entra_identity_protection_sign_in_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled import (
|
||||
entra_capolicy_identity_protection_sign_in_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -115,7 +115,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_sign_in_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_sign_in_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -128,7 +128,9 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
assert result[0].resource_id == "conditionalAccessPolicies"
|
||||
assert result[0].location == "global"
|
||||
|
||||
def test_entra_identity_protection_user_risk_policy_enabled_not_enough_risk(self):
|
||||
def test_entra_identity_protection_sign_in_risk_policy_enabled_not_enough_risk(
|
||||
self,
|
||||
):
|
||||
id = str(uuid4())
|
||||
display_name = "Test"
|
||||
entra_client = mock.MagicMock
|
||||
@@ -141,12 +143,12 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled import (
|
||||
entra_identity_protection_sign_in_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled import (
|
||||
entra_capolicy_identity_protection_sign_in_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -194,7 +196,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_sign_in_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_sign_in_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -210,7 +212,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
assert result[0].resource_id == id
|
||||
assert result[0].location == "global"
|
||||
|
||||
def test_entra_identity_protection_user_risk_policy_enabled_for_reporting(self):
|
||||
def test_entra_identity_protection_sign_in_risk_policy_enabled_for_reporting(self):
|
||||
id = str(uuid4())
|
||||
display_name = "Test"
|
||||
entra_client = mock.MagicMock
|
||||
@@ -223,12 +225,12 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled import (
|
||||
entra_identity_protection_sign_in_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled import (
|
||||
entra_capolicy_identity_protection_sign_in_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -276,7 +278,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_sign_in_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_sign_in_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -292,7 +294,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
assert result[0].resource_id == id
|
||||
assert result[0].location == "global"
|
||||
|
||||
def test_entra_identity_protection_user_risk_policy_enabled(self):
|
||||
def test_entra_identity_protection_sign_in_risk_policy_enabled(self):
|
||||
id = str(uuid4())
|
||||
display_name = "Test"
|
||||
entra_client = mock.MagicMock
|
||||
@@ -305,12 +307,12 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_sign_in_risk_enabled.entra_identity_protection_sign_in_risk_enabled import (
|
||||
entra_identity_protection_sign_in_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_sign_in_risk_enabled.entra_capolicy_identity_protection_sign_in_risk_enabled import (
|
||||
entra_capolicy_identity_protection_sign_in_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -358,7 +360,7 @@ class Test_entra_identity_protection_sign_in_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_sign_in_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_sign_in_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -21,7 +21,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_identity_protection_user_risk_enabled:
|
||||
class Test_entra_capolicy_identity_protection_user_risk_enabled:
|
||||
def test_entra_no_conditional_access_policies(self):
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.audited_tenant = "audited_tenant"
|
||||
@@ -32,17 +32,17 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled import (
|
||||
entra_identity_protection_user_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled import (
|
||||
entra_capolicy_identity_protection_user_risk_enabled,
|
||||
)
|
||||
|
||||
entra_client.conditional_access_policies = {}
|
||||
|
||||
check = entra_identity_protection_user_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_user_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -67,12 +67,12 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled import (
|
||||
entra_identity_protection_user_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled import (
|
||||
entra_capolicy_identity_protection_user_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -114,7 +114,7 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_user_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_user_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -140,12 +140,12 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled import (
|
||||
entra_identity_protection_user_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled import (
|
||||
entra_capolicy_identity_protection_user_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -192,7 +192,7 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_user_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_user_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -221,12 +221,12 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled import (
|
||||
entra_identity_protection_user_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled import (
|
||||
entra_capolicy_identity_protection_user_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -273,7 +273,7 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_user_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_user_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -302,12 +302,12 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_identity_protection_user_risk_enabled.entra_identity_protection_user_risk_enabled import (
|
||||
entra_identity_protection_user_risk_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_capolicy_identity_protection_user_risk_enabled.entra_capolicy_identity_protection_user_risk_enabled import (
|
||||
entra_capolicy_identity_protection_user_risk_enabled,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
ConditionalAccessPolicy,
|
||||
@@ -354,7 +354,7 @@ class Test_entra_identity_protection_user_risk_enabled:
|
||||
)
|
||||
}
|
||||
|
||||
check = entra_identity_protection_user_risk_enabled()
|
||||
check = entra_capolicy_identity_protection_user_risk_enabled()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -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"
|
||||
@@ -9,7 +9,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_admin_consent_workflow_enabled:
|
||||
class Test_entra_enterpriseapps_admin_consent_workflow_enabled:
|
||||
def test_admin_consent_enabled(self):
|
||||
"""
|
||||
Test when admin_consent_enabled is True:
|
||||
@@ -23,12 +23,12 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled import (
|
||||
entra_admin_consent_workflow_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled import (
|
||||
entra_enterpriseapps_admin_consent_workflow_enabled,
|
||||
)
|
||||
|
||||
entra_client.admin_consent_policy = AdminConsentPolicy(
|
||||
@@ -39,7 +39,7 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
)
|
||||
entra_client.tenant_domain = DOMAIN
|
||||
|
||||
check = entra_admin_consent_workflow_enabled()
|
||||
check = entra_enterpriseapps_admin_consent_workflow_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -65,12 +65,12 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled import (
|
||||
entra_admin_consent_workflow_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled import (
|
||||
entra_enterpriseapps_admin_consent_workflow_enabled,
|
||||
)
|
||||
|
||||
entra_client.admin_consent_policy = AdminConsentPolicy(
|
||||
@@ -81,7 +81,7 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
)
|
||||
entra_client.tenant_domain = DOMAIN
|
||||
|
||||
check = entra_admin_consent_workflow_enabled()
|
||||
check = entra_enterpriseapps_admin_consent_workflow_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -107,12 +107,12 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled import (
|
||||
entra_admin_consent_workflow_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled import (
|
||||
entra_enterpriseapps_admin_consent_workflow_enabled,
|
||||
)
|
||||
|
||||
entra_client.admin_consent_policy = AdminConsentPolicy(
|
||||
@@ -123,7 +123,7 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
)
|
||||
entra_client.tenant_domain = DOMAIN
|
||||
|
||||
check = entra_admin_consent_workflow_enabled()
|
||||
check = entra_enterpriseapps_admin_consent_workflow_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -151,15 +151,15 @@ class Test_entra_admin_consent_workflow_enabled:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_admin_consent_workflow_enabled.entra_admin_consent_workflow_enabled import (
|
||||
entra_admin_consent_workflow_enabled,
|
||||
from prowler.providers.microsoft365.services.entra.entra_enterpriseapps_admin_consent_workflow_enabled.entra_enterpriseapps_admin_consent_workflow_enabled import (
|
||||
entra_enterpriseapps_admin_consent_workflow_enabled,
|
||||
)
|
||||
|
||||
check = entra_admin_consent_workflow_enabled()
|
||||
check = entra_enterpriseapps_admin_consent_workflow_enabled()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 0
|
||||
@@ -6,7 +6,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_dynamic_group_for_guests_created:
|
||||
class Test_entra_groups_dynamicgroup_for_guests_created:
|
||||
def test_no_groups(self):
|
||||
"""
|
||||
Test when no groups exist:
|
||||
@@ -21,15 +21,15 @@ class Test_entra_dynamic_group_for_guests_created:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created import (
|
||||
entra_dynamic_group_for_guests_created,
|
||||
from prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created import (
|
||||
entra_groups_dynamicgroup_for_guests_created,
|
||||
)
|
||||
|
||||
check = entra_dynamic_group_for_guests_created()
|
||||
check = entra_groups_dynamicgroup_for_guests_created()
|
||||
result = check.execute()
|
||||
assert len(result) == 0
|
||||
|
||||
@@ -46,7 +46,7 @@ class Test_entra_dynamic_group_for_guests_created:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
@@ -59,11 +59,11 @@ class Test_entra_dynamic_group_for_guests_created:
|
||||
)
|
||||
]
|
||||
|
||||
from prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created import (
|
||||
entra_dynamic_group_for_guests_created,
|
||||
from prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created import (
|
||||
entra_groups_dynamicgroup_for_guests_created,
|
||||
)
|
||||
|
||||
check = entra_dynamic_group_for_guests_created()
|
||||
check = entra_groups_dynamicgroup_for_guests_created()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -88,7 +88,7 @@ class Test_entra_dynamic_group_for_guests_created:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
@@ -101,11 +101,11 @@ class Test_entra_dynamic_group_for_guests_created:
|
||||
)
|
||||
]
|
||||
|
||||
from prowler.providers.microsoft365.services.entra.entra_dynamic_group_for_guests_created.entra_dynamic_group_for_guests_created import (
|
||||
entra_dynamic_group_for_guests_created,
|
||||
from prowler.providers.microsoft365.services.entra.entra_groups_dynamicgroup_for_guests_created.entra_groups_dynamicgroup_for_guests_created import (
|
||||
entra_groups_dynamicgroup_for_guests_created,
|
||||
)
|
||||
|
||||
check = entra_dynamic_group_for_guests_created()
|
||||
check = entra_groups_dynamicgroup_for_guests_created()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -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
|
||||
@@ -10,7 +10,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
class Test_entra_users_thirdparty_integrated_apps_not_allowed:
|
||||
def test_entra_no_authorization_policy(self):
|
||||
entra_client = mock.MagicMock
|
||||
entra_client.audited_tenant = "audited_tenant"
|
||||
@@ -21,17 +21,17 @@ class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_thirdparty_integrated_apps_not_allowed,
|
||||
from prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_users_thirdparty_integrated_apps_not_allowed,
|
||||
)
|
||||
|
||||
entra_client.authorization_policy = None
|
||||
|
||||
check = entra_thirdparty_integrated_apps_not_allowed()
|
||||
check = entra_users_thirdparty_integrated_apps_not_allowed()
|
||||
result = check.execute()
|
||||
assert len(result) == 0
|
||||
|
||||
@@ -47,15 +47,15 @@ class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
AuthorizationPolicy,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_thirdparty_integrated_apps_not_allowed,
|
||||
from prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_users_thirdparty_integrated_apps_not_allowed,
|
||||
)
|
||||
|
||||
role_permissions = DefaultUserRolePermissions(allowed_to_create_apps=False)
|
||||
@@ -66,7 +66,7 @@ class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
default_user_role_permissions=role_permissions,
|
||||
)
|
||||
|
||||
check = entra_thirdparty_integrated_apps_not_allowed()
|
||||
check = entra_users_thirdparty_integrated_apps_not_allowed()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -91,15 +91,15 @@ class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
"prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed.entra_client",
|
||||
new=entra_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.entra.entra_service import (
|
||||
AuthorizationPolicy,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.entra.entra_thirdparty_integrated_apps_not_allowed.entra_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_thirdparty_integrated_apps_not_allowed,
|
||||
from prowler.providers.microsoft365.services.entra.entra_users_thirdparty_integrated_apps_not_allowed.entra_users_thirdparty_integrated_apps_not_allowed import (
|
||||
entra_users_thirdparty_integrated_apps_not_allowed,
|
||||
)
|
||||
|
||||
role_permissions = DefaultUserRolePermissions(allowed_to_create_apps=True)
|
||||
@@ -110,7 +110,7 @@ class Test_entra_thirdparty_integrated_apps_not_allowed:
|
||||
default_user_role_permissions=role_permissions,
|
||||
)
|
||||
|
||||
check = entra_thirdparty_integrated_apps_not_allowed()
|
||||
check = entra_users_thirdparty_integrated_apps_not_allowed()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -9,7 +9,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_sharepoint_external_sharing_managed:
|
||||
class Test_sharepoint_settings_external_sharing_managed:
|
||||
def test_external_sharing_invalid_mode(self):
|
||||
"""
|
||||
Test when sharingDomainRestrictionMode is set to an invalid value (not "allowList" ni "blockList"):
|
||||
@@ -23,12 +23,12 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -41,7 +41,7 @@ class Test_sharepoint_external_sharing_managed:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -68,12 +68,12 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -86,7 +86,7 @@ class Test_sharepoint_external_sharing_managed:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -113,12 +113,12 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -131,7 +131,7 @@ class Test_sharepoint_external_sharing_managed:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -158,12 +158,12 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -176,7 +176,7 @@ class Test_sharepoint_external_sharing_managed:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -203,12 +203,12 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -221,7 +221,7 @@ class Test_sharepoint_external_sharing_managed:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -250,14 +250,14 @@ class Test_sharepoint_external_sharing_managed:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_managed.sharepoint_external_sharing_managed import (
|
||||
sharepoint_external_sharing_managed,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_managed.sharepoint_settings_external_sharing_managed import (
|
||||
sharepoint_settings_external_sharing_managed,
|
||||
)
|
||||
|
||||
check = sharepoint_external_sharing_managed()
|
||||
check = sharepoint_settings_external_sharing_managed()
|
||||
result = check.execute()
|
||||
assert len(result) == 0
|
||||
@@ -9,7 +9,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_sharepoint_external_sharing_restricted:
|
||||
class Test_sharepoint_settings_external_sharing_restricted:
|
||||
def test_external_sharing_restricted(self):
|
||||
"""
|
||||
Test when sharingCapability is set to an allowed value (e.g. "ExternalUserSharingOnly"):
|
||||
@@ -23,12 +23,12 @@ class Test_sharepoint_external_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted import (
|
||||
sharepoint_external_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted import (
|
||||
sharepoint_settings_external_sharing_restricted,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -41,7 +41,7 @@ class Test_sharepoint_external_sharing_restricted:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_restricted()
|
||||
check = sharepoint_settings_external_sharing_restricted()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -66,12 +66,12 @@ class Test_sharepoint_external_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted import (
|
||||
sharepoint_external_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted import (
|
||||
sharepoint_settings_external_sharing_restricted,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -84,7 +84,7 @@ class Test_sharepoint_external_sharing_restricted:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_external_sharing_restricted()
|
||||
check = sharepoint_settings_external_sharing_restricted()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -111,14 +111,14 @@ class Test_sharepoint_external_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_external_sharing_restricted.sharepoint_external_sharing_restricted import (
|
||||
sharepoint_external_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_external_sharing_restricted.sharepoint_settings_external_sharing_restricted import (
|
||||
sharepoint_settings_external_sharing_restricted,
|
||||
)
|
||||
|
||||
check = sharepoint_external_sharing_restricted()
|
||||
check = sharepoint_settings_external_sharing_restricted()
|
||||
result = check.execute()
|
||||
assert len(result) == 0
|
||||
@@ -9,7 +9,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_sharepoint_guest_sharing_restricted:
|
||||
class Test_sharepoint_settings_guest_sharing_restricted:
|
||||
def test_guest_sharing_restricted(self):
|
||||
"""
|
||||
Test when resharingEnabled is False:
|
||||
@@ -23,12 +23,12 @@ class Test_sharepoint_guest_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted import (
|
||||
sharepoint_guest_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted import (
|
||||
sharepoint_settings_guest_sharing_restricted,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -41,7 +41,7 @@ class Test_sharepoint_guest_sharing_restricted:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_guest_sharing_restricted()
|
||||
check = sharepoint_settings_guest_sharing_restricted()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -67,12 +67,12 @@ class Test_sharepoint_guest_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted import (
|
||||
sharepoint_guest_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted import (
|
||||
sharepoint_settings_guest_sharing_restricted,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
@@ -85,7 +85,7 @@ class Test_sharepoint_guest_sharing_restricted:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_guest_sharing_restricted()
|
||||
check = sharepoint_settings_guest_sharing_restricted()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 1
|
||||
@@ -113,15 +113,15 @@ class Test_sharepoint_guest_sharing_restricted:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_guest_sharing_restricted.sharepoint_guest_sharing_restricted import (
|
||||
sharepoint_guest_sharing_restricted,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_guest_sharing_restricted.sharepoint_settings_guest_sharing_restricted import (
|
||||
sharepoint_settings_guest_sharing_restricted,
|
||||
)
|
||||
|
||||
check = sharepoint_guest_sharing_restricted()
|
||||
check = sharepoint_settings_guest_sharing_restricted()
|
||||
result = check.execute()
|
||||
|
||||
assert len(result) == 0
|
||||
@@ -6,7 +6,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import (
|
||||
)
|
||||
|
||||
|
||||
class Test_sharepoint_modern_authentication_required:
|
||||
class Test_sharepoint_settings_modern_authentication_required:
|
||||
def test_sharepoint_modern_authentication_disabled(self):
|
||||
"""
|
||||
Test when legacyAuth is False:
|
||||
@@ -20,16 +20,16 @@ class Test_sharepoint_modern_authentication_required:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required import (
|
||||
sharepoint_modern_authentication_required,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_service import (
|
||||
SharePointSettings,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required import (
|
||||
sharepoint_settings_modern_authentication_required,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
sharingCapability="ExternalUserAndGuestSharing",
|
||||
@@ -41,7 +41,7 @@ class Test_sharepoint_modern_authentication_required:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_modern_authentication_required()
|
||||
check = sharepoint_settings_modern_authentication_required()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "PASS"
|
||||
@@ -66,16 +66,16 @@ class Test_sharepoint_modern_authentication_required:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required import (
|
||||
sharepoint_modern_authentication_required,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_service import (
|
||||
SharePointSettings,
|
||||
)
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required import (
|
||||
sharepoint_settings_modern_authentication_required,
|
||||
)
|
||||
|
||||
sharepoint_client.settings = SharePointSettings(
|
||||
sharingCapability="ExternalUserAndGuestSharing",
|
||||
@@ -87,7 +87,7 @@ class Test_sharepoint_modern_authentication_required:
|
||||
)
|
||||
sharepoint_client.tenant_domain = DOMAIN
|
||||
|
||||
check = sharepoint_modern_authentication_required()
|
||||
check = sharepoint_settings_modern_authentication_required()
|
||||
result = check.execute()
|
||||
assert len(result) == 1
|
||||
assert result[0].status == "FAIL"
|
||||
@@ -114,14 +114,14 @@ class Test_sharepoint_modern_authentication_required:
|
||||
return_value=set_mocked_microsoft365_provider(),
|
||||
),
|
||||
mock.patch(
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required.sharepoint_client",
|
||||
"prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required.sharepoint_client",
|
||||
new=sharepoint_client,
|
||||
),
|
||||
):
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_modern_authentication_required.sharepoint_modern_authentication_required import (
|
||||
sharepoint_modern_authentication_required,
|
||||
from prowler.providers.microsoft365.services.sharepoint.sharepoint_settings_modern_authentication_required.sharepoint_settings_modern_authentication_required import (
|
||||
sharepoint_settings_modern_authentication_required,
|
||||
)
|
||||
|
||||
check = sharepoint_modern_authentication_required()
|
||||
check = sharepoint_settings_modern_authentication_required()
|
||||
result = check.execute()
|
||||
assert len(result) == 0
|
||||
Reference in New Issue
Block a user