GSuite User Device Unlock Failures


Description

Someone failed to unlock a user's device multiple times in quick succession.

Query · python

MAX_UNLOCK_ATTEMPTS = 10


def rule(event):
    if event.deep_get("id", "applicationName") != "mobile":
        return False

    if event.get("name") == "FAILED_PASSWORD_ATTEMPTS_EVENT":
        attempts = event.deep_get("parameters", "FAILED_PASSWD_ATTEMPTS")
        return int(attempts if attempts else 0) > MAX_UNLOCK_ATTEMPTS

    return False


def title(event):
    return (
        f"User [{event.deep_get('actor', 'email', default='<UNKNOWN_USER>')}]"
        f"'s device had multiple failed unlock attempts"
    )

Analyst notes

Verify that these unlock attempts came from the user, and not a malicious actor which has acquired the user's device.

Raw source GSuite User Device Unlock Failures · Panther Python
Esc
Published by panther-labs/panther-analysis ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
AnalysisType: rule
Filename: gsuite_mobile_device_screen_unlock_fail.py
RuleID: "GSuite.DeviceUnlockFailure"
DisplayName: "GSuite User Device Unlock Failures"
Enabled: true
LogTypes:
  - GSuite.ActivityEvent
Tags:
  - GSuite
  - Credential Access:Brute Force
Reports:
  MITRE ATT&CK:
    - TA0006:T1110
Severity: Medium
Description: >
  Someone failed to unlock a user's device multiple times in quick succession.
Reference: https://support.google.com/a/answer/6350074?hl=en
Runbook: >
  Verify that these unlock attempts came from the user, and not a malicious actor which has acquired the user's 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_SYNC_EVENT",
        "parameters": { "USER_EMAIL": "homer.simpson@example.io" },
      }
  - Name: Small Number of Failed Logins
    ExpectedResult: false
    Log:
      {
        "id": { "applicationName": "mobile" },
        "actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
        "type": "device_updates",
        "name": "FAILED_PASSWORD_ATTEMPTS_EVENT",
        "parameters":
          {
            "USER_EMAIL": "homer.simpson@example.io",
            "FAILED_PASSWD_ATTEMPTS": 2,
          },
      }
  - Name: Multiple Failed Login Attempts with int Type
    ExpectedResult: true
    Log:
      {
        "id": { "applicationName": "mobile" },
        "actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
        "type": "device_updates",
        "name": "FAILED_PASSWORD_ATTEMPTS_EVENT",
        "parameters":
          {
            "USER_EMAIL": "homer.simpson@example.io",
            "FAILED_PASSWD_ATTEMPTS": 100,
          },
      }
  - Name: Multiple Failed Login Attempts with String Type
    ExpectedResult: true
    Log:
      {
        "id": { "applicationName": "mobile" },
        "actor": { "callerType": "USER", "email": "homer.simpson@example.io" },
        "type": "device_updates",
        "name": "FAILED_PASSWORD_ATTEMPTS_EVENT",
        "parameters":
          {
            "USER_EMAIL": "homer.simpson@example.io",
            "FAILED_PASSWD_ATTEMPTS": "100",
          },
      }


# ------ paired body: gsuite_mobile_device_screen_unlock_fail.py ------

MAX_UNLOCK_ATTEMPTS = 10


def rule(event):
    if event.deep_get("id", "applicationName") != "mobile":
        return False

    if event.get("name") == "FAILED_PASSWORD_ATTEMPTS_EVENT":
        attempts = event.deep_get("parameters", "FAILED_PASSWD_ATTEMPTS")
        return int(attempts if attempts else 0) > MAX_UNLOCK_ATTEMPTS

    return False


def title(event):
    return (
        f"User [{event.deep_get('actor', 'email', default='<UNKNOWN_USER>')}]"
        f"'s device had multiple failed unlock attempts"
    )

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.