Techniques
Sample rules
Google Workspace Object Copied from External Drive with App Consent
- source: elastic
- technicques:
- T1098
- T1204
- T1566
Description
Detects when a user copies a Google document, spreadsheet, form, or script from an external Drive into their Workspace Drive and shortly after authorizes a custom Google OAuth application. Adversaries may send spearphishing links with a /copy URI parameter so the victim replicates a malicious object locally. Container-bound Apps Script can then execute on open and prompt the user for OAuth consent, granting the attacker’s application access to Workspace data.
Detection logic
sequence by source.user.email with maxspan=3m
[file where data_stream.dataset == "google_workspace.drive" and event.action == "copy" and
/* Should only match if the object lives in a Drive that is external to the user's GWS organization */
google_workspace.drive.owner_is_team_drive == false and google_workspace.drive.copy_type == "external" and
/* Google Script, Forms, Sheets and Document can have container-bound scripts */
google_workspace.drive.file.type: ("script", "form", "spreadsheet", "document")]
[any where data_stream.dataset == "google_workspace.token" and event.action == "authorize" and
/* Ensures application ID references custom app in Google Workspace and not GCP */
google_workspace.token.client.id : "*apps.googleusercontent.com"]