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