Google Workspace Custom Admin Role Created

Detects when a custom admin role is created in Google Workspace. An adversary may create a custom admin role in order to elevate the permissions of other user accounts and persist in their target’s environment.

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 created in Google Workspace. An adversary may create a custom admin role in order to
 11elevate the permissions of other user accounts and persist in their target’s environment.
 12"""
 13false_positives = [
 14    """
 15    Custom Google Workspace admin roles may be created by system administrators. Verify that the configuration change
 16    was 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 Custom Admin Role Created"
 25note = """## Triage and analysis
 26
 27### Investigating Google Workspace Custom Admin Role Created
 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 more 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
 31Roles assigned to users will grant them additional permissions and privileges within the Google Workspace domain. Threat actors might create new admin roles with privileges to advance their intrusion efforts and laterally move throughout the organization if existing roles or users do not have privileges aligned with their modus operandi. Users with unexpected privileges from new admin roles may also cause operational dysfunction if unfamiliar settings are adjusted without warning. Instead of modifying existing roles, administrators might create new roles to accomplish short-term goals and unintentionally introduce additional risk exposure.
 32
 33This rule identifies when a Google Workspace administrative role is added within the Google Workspace 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 added by reviewing the `google_workspace.admin.role.name` field in the alert.
 39- After identifying the involved user, verify if they should have administrative privileges to add administrative roles.
 40- To identify if users have been assigned this role, search for `event.action: ASSIGN_ROLE`.
 41    - Add `google_workspace.admin.role.name` with the role added as an additional filter.
 42    - Adjust the relative time accordingly to identify all users that were possibly assigned this admin role.
 43- Monitor users assigned the admin role for the next 24 hours and look for attempts to use related privileges.
 44  - The `event.provider` field will help filter for specific services in Google Workspace such as Drive or Admin.
 45  - The `event.action` field will help trace what actions are being taken by users.
 46
 47### False positive analysis
 48
 49- After identifying the user account that created the role, verify whether the action was intentional.
 50- Verify that the user who created the role should have administrative privileges in Google Workspace to create custom roles.
 51- Review organizational units or groups the role may have been added to and ensure the new privileges align properly.
 52- Create a filter with the user's `user.name` and filter for `event.action`. In the results, check if there are multiple `CREATE_ROLE` actions and note whether they are new or historical.
 53
 54### Response and remediation
 55
 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- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 66- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 67- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 68- 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).
 69
 70## Setup
 71
 72The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 73
 74### Important Information Regarding Google Workspace Event Lag Times
 75- 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.
 76- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 77- 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.
 78- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 79- See the following references for further information:
 80  - https://support.google.com/a/answer/7061566
 81  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 82references = [
 83    "https://support.google.com/a/answer/2406043?hl=en",
 84    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
 85    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two",
 86]
 87risk_score = 47
 88rule_id = "ad3f2807-2b3e-47d7-b282-f84acbbe14be"
 89severity = "medium"
 90tags = [
 91    "Domain: Cloud",
 92    "Data Source: Google Workspace",
 93    "Use Case: Identity and Access Audit",
 94    "Resources: Investigation Guide",
 95    "Tactic: Persistence",
 96]
 97timestamp_override = "event.ingested"
 98type = "query"
 99
100query = '''
101event.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:CREATE_ROLE
102'''
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1098"
109name = "Account Manipulation"
110reference = "https://attack.mitre.org/techniques/T1098/"
111
112
113[rule.threat.tactic]
114id = "TA0003"
115name = "Persistence"
116reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating Google Workspace Custom Admin Role Created

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 more 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.

Roles assigned to users will grant them additional permissions and privileges within the Google Workspace domain. Threat actors might create new admin roles with privileges to advance their intrusion efforts and laterally move throughout the organization if existing roles or users do not have privileges aligned with their modus operandi. Users with unexpected privileges from new admin roles may also cause operational dysfunction if unfamiliar settings are adjusted without warning. Instead of modifying existing roles, administrators might create new roles to accomplish short-term goals and unintentionally introduce additional risk exposure.

This rule identifies when a Google Workspace administrative role is added within the Google Workspace admin console.

Possible investigation steps

  • Identify the associated user accounts by reviewing user.name or user.email fields in the alert.
  • Identify the role added by reviewing the google_workspace.admin.role.name field in the alert.
  • After identifying the involved user, verify if they should have administrative privileges to add administrative roles.
  • To identify if users have been assigned this role, search for event.action: ASSIGN_ROLE.
    • Add google_workspace.admin.role.name with the role added as an additional filter.
    • Adjust the relative time accordingly to identify all users that were possibly assigned this admin role.
  • Monitor users assigned the admin role for the next 24 hours and look for attempts to use related privileges.
    • The event.provider field will help filter for specific services in Google Workspace such as Drive or Admin.
    • The event.action field will help trace what actions are being taken by users.

False positive analysis

  • After identifying the user account that created the role, verify whether the action was intentional.
  • Verify that the user who created the role should have administrative privileges in Google Workspace to create custom roles.
  • Review organizational units or groups the role may have been added to and ensure the new privileges align properly.
  • Create a filter with the user's user.name and filter for event.action. In the results, check if there are multiple CREATE_ROLE actions and note whether they are new or historical.

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