Google Workspace User Organizational Unit Changed

Users in Google Workspace are typically assigned a specific organizational unit that grants them permissions to certain services and roles that are inherited from this organizational unit. Adversaries may compromise a valid account and change which organizational account the user belongs to which then could allow them to inherit permissions to applications and resources inaccessible prior to.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/09/06"
  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 = """
 12Users in Google Workspace are typically assigned a specific organizational unit that grants them permissions to certain
 13services and roles that are inherited from this organizational unit. Adversaries may compromise a valid account and
 14change which organizational account the user belongs to which then could allow them to inherit permissions to
 15applications and resources inaccessible prior to.
 16"""
 17false_positives = [
 18    """
 19    Google Workspace administrators may adjust change which organizational unit a user belongs to as a result of
 20    internal role adjustments.
 21    """,
 22]
 23from = "now-130m"
 24index = ["filebeat-*", "logs-google_workspace*"]
 25interval = "10m"
 26language = "kuery"
 27license = "Elastic License v2"
 28name = "Google Workspace User Organizational Unit Changed"
 29note = """## Triage and analysis
 30
 31### Investigating Google Workspace User Organizational Unit Changed
 32
 33An organizational unit is a group that an administrator can create in the Google Admin console to apply settings to a specific set of users for Google Workspace. By default, all users are placed in the top-level (parent) organizational unit. Child organizational units inherit the settings from the parent but can be changed to fit the needs of the child organizational unit.
 34
 35Permissions and privileges for users are often inherited from the organizational unit they are placed in. Therefore, if a user is changed to a separate organizational unit, they will inherit all privileges and permissions. User accounts may have unexpected privileges when switching organizational units that would allow a threat actor to gain a stronger foothold within the organization. The principle of least privileged (PoLP) should be followed when users are switched to different groups in Google Workspace.
 36
 37This rule identifies when a user has been moved to a different organizational unit.
 38
 39#### Possible investigation steps
 40
 41- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
 42  - The `user.target.email` field contains the user that had their assigned organizational unit switched.
 43- Identify the user's previously assigned unit and new organizational unit by checking the `google_workspace.admin.org_unit.name` and `google_workspace.admin.new_value` fields.
 44- Identify Google Workspace applications whose settings were explicitly set for this organizational unit.
 45    - Search for `event.action` is `CREATE_APPLICATION_SETTING` where `google_workspace.admin.org_unit.name` is the new organizational unit.
 46- After identifying the involved user, verify administrative privileges are scoped properly to allow changing user organizational units.
 47- Identify if the user account was recently created by searching for `event.action: CREATE_USER`.
 48  - Add `user.email` with the target user account that recently had their organizational unit changed.
 49- Filter on `user.name` or `user.target.email` of the user who took this action and review the last 48 hours of activity for anything that may indicate a compromise.
 50
 51### False positive analysis
 52
 53- After identifying the user account that changed another user's organizational unit, verify the action was intentional.
 54- Verify whether the target user who received this update is expected to inherit privileges from the new organizational unit.
 55- Review potential maintenance notes or organizational changes. They might explain why a user's organization was changed.
 56
 57### Response and remediation
 58
 59- Initiate the incident response process based on the outcome of the triage.
 60- Disable or limit the account during the investigation and response.
 61- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 62    - Identify the account role in the cloud environment.
 63    - Assess the criticality of affected services and servers.
 64    - Work with your IT team to identify and minimize the impact on users.
 65    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 66    - Identify any regulatory or legal ramifications related to this activity.
 67- 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.
 68- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 69- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 70- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 71- 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).
 72
 73## Setup
 74
 75The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 76
 77### Important Information Regarding Google Workspace Event Lag Times
 78- 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.
 79- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 80- 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.
 81- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 82- See the following references for further information:
 83  - https://support.google.com/a/answer/7061566
 84  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 85references = ["https://support.google.com/a/answer/6328701?hl=en#"]
 86risk_score = 21
 87rule_id = "cc6a8a20-2df2-11ed-8378-f661ea17fbce"
 88severity = "low"
 89tags = [
 90    "Domain: Cloud",
 91    "Data Source: Google Workspace",
 92    "Use Case: Configuration Audit",
 93    "Tactic: Persistence",
 94    "Resources: Investigation Guide"
 95]
 96timestamp_override = "event.ingested"
 97type = "query"
 98
 99query = '''
100event.dataset:"google_workspace.admin" and event.type:change and event.category:iam
101    and google_workspace.event.type:"USER_SETTINGS" and event.action:"MOVE_USER_TO_ORG_UNIT"
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1098"
109name = "Account Manipulation"
110reference = "https://attack.mitre.org/techniques/T1098/"
111[[rule.threat.technique.subtechnique]]
112id = "T1098.003"
113name = "Additional Cloud Roles"
114reference = "https://attack.mitre.org/techniques/T1098/003/"
115
116
117
118[rule.threat.tactic]
119id = "TA0003"
120name = "Persistence"
121reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating Google Workspace User Organizational Unit Changed

An organizational unit is a group that an administrator can create in the Google Admin console to apply settings to a specific set of users for Google Workspace. By default, all users are placed in the top-level (parent) organizational unit. Child organizational units inherit the settings from the parent but can be changed to fit the needs of the child organizational unit.

Permissions and privileges for users are often inherited from the organizational unit they are placed in. Therefore, if a user is changed to a separate organizational unit, they will inherit all privileges and permissions. User accounts may have unexpected privileges when switching organizational units that would allow a threat actor to gain a stronger foothold within the organization. The principle of least privileged (PoLP) should be followed when users are switched to different groups in Google Workspace.

This rule identifies when a user has been moved to a different organizational unit.

Possible investigation steps

  • Identify the associated user accounts by reviewing user.name or user.email fields in the alert.
    • The user.target.email field contains the user that had their assigned organizational unit switched.
  • Identify the user's previously assigned unit and new organizational unit by checking the google_workspace.admin.org_unit.name and google_workspace.admin.new_value fields.
  • Identify Google Workspace applications whose settings were explicitly set for this organizational unit.
    • Search for event.action is CREATE_APPLICATION_SETTING where google_workspace.admin.org_unit.name is the new organizational unit.
  • After identifying the involved user, verify administrative privileges are scoped properly to allow changing user organizational units.
  • Identify if the user account was recently created by searching for event.action: CREATE_USER.
    • Add user.email with the target user account that recently had their organizational unit changed.
  • Filter on user.name or user.target.email of the user who took this action and review the last 48 hours of activity for anything that may indicate a compromise.

False positive analysis

  • After identifying the user account that changed another user's organizational unit, verify the action was intentional.
  • Verify whether the target user who received this update is expected to inherit privileges from the new organizational unit.
  • Review potential maintenance notes or organizational changes. They might explain why a user's organization was changed.

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