Cloud.GoogleWorkspace.MassDownload
Type: Server
Hunts the Google Drive audit log for data theft: accounts that downloaded an unusual number of files within an hour.
Needs the admin.reports.audit.readonly scope.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
GWSSecret |
string | Name of the “Google Workspace Creds” secret for the domain. | |
LookbackHours |
int | 168 |
|
FilesPerHour |
int | 300 |
Source
Defined in artifacts/definitions/Cloud/GoogleWorkspace/MassDownload.yaml.
name: Cloud.GoogleWorkspace.MassDownload
description: |
Hunts the Google Drive audit log for data theft: accounts that
downloaded an unusual number of files within an hour.
Needs the `admin.reports.audit.readonly` scope.
type: SERVER
parameters:
- name: GWSSecret
description: Name of the "Google Workspace Creds" secret for the domain.
- name: LookbackHours
type: int
default: 168
- name: FilesPerHour
type: int
default: 300
sources:
- query: |
LET Downloads = SELECT timestamp(string=Time).Unix AS Epoch, Actor AS User, IPAddress,
Parameters.doc_title AS Title, Parameters.owner AS Owner
FROM gws_reports(secret=GWSSecret, application="drive", event_name="download",
start=now() - LookbackHours * 3600)
LET PerHour = SELECT User, int(int=Epoch / 3600) AS Hour, count() AS Files,
enumerate(items=IPAddress) AS IPs, enumerate(items=Title) AS Titles,
enumerate(items=Owner) AS Owners, min(item=Epoch) AS First
FROM Downloads
GROUP BY User, Hour
SELECT timestamp(epoch=First) AS Time,
if(condition=Files >= FilesPerHour * 3, then="high", else="medium") AS Severity,
"Mass file download" AS Detection,
User, IPs[0] AS IPAddress, "" AS Location, "" AS Device,
dict(FilesInHour=Files,
Addresses=items(item=to_dict(item={SELECT _value AS _key, 1 AS _value FROM foreach(row=IPs)}))._key,
Owners=items(item=to_dict(item={SELECT _value AS _key, 1 AS _value FROM foreach(row=Owners)}))._key,
SampleFiles=Titles[:20]) AS Details
FROM PerHour
WHERE Files >= FilesPerHour