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