GSuite User Device Compromised


Description

GSuite reported a user's device has been compromised.

Query · python

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"
    )

Analyst notes

Have the user change their passwords and reset the device.

Raw source GSuite User Device Compromised · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
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"
    )

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.