From 0db303b92633a79f8727d51e02e597d07135e5a5 Mon Sep 17 00:00:00 2001 From: HugoPBrito Date: Thu, 13 Mar 2025 20:56:34 +0100 Subject: [PATCH] refactor: rename entra_thirdparty_integrated_apps_not_allowed --- .../__init__.py | 0 ...integrated_apps_not_allowed.metadata.json} | 2 +- ...thirdparty_integrated_apps_not_allowed.py} | 2 +- ...party_integrated_apps_not_allowed_test.py} | 26 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) rename prowler/providers/microsoft365/services/entra/{entra_thirdparty_integrated_apps_not_allowed => entra_user_thirdparty_integrated_apps_not_allowed}/__init__.py (100%) rename prowler/providers/microsoft365/services/entra/{entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.metadata.json => entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.metadata.json} (96%) rename prowler/providers/microsoft365/services/entra/{entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.py => entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.py} (97%) rename tests/providers/microsoft365/services/entra/{entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed_test.py => entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed_test.py} (78%) diff --git a/prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/__init__.py b/prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/__init__.py similarity index 100% rename from prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/__init__.py rename to prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/__init__.py diff --git a/prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.metadata.json b/prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.metadata.json similarity index 96% rename from prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.metadata.json rename to prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.metadata.json index 1729645e05..9fb7a29fdd 100644 --- a/prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.metadata.json +++ b/prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.metadata.json @@ -1,6 +1,6 @@ { "Provider": "microsoft365", - "CheckID": "entra_thirdparty_integrated_apps_not_allowed", + "CheckID": "entra_user_thirdparty_integrated_apps_not_allowed", "CheckTitle": "Ensure third party integrated applications are not allowed", "CheckType": [], "ServiceName": "entra", diff --git a/prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.py b/prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.py similarity index 97% rename from prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.py rename to prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.py index 36ce95286c..afdc76e7d2 100644 --- a/prowler/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed.py +++ b/prowler/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed.py @@ -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_user_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. diff --git a/tests/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed_test.py b/tests/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed_test.py similarity index 78% rename from tests/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed_test.py rename to tests/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed_test.py index 9d0d112b6a..68dd97e6c6 100644 --- a/tests/providers/microsoft365/services/entra/entra_thirdparty_integrated_apps_not_allowed/entra_thirdparty_integrated_apps_not_allowed_test.py +++ b/tests/providers/microsoft365/services/entra/entra_user_thirdparty_integrated_apps_not_allowed/entra_user_thirdparty_integrated_apps_not_allowed_test.py @@ -10,7 +10,7 @@ from tests.providers.microsoft365.microsoft365_fixtures import ( ) -class Test_entra_thirdparty_integrated_apps_not_allowed: +class Test_entra_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_thirdparty_integrated_apps_not_allowed import ( + entra_user_thirdparty_integrated_apps_not_allowed, ) entra_client.authorization_policy = None - check = entra_thirdparty_integrated_apps_not_allowed() + check = entra_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_thirdparty_integrated_apps_not_allowed import ( + entra_user_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_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_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_user_thirdparty_integrated_apps_not_allowed.entra_user_thirdparty_integrated_apps_not_allowed import ( + entra_user_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_user_thirdparty_integrated_apps_not_allowed() result = check.execute() assert len(result) == 1 assert result[0].status == "FAIL"