feat(googleworkspace): add rules service checks#11379
Conversation
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Compliance Mapping ReviewThis PR adds new checks. Please verify that they have been mapped to the relevant compliance framework requirements. New checks already mapped in this PR
Use the |
|
✅ All necessary |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11379 +/- ##
==========================================
+ Coverage 93.96% 96.32% +2.36%
==========================================
Files 237 93 -144
Lines 34901 2531 -32370
==========================================
- Hits 32793 2438 -30355
+ Misses 2108 93 -2015
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…s-for-google-workspace-provider
🔒 Container Security ScanImage: 📊 Vulnerability Summary
8 package(s) affected
|
danibarranqueroo
left a comment
There was a problem hiding this comment.
Two small suggestions:
-
All 8 checks set
resource_id="system_defined_alert". Two issues:- camelCase, not snake_case: every other GWS service uses camelCase:
calendarPolicies,chatPolicies,securityPolicies,drivePolicies, etc. - Same
resource_idacross all 8 checks will collapse them into a single row in the API (theresourcestable is keyed byresource_id, soresource_namegets overwritten by whichever check ran last).
- camelCase, not snake_case: every other GWS service uses camelCase:
Since each SystemDefinedAlert is a distinct resource, the cleanest fix is a per-rule id:
resource_id=f"systemDefinedAlert/{RULE_NAME}"- All 8 checks use
"forensics-ready", but I think"logging"is a better fit and matches existing precedent.
In the rest of Prowler, "forensics-ready" is used for systems that capture the evidence for investigation (GuardDuty, CloudTrail). "logging" is used for checks that verify alerting on security events is configured.
Something like this works for me for example:
- Credential/auth rules (
password_changed,leaked_password,admin_privilege_granted,suspicious_login,suspicious_programmatic_login,suspicious_activity_suspension):["logging", "identity-access"] gmail_employee_spoofing:["logging", "email-security"]— matches the rest ofgmail/government_backed_attacks:["logging"]
Context
Rules service checks for the Google Workspace provider. This PR implements 8 CIS controls from Section 6 of the CIS Google Workspace Foundations Benchmark v1.3.0, covering system-defined alert rules that notify super administrators when security relevant events occur in the domain.
Description
Implements 8 checks in a new
rulesservice using the Cloud Identity Policy API (rule.system_defined_alertsnamespace):rules_password_changed_alert_configured: PASS if alert is ACTIVE, email notifications ON, and recipients include all super admins. FAIL if absent (default: INACTIVE)rules_government_backed_attacks_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)rules_suspicious_activity_suspension_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)rules_admin_privilege_granted_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: INACTIVE)rules_suspicious_programmatic_login_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)rules_suspicious_login_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)rules_leaked_password_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)rules_gmail_employee_spoofing_alert_configured: PASS if all 3 conditions met. FAIL if absent (default: ACTIVE but no email notifications)Each check verifies 3 conditions: alert is ACTIVE and sent to the alert center, email notifications are enabled, and recipients include all super administrators. This goes beyond ScubaGoggles, which only checks active/inactive state.
The
rule.system_defined_alertssetting only appears in the Policy API when an admin has explicitly modified a rule. Unmodified rules running at Google defaults are handled by the service layer, which applies the documented default state for each rule.CIS vs API gap: The Policy API does not expose severity level or email notification toggle as separate fields, severity and recipients are nested inside
action.alertCenterAction. All 3 CIS conditions are fully verifiable from this structure.Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.