Query Details
id: 8b4e3d9f-2c5d-4f6b-ad3e-9c2e8f7b5a08
name: GWS Alerts - Account Warnings + Drive/Takeout Activity (Exfil Chain)
description: |
Hunts for accounts that received a Google identity AccountWarning
(suspicious login / leaked password / suspended) and shortly after generated
a DLP, Drive ransomware, or Domain-wide Takeout alert. Possible
account-takeover-to-exfiltration chain.
requiredDataConnectors:
- connectorId: GoogleWorkspaceDefinition
dataTypes:
- GWSAlerts_CL
tactics:
- InitialAccess
- Exfiltration
relevantTechniques:
- T1078.004
- T1567
- T1530
query: |
let warnings =
GWSAlerts_CL
| where Source == "Google identity" or AlertDataType endswith "AccountWarning"
| extend User = tostring(AlertData.email)
| project WarnTime = TimeGenerated, User, WarnType = AlertType, WarnId = AlertId;
let exfil =
GWSAlerts_CL
| where AlertDataType endswith_cs "DlpRuleViolation"
or AlertDataType endswith_cs "DriveSyncStateChanged"
or AlertDataType endswith_cs "DomainWideTakeoutInitiated"
| extend User = tostring(coalesce(AlertData.email,
AlertData.resourceOwner,
AlertData.initiator))
| project ExfilTime = TimeGenerated, User, ExfilType = AlertType,
ExfilSource = Source, ExfilId = AlertId,
ExfilLink = SecurityInvestigationToolLink;
warnings
| join kind=inner exfil on User
| where ExfilTime between (WarnTime .. WarnTime + 48h)
| project WarnTime, ExfilTime, User, WarnType, ExfilSource, ExfilType,
WarnId, ExfilId, ExfilLink
| order by ExfilTime desc
tags:
- GoogleWorkspace
- AccountTakeover
- Exfiltration
This query is designed to identify potential security incidents involving Google Workspace accounts. It specifically looks for situations where an account receives a warning related to suspicious activity (such as a suspicious login, leaked password, or account suspension) and then shortly afterward triggers alerts related to data exfiltration activities, like data loss prevention (DLP) violations, Drive ransomware, or domain-wide data takeout.
Here's a breakdown of the query:
Data Sources: It uses data from Google Workspace alerts, focusing on two types of alerts:
Process:
Timeframe: It filters the results to include only those cases where the exfiltration alert occurs within 48 hours after the account warning.
Output: The final output includes details such as the times of the warnings and exfiltration alerts, user information, types of warnings and exfiltration activities, and relevant alert IDs and investigation links.
Purpose: This query helps in identifying potential account takeover incidents that lead to data exfiltration, allowing security teams to investigate and respond to these threats promptly.

David Alonso
Released: May 7, 2026
Tables
Keywords
Operators