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