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/09/23"
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 = [
82 "https://support.google.com/a/answer/33329",
83 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
84 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
85]
86risk_score = 47
87rule_id = "38f384e0-aef8-11ed-9a38-f661ea17fbcc"
88severity = "medium"
89tags = [
90 "Domain: Cloud",
91 "Data Source: Google Workspace",
92 "Use Case: Identity and Access Audit",
93 "Tactic: Initial Access",
94 "Resources: Investigation Guide",
95]
96timestamp_override = "event.ingested"
97type = "eql"
98
99query = '''
100iam where event.dataset == "google_workspace.admin" and event.action == "ADD_GROUP_MEMBER" and
101 not endsWith(user.target.email, user.target.group.domain)
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1078"
109name = "Valid Accounts"
110reference = "https://attack.mitre.org/techniques/T1078/"
111[[rule.threat.technique.subtechnique]]
112id = "T1078.004"
113name = "Cloud Accounts"
114reference = "https://attack.mitre.org/techniques/T1078/004/"
115
116
117
118[rule.threat.tactic]
119id = "TA0001"
120name = "Initial Access"
121reference = "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
oruser.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
- The
- 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
- Unauthorized actions may indicate the
- 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
- It is important to understand if external users with
- 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
- Google Workspace API Access Granted via Domain-Wide Delegation
- Google Workspace Admin Role Assigned to a User
- Google Workspace Admin Role Deletion
- Google Workspace Custom Admin Role Created
- Google Workspace Password Policy Modified