External User Added to Google Workspace Group

Detects an external Google Workspace user account being added to an existing group. Adversaries may add external user accounts as a means to intercept shared files or emails with that specific group.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2023/02/16"
  3integration = ["google_workspace"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects an external Google Workspace user account being added to an existing group. Adversaries may add external user
 11accounts as a means to intercept shared files or emails with that specific group.
 12"""
 13false_positives = [
 14    """
 15    Administrators may add external users to groups to share files and communication with them via the intended
 16    recipient be the group they are added to. It is unlikely an external user account would be added to an
 17    organization's group where administrators should create a new user account.
 18    """,
 19]
 20from = "now-130m"
 21index = ["filebeat-*", "logs-google_workspace*"]
 22interval = "10m"
 23language = "eql"
 24license = "Elastic License v2"
 25name = "External User Added to Google Workspace Group"
 26note = """## Triage and analysis
 27
 28### Investigating External User Added to Google Workspace Group
 29
 30Google Workspace groups allow organizations to assign specific users to a group that can share resources. Application specific roles can be manually set for each group, but if not inherit permissions from the top-level organizational unit.
 31
 32Threat actors may use phishing techniques and container-bound scripts to add external Google accounts to an organization's groups with editorial privileges. As a result, the user account is unable to manually access the organization's resources, settings and files, but will receive anything shared to the group. As a result, confidential information could be leaked or perhaps documents shared with editorial privileges be weaponized for further intrusion.
 33
 34This rule identifies when an external user account is added to an organization's groups where the domain name of the target does not match the Google Workspace domain.
 35
 36#### Possible investigation steps
 37- Identify user account(s) associated by reviewing `user.name` or `user.email` in the alert
 38  - The `user.target.email` field contains the user added to the groups
 39  - The `group.name` field contains the group the target user was added to
 40- Identify specific application settings given to the group which may indicate motive for the external user joining a particular group
 41- With the user identified, verify administrative privileges are scoped properly to add external users to the group
 42  - Unauthorized actions may indicate the `user.email` account has been compromised or leveraged to add an external user
 43- To identify other users in this group, search for `event.action: "ADD_GROUP_MEMBER"`
 44  - It is important to understand if external users with `@gmail.com` are expected to be added to this group based on historical references
 45- Review Gmail logs where emails were sent to and from the `group.name` value
 46  - This may indicate potential internal spearphishing
 47
 48### False positive analysis
 49- With the user account whom added the new user, verify this action was intentional
 50- Verify that the target whom was added to the group is expected to have access to the organization's resources and data
 51- If other members have been added to groups that are external, this may indicate historically that this action is expected
 52
 53### Response and remediation
 54- Initiate the incident response process based on the outcome of the triage.
 55- Disable or limit the account during the investigation and response.
 56- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 57    - Identify the account role in the cloud environment.
 58    - Assess the criticality of affected services and servers.
 59    - Work with your IT team to identify and minimize the impact on users.
 60    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 61    - Identify any regulatory or legal ramifications related to this activity.
 62- 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.
 63- Reactivate multi-factor authentication for the user.
 64- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 65- Implement security defaults [provided by Google](https://cloud.google.com/security-command-center/docs/how-to-investigate-threats).
 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/33329"]
 82risk_score = 47
 83rule_id = "38f384e0-aef8-11ed-9a38-f661ea17fbcc"
 84severity = "medium"
 85tags = [
 86    "Domain: Cloud",
 87    "Data Source: Google Workspace",
 88    "Use Case: Identity and Access Audit",
 89    "Tactic: Initial Access",
 90    "Resources: Investigation Guide",
 91]
 92timestamp_override = "event.ingested"
 93type = "eql"
 94
 95query = '''
 96iam where event.dataset == "google_workspace.admin" and event.action == "ADD_GROUP_MEMBER" and
 97  not endsWith(user.target.email, user.target.group.domain)
 98'''
 99
100
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103[[rule.threat.technique]]
104id = "T1078"
105name = "Valid Accounts"
106reference = "https://attack.mitre.org/techniques/T1078/"
107[[rule.threat.technique.subtechnique]]
108id = "T1078.004"
109name = "Cloud Accounts"
110reference = "https://attack.mitre.org/techniques/T1078/004/"
111
112
113
114[rule.threat.tactic]
115id = "TA0001"
116name = "Initial Access"
117reference = "https://attack.mitre.org/tactics/TA0001/"

Triage and analysis

Investigating External User Added to Google Workspace Group

Google Workspace groups allow organizations to assign specific users to a group that can share resources. Application specific roles can be manually set for each group, but if not inherit permissions from the top-level organizational unit.

Threat actors may use phishing techniques and container-bound scripts to add external Google accounts to an organization's groups with editorial privileges. As a result, the user account is unable to manually access the organization's resources, settings and files, but will receive anything shared to the group. As a result, confidential information could be leaked or perhaps documents shared with editorial privileges be weaponized for further intrusion.

This rule identifies when an external user account is added to an organization's groups where the domain name of the target does not match the Google Workspace domain.

Possible investigation steps

  • Identify user account(s) associated by reviewing user.name or user.email in the alert
    • The user.target.email field contains the user added to the groups
    • The group.name field contains the group the target user was added to
  • Identify specific application settings given to the group which may indicate motive for the external user joining a particular group
  • With the user identified, verify administrative privileges are scoped properly to add external users to the group
    • Unauthorized actions may indicate the user.email account has been compromised or leveraged to add an external user
  • To identify other users in this group, search for event.action: "ADD_GROUP_MEMBER"
    • It is important to understand if external users with @gmail.com are expected to be added to this group based on historical references
  • Review Gmail logs where emails were sent to and from the group.name value
    • This may indicate potential internal spearphishing

False positive analysis

  • With the user account whom added the new user, verify this action was intentional
  • Verify that the target whom was added to the group is expected to have access to the organization's resources and data
  • If other members have been added to groups that are external, this may indicate historically that this action is expected

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.
  • Reactivate multi-factor authentication for the user.
  • Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
  • Implement security defaults provided 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