PayFit Payroll Completion Health Gate
Check whether a PayFit payroll period has completed, alert Slack only once it is overdue past a deadline day, and log a governance audit trail.
Audits Google Workspace privileged role assignments to detect unauthorized super admin escalations and enforce zero-trust least-privilege standards.
The Google Workspace Super Administrator role grants unrestricted control over enterprise identity, emails, shared drives, device policies, and security configurations. Privilege escalation, rogue administrators, or accidental role grants can expose an enterprise to total tenant takeover. This sentinel continuously interrogates the Google Workspace Admin SDK Directory API, monitors privileged role assignments, and immediately alerts Security Operations Center (SOC) teams on Slack whenever super admin accounts exceed baseline counts.
0 * * * *) or triggers on-demand via manual execution and security webhooks./admin/directory/v1/customer/{customerId}/roleAssignments) using an OAuth2 service token._SUPER_ADMIN_ROLE and extracts assignee identifiers.io.kestra.plugin.core.flow.If task evaluates whether super_admins_count exceeds max_tolerated_super_admins.SlackIncomingWebhook listing active administrator IDs and counts.flowchart TD
A[hourly_super_admin_audit Schedule Trigger] --> B[scan_super_admin_roles Python Script]
B --> C[check_super_admin_threshold Flowable If]
C -- Admins > Threshold --> D[notify_slack_security_team Webhook]
C -- Compliant Baseline --> E[log_super_admin_audit Log]
D --> E
E --> F[export_super_admin_manifest Return]
| Name | Type | Default | Description |
|---|---|---|---|
customer_id |
STRING |
my_customer |
Google Workspace Directory API customer identifier, defaults to current authenticated domain. |
alert_on_new_super_admin |
BOOL |
true |
Whether to dispatch alerts when the number of super administrators exceeds organizational baselines. |
max_tolerated_super_admins |
INT |
3 |
Maximum allowable count of privileged super admin assignments before triggering incident alerts. |
{{ outputs.scan_super_admin_roles.vars.total_role_assignments }}: Total number of role assignments evaluated in the Google Workspace domain.{{ outputs.scan_super_admin_roles.vars.super_admins_count }}: Number of active users assigned the super admin role.{{ outputs.scan_super_admin_roles.vars.super_admins_details }}: Serialized JSON list of super admin assignment records.{{ outputs.export_super_admin_manifest.value }}: Structured dictionary containing the consolidated privileged access audit report.admin.googleapis.com.https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly.GOOGLE_WORKSPACE_ADMIN_TOKEN: OAuth2 access token or bearer credential authorized to query the Google Workspace Admin SDK.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL used for sending security alerts.GOOGLE_WORKSPACE_ADMIN_TOKEN and SLACK_WEBHOOK_URL in your Kestra Secret storage.company.security namespace.max_tolerated_super_admins with your organizational policy threshold (e.g., 2 or 3).my_customer automatically targets the Google Workspace account associated with the service account credentials; verify proper account binding if managing multiple domains.