fix(googleworkspace): use per-service resources for Directory (#11176)

This commit is contained in:
lydiavilchez
2026-05-14 13:07:06 +02:00
committed by GitHub
parent 3d65208fd3
commit bf4fd8fabd
5 changed files with 11 additions and 6 deletions
+1
View File
@@ -19,6 +19,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
### 🐞 Fixed
- Google Workspace Directory checks sharing a single resource row, causing the service field to be overwritten by the last check executed [(#11176)](https://github.com/prowler-cloud/prowler/pull/11176)
- Google Workspace Calendar and Drive services sharing a single resource row, causing the service field to be overwritten by the last check executed [(#11161)](https://github.com/prowler-cloud/prowler/pull/11161)
- `zone_waf_enabled` check for Cloudflare provider now appends a plan-aware hint to the FAIL `status_extended`: a possible-false-positive note on paid plans (Pro, Business, Enterprise) where the legacy `waf` zone setting can read `off` even though WAF managed rulesets are deployed via the dashboard, and a "not available on the Cloudflare Free plan" note on Free zones [(#9896)](https://github.com/prowler-cloud/prowler/pull/9896)
- Google Workspace Gmail checks sharing a single resource row, causing the service field to be overwritten by the last check executed [(#11169)](https://github.com/prowler-cloud/prowler/pull/11169)
@@ -24,6 +24,9 @@ class directory_super_admin_count(Check):
report = CheckReportGoogleWorkspace(
metadata=self.metadata(),
resource=directory_client.provider.domain_resource,
resource_id="directoryUsers",
resource_name="Directory Users",
customer_id=directory_client.provider.identity.customer_id,
)
if 2 <= admin_count <= 4:
@@ -47,6 +47,9 @@ class directory_super_admin_only_admin_roles(Check):
report = CheckReportGoogleWorkspace(
metadata=self.metadata(),
resource=directory_client.provider.domain_resource,
resource_id="directoryUsers",
resource_name="Directory Users",
customer_id=directory_client.provider.identity.customer_id,
)
report.status = "PASS"
report.status_extended = (
@@ -3,7 +3,6 @@ from unittest.mock import patch
from prowler.providers.googleworkspace.services.directory.directory_service import User
from tests.providers.googleworkspace.googleworkspace_fixtures import (
CUSTOMER_ID,
DOMAIN,
set_mocked_googleworkspace_provider,
)
@@ -54,8 +53,8 @@ class TestDirectorySuperAdminCount:
assert findings[0].status == "PASS"
assert "2 super administrator(s)" in findings[0].status_extended
assert "within the recommended range" in findings[0].status_extended
assert findings[0].resource_name == DOMAIN
assert findings[0].resource_id == CUSTOMER_ID
assert findings[0].resource_name == "Directory Users"
assert findings[0].resource_id == "directoryUsers"
assert findings[0].customer_id == CUSTOMER_ID
assert findings[0].resource == mock_provider.domain_resource.dict()
@@ -6,7 +6,6 @@ from prowler.providers.googleworkspace.services.directory.directory_service impo
)
from tests.providers.googleworkspace.googleworkspace_fixtures import (
CUSTOMER_ID,
DOMAIN,
set_mocked_googleworkspace_provider,
)
@@ -90,8 +89,8 @@ class TestDirectorySuperAdminOnlyAdminRoles:
assert len(findings) == 1
assert findings[0].status == "PASS"
assert "used only for super admin activities" in findings[0].status_extended
assert findings[0].resource_name == DOMAIN
assert findings[0].resource_id == CUSTOMER_ID
assert findings[0].resource_name == "Directory Users"
assert findings[0].resource_id == "directoryUsers"
assert findings[0].customer_id == CUSTOMER_ID
assert findings[0].resource == mock_provider.domain_resource.dict()