Google Drive Ownership Transferred via Google Workspace

Drive and Docs is a Google Workspace service that allows users to leverage Google Drive and Google Docs. Access to files is based on inherited permissions from the child organizational unit the user belongs to which is scoped by administrators. Typically if a user is removed, their files can be transferred to another user by the administrator. This service can also be abused by adversaries to transfer files to an adversary account for potential exfiltration.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/08/24"
  3integration = ["google_workspace"]
  4maturity = "production"
  5min_stack_comments = "Breaking changes for Google Workspace integration."
  6min_stack_version = "8.4.0"
  7updated_date = "2023/06/22"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Drive and Docs is a Google Workspace service that allows users to leverage Google Drive and Google Docs. Access to files
 13is based on inherited permissions from the child organizational unit the user belongs to which is scoped by
 14administrators. Typically if a user is removed, their files can be transferred to another user by the administrator.
 15This service can also be abused by adversaries to transfer files to an adversary account for potential exfiltration.
 16"""
 17false_positives = [
 18    """
 19    Administrators may transfer file ownership during employee leave or absence to ensure continued operations by a new
 20    or existing employee.
 21    """,
 22]
 23from = "now-130m"
 24index = ["filebeat-*", "logs-google_workspace*"]
 25interval = "10m"
 26language = "kuery"
 27license = "Elastic License v2"
 28name = "Google Drive Ownership Transferred via Google Workspace"
 29note = """## Triage and analysis
 30
 31### Investigating Google Drive Ownership Transferred via Google Workspace
 32
 33Google Drive is a cloud storage service that allows users to store and access files. It is available to users with a Google Workspace account.
 34
 35Google Workspace administrators consider users' roles and organizational units when assigning permissions to files or shared drives. Owners of sensitive files and folders can grant permissions to users who make internal or external access requests. Adversaries abuse this trust system by accessing Google Drive resources with improperly scoped permissions and shared settings. Distributing phishing emails is another common approach to sharing malicious Google Drive documents. With this approach, adversaries aim to inherit the recipient's Google Workspace privileges when an external entity grants ownership.
 36
 37This rule identifies when the ownership of a shared drive within a Google Workspace organization is transferred to another internal user.
 38
 39#### Possible investigation steps
 40
 41- From the admin console, review admin logs for involved user accounts. To find admin logs, go to `Security > Reporting > Audit and investigation > Admin log events`.
 42- Determine if involved user accounts are active. To view user activity, go to `Directory > Users`.
 43- Check if the involved user accounts were recently disabled, then re-enabled.
 44- Review involved user accounts for potentially misconfigured permissions or roles.
 45- Review the involved shared drive or files and related policies to determine if this action was expected and appropriate.
 46- If a shared drive, access requirements based on Organizational Units in `Apps > Google Workspace > Drive and Docs > Manage shared drives`.
 47- Triage potentially related alerts based on the users involved. To find alerts, go to `Security > Alerts`.
 48
 49### False positive analysis
 50
 51- Transferring drives requires Google Workspace administration permissions related to Google Drive. Check if this action was planned/expected from the requester and is appropriately targeting the correct receiver.
 52
 53### Response and remediation
 54
 55- Initiate the incident response process based on the outcome of the triage.
 56- Disable or limit the account during the investigation and response.
 57- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 58    - Identify the account role in the cloud environment.
 59    - Assess the criticality of affected services and servers.
 60    - Work with your IT team to identify and minimize the impact on users.
 61    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 62    - Identify any regulatory or legal ramifications related to this activity.
 63- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
 64- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 65- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 66- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 67- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 68
 69## Setup
 70
 71The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 72
 73### Important Information Regarding Google Workspace Event Lag Times
 74- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
 75- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 76- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
 77- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 78- See the following references for further information:
 79  - https://support.google.com/a/answer/7061566
 80  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 81references = ["https://support.google.com/a/answer/1247799?hl=en"]
 82risk_score = 47
 83rule_id = "07b5f85a-240f-11ed-b3d9-f661ea17fbce"
 84severity = "medium"
 85tags = ["Domain: Cloud", "Data Source: Google Workspace", "Tactic: Collection", "Resources: Investigation Guide"]
 86timestamp_override = "event.ingested"
 87type = "query"
 88
 89query = '''
 90event.dataset:"google_workspace.admin" and event.action:"CREATE_DATA_TRANSFER_REQUEST"
 91  and event.category:"iam" and google_workspace.admin.application.name:Drive*
 92'''
 93
 94
 95[[rule.threat]]
 96framework = "MITRE ATT&CK"
 97[[rule.threat.technique]]
 98id = "T1074"
 99name = "Data Staged"
100reference = "https://attack.mitre.org/techniques/T1074/"
101[[rule.threat.technique.subtechnique]]
102id = "T1074.002"
103name = "Remote Data Staging"
104reference = "https://attack.mitre.org/techniques/T1074/002/"
105
106
107
108[rule.threat.tactic]
109id = "TA0009"
110name = "Collection"
111reference = "https://attack.mitre.org/tactics/TA0009/"

Triage and analysis

Investigating Google Drive Ownership Transferred via Google Workspace

Google Drive is a cloud storage service that allows users to store and access files. It is available to users with a Google Workspace account.

Google Workspace administrators consider users' roles and organizational units when assigning permissions to files or shared drives. Owners of sensitive files and folders can grant permissions to users who make internal or external access requests. Adversaries abuse this trust system by accessing Google Drive resources with improperly scoped permissions and shared settings. Distributing phishing emails is another common approach to sharing malicious Google Drive documents. With this approach, adversaries aim to inherit the recipient's Google Workspace privileges when an external entity grants ownership.

This rule identifies when the ownership of a shared drive within a Google Workspace organization is transferred to another internal user.

Possible investigation steps

  • From the admin console, review admin logs for involved user accounts. To find admin logs, go to Security > Reporting > Audit and investigation > Admin log events.
  • Determine if involved user accounts are active. To view user activity, go to Directory > Users.
  • Check if the involved user accounts were recently disabled, then re-enabled.
  • Review involved user accounts for potentially misconfigured permissions or roles.
  • Review the involved shared drive or files and related policies to determine if this action was expected and appropriate.
  • If a shared drive, access requirements based on Organizational Units in Apps > Google Workspace > Drive and Docs > Manage shared drives.
  • Triage potentially related alerts based on the users involved. To find alerts, go to Security > Alerts.

False positive analysis

  • Transferring drives requires Google Workspace administration permissions related to Google Drive. Check if this action was planned/expected from the requester and is appropriately targeting the correct receiver.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Disable or limit the account during the investigation and response.
  • Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    • Identify the account role in the cloud environment.
    • Assess the criticality of affected services and servers.
    • Work with your IT team to identify and minimize the impact on users.
    • Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    • Identify any regulatory or legal ramifications related to this activity.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
  • Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
  • Implement security best practices outlined by Google.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Setup

The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

Important Information Regarding Google Workspace Event Lag Times

  • As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
  • This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
  • To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
  • By default, var.interval is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
  • See the following references for further information:

References

Related rules

to-top