GSuite Drive Many Documents Deleted
Description
Detects when a user moves more than 10 distinct documents to the trash in Google Drive within 60 minutes. This may indicate accidental or malicious bulk deletion of files.
Query · python
def rule(event):
if event.deep_get("id", "applicationName") != "drive":
return False
return event.get("name") == "trash"
def title(event):
user = event.deep_get("actor", "email", default="<UNKNOWN_USER>")
return f"Google Workspace: User [{user}] deleted many documents from Google Drive"
def dedup(event):
return event.deep_get("actor", "email", default="")
def unique(event):
return event.deep_get("parameters", "doc_id") or None
def severity(event):
visibility = event.deep_get("parameters", "visibility", default="")
if visibility == "shared_externally":
return "HIGH"
return "DEFAULT"
def alert_context(event):
return {
"user": event.deep_get("actor", "email"),
"doc_title": event.deep_get("parameters", "doc_title"),
"doc_type": event.deep_get("parameters", "doc_type"),
"visibility": event.deep_get("parameters", "visibility"),
}
Analyst notes
- Query GSuite.ActivityEvent for all trash events by actor:email in the 2 hours around this alert to identify the full list of parameters:doc_title values deleted and whether they belong to shared drives
- Check parameters:visibility on the deleted documents to determine if externally or internally shared files were affected, and assess the business impact of the deletions
- Search for other suspicious drive activity by this user in the past 24 hours, including bulk downloads, sharing changes, or access to sensitive documents prior to deletion