Google Workspace User Sign-in from Atypical Device Type
This rule detects when a Google Workspace user authenticates from a device type that hasn't been observed for that user in the past 14 days, potentially indicating account compromise via AiTM kits or stolen OAuth refresh tokens.
This detection rule identifies anomalous Google Workspace device registrations, specifically focusing on deviations from a user’s typical device type. It leverages Google Workspace device logs to detect when a user authenticates from a device type (e.g., WINDOWS, MAC, ANDROID, IOS, LINUX) that has not been associated with them within a 14-day historical window. The rule does not flag new physical device enrollments, as the Google Reports API generates fresh device IDs on each event. Instead, it highlights situations where an attacker, using compromised credentials obtained through AiTM kits or stolen OAuth tokens, accesses a Workspace account from a device type different from the user’s established pattern. This is a strong indicator of compromise, as these kits often relay sessions through unusual device fingerprints, such as a Windows session for a macOS user, or concurrent sessions from different OS types. Because refresh tokens persist across password resets, focus on token revocation for remediation.
Attack Chain
- Attacker compromises a user’s Google Workspace credentials through AiTM phishing or steals an OAuth refresh token.
- Attacker uses the stolen credentials or token to authenticate to Google Workspace.
- Google Workspace logs a
DEVICE_REGISTER_UNREGISTER_EVENTwith a newgoogle_workspace.device.idassociated with the session. - The attacker accesses Google Workspace resources like Gmail, Drive, or Calendar.
- The attacker may create new OAuth tokens for persistence.
- The attacker exfiltrates sensitive data.
- The attacker may attempt to move laterally to other cloud resources accessible via the compromised account.
- The attacker persists by maintaining access through the stolen credentials and newly created OAuth tokens.
Impact
A successful attack can result in unauthorized access to sensitive data within Google Workspace, including emails, documents, and calendar information. Attackers can exfiltrate data, escalate privileges, and potentially move laterally to other cloud resources. The compromise can persist even after a password reset due to the nature of OAuth refresh tokens. Affected sectors depend on the victim organization but may include any industry using Google Workspace.
Recommendation
- Deploy the Sigma rule “Google Workspace User Sign-in from Atypical Device Type” to detect anomalous device registrations (rule).
- When an atypical device registration is detected, immediately suspend the user, revoke all OAuth tokens, reset the password, and clear recovery email/phone, as detailed in the rule’s “Response and remediation” section.
- Investigate
logs-google_workspace.loginevents for the same user in the 24 hours leading up to the device registration, looking for suspicious ASN, country, and user agent patterns, as described in the rule’s “Possible investigation steps” section. - Monitor
logs-google_workspace.tokenevents forevent.action: "authorize"events around the device registration time to identify newly minted OAuth tokens (rule’s “Possible investigation steps”).
Detection coverage 2
Google Workspace User Sign-in from Atypical Device Type
mediumDetects Google Workspace user sign-in from a previously unseen device type based on Google Workspace device logs.
Google Workspace Token Authorizations Around Atypical Device Registration
mediumDetects OAuth token authorizations for a user shortly after an atypical device registration, potentially indicating unauthorized token minting.
Detection queries are available on the platform. Get full rules →