Google Workspace Admin Role Deletion
Detects when a custom admin role is deleted. An adversary may delete a custom admin role in order to impact the permissions or capabilities of system administrators.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/11/17"
3integration = ["google_workspace"]
4maturity = "production"
5updated_date = "2024/09/23"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects when a custom admin role is deleted. An adversary may delete a custom admin role in order to impact the
11permissions or capabilities of system administrators.
12"""
13false_positives = [
14 """
15 Google Workspace admin roles may be deleted by system administrators. Verify that the configuration change was
16 expected. Exceptions can be added to this rule to filter expected behavior.
17 """,
18]
19from = "now-130m"
20index = ["filebeat-*", "logs-google_workspace*"]
21interval = "10m"
22language = "kuery"
23license = "Elastic License v2"
24name = "Google Workspace Admin Role Deletion"
25note = """## Triage and analysis
26
27### Investigating Google Workspace Admin Role Deletion
28
29Google Workspace roles allow administrators to assign specific permissions to users or groups where the principle of least privilege (PoLP) is recommended. Admin roles in Google Workspace grant users access to the Google Admin console, where further domain-wide settings are accessible. Google Workspace contains prebuilt administrator roles for performing business functions related to users, groups, and services. Custom administrator roles can be created where prebuilt roles are not preferred.
30
31Deleted administrator roles may render some user accounts inaccessible or cause operational failure where these roles are relied upon to perform daily administrative tasks. The deletion of roles may also hinder the response and remediation actions of administrators responding to security-related alerts and events. Without specific roles assigned, users will inherit the permissions and privileges of the root organizational unit.
32
33This rule identifies when a Google Workspace administrative role is deleted within the Google Admin console.
34
35#### Possible investigation steps
36
37- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
38- Identify the role deleted by reviewing `google_workspace.admin.role.name` in the alert.
39- With the user identified, verify if he has administrative privileges to disable or delete administrative roles.
40- To identify other users affected by this role removed, search for `event.action: ASSIGN_ROLE`.
41 - Add `google_workspace.admin.role.name` with the role deleted as an additional filter.
42 - Adjust the relative time accordingly to identify all users that were assigned this admin role.
43
44### False positive analysis
45
46- After identifying the user account that disabled the admin role, verify the action was intentional.
47
48### Response and remediation
49
50- Initiate the incident response process based on the outcome of the triage.
51- Discuss with the user the affected users as a result of this action to mitigate operational discrepencies.
52- Disable or limit the account during the investigation and response.
53- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
54 - Identify the account role in the cloud environment.
55 - Assess the criticality of affected services and servers.
56 - Work with your IT team to identify and minimize the impact on users.
57 - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
58 - Identify any regulatory or legal ramifications related to this activity.
59- 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.
60- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
61- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
62- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
63- 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).
64
65## Setup
66
67The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
68
69### Important Information Regarding Google Workspace Event Lag Times
70- 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.
71- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
72- 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.
73- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
74- See the following references for further information:
75 - https://support.google.com/a/answer/7061566
76 - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
77references = [
78 "https://support.google.com/a/answer/2406043?hl=en",
79 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
80 "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
81]
82risk_score = 47
83rule_id = "93e63c3e-4154-4fc6-9f86-b411e0987bbf"
84severity = "medium"
85tags = [
86 "Domain: Cloud",
87 "Data Source: Google Workspace",
88 "Use Case: Identity and Access Audit",
89 "Tactic: Impact",
90 "Resources: Investigation Guide",
91]
92timestamp_override = "event.ingested"
93type = "query"
94
95query = '''
96event.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:DELETE_ROLE
97'''
98
99
100[[rule.threat]]
101framework = "MITRE ATT&CK"
102[[rule.threat.technique]]
103id = "T1531"
104name = "Account Access Removal"
105reference = "https://attack.mitre.org/techniques/T1531/"
106
107
108[rule.threat.tactic]
109id = "TA0040"
110name = "Impact"
111reference = "https://attack.mitre.org/tactics/TA0040/"
Triage and analysis
Investigating Google Workspace Admin Role Deletion
Google Workspace roles allow administrators to assign specific permissions to users or groups where the principle of least privilege (PoLP) is recommended. Admin roles in Google Workspace grant users access to the Google Admin console, where further domain-wide settings are accessible. Google Workspace contains prebuilt administrator roles for performing business functions related to users, groups, and services. Custom administrator roles can be created where prebuilt roles are not preferred.
Deleted administrator roles may render some user accounts inaccessible or cause operational failure where these roles are relied upon to perform daily administrative tasks. The deletion of roles may also hinder the response and remediation actions of administrators responding to security-related alerts and events. Without specific roles assigned, users will inherit the permissions and privileges of the root organizational unit.
This rule identifies when a Google Workspace administrative role is deleted within the Google Admin console.
Possible investigation steps
- Identify the associated user accounts by reviewing
user.name
oruser.email
fields in the alert. - Identify the role deleted by reviewing
google_workspace.admin.role.name
in the alert. - With the user identified, verify if he has administrative privileges to disable or delete administrative roles.
- To identify other users affected by this role removed, search for
event.action: ASSIGN_ROLE
.- Add
google_workspace.admin.role.name
with the role deleted as an additional filter. - Adjust the relative time accordingly to identify all users that were assigned this admin role.
- Add
False positive analysis
- After identifying the user account that disabled the admin role, verify the action was intentional.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Discuss with the user the affected users as a result of this action to mitigate operational discrepencies.
- 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
- External User Added to Google Workspace Group
- Google Workspace API Access Granted via Domain-Wide Delegation
- Google Workspace Admin Role Assigned to a User
- Google Workspace Custom Admin Role Created
- Google Workspace MFA Enforcement Disabled