AnalysisType: rule
Filename: gsuite_mobile_device_compromise.py
RuleID: "GSuite.DeviceCompromise"
DisplayName: "GSuite User Device Compromised"
Enabled: true
LogTypes:
- GSuite.ActivityEvent
Tags:
- GSuite
Severity: Medium
Description: >
GSuite reported a user's device has been compromised.
Reference: https://support.google.com/a/answer/7562165?hl=en&sjid=864417124752637253-EU
Runbook: >
Have the user change their passwords and reset the device.
SummaryAttributes:
- actor:email
Tests:
- Name: Normal Mobile Event
ExpectedResult: false
Log:
{
"id": { "applicationName": "mobile" },
"actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
"type": "device_updates",
"name": "DEVICE_REGISTER_UNREGISTER_EVENT",
"parameters": { "USER_EMAIL": "homer.simpson@example.io" },
}
- Name: Suspicious Activity Shows not Compromised
ExpectedResult: false
Log:
{
"id": { "applicationName": "mobile" },
"actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
"type": "device_updates",
"name": "DEVICE_COMPROMISED_EVENT",
"parameters":
{
"USER_EMAIL": "homer.simpson@example.io",
"DEVICE_COMPROMISED_STATE": "NOT_COMPROMISED",
},
}
- Name: Suspicious Activity Shows Compromised
ExpectedResult: true
Log:
{
"id": { "applicationName": "mobile" },
"actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
"type": "device_updates",
"name": "DEVICE_COMPROMISED_EVENT",
"parameters":
{
"USER_EMAIL": "homer.simpson@example.io",
"DEVICE_COMPROMISED_STATE": "COMPROMISED",
},
}
# ------ paired body: gsuite_mobile_device_compromise.py ------
def rule(event):
if event.deep_get("id", "applicationName") != "mobile":
return False
if event.get("name") == "DEVICE_COMPROMISED_EVENT":
return bool(event.deep_get("parameters", "DEVICE_COMPROMISED_STATE") == "COMPROMISED")
return False
def title(event):
return (
f"User [{event.deep_get('parameters', 'USER_EMAIL', default='<UNKNOWN_USER>')}]'s "
f"device was compromised"
)