Google Workspace Role Modified

Detects when a custom admin role or its permissions are modified. An adversary may modify 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"
  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 when a custom admin role or its permissions are modified. An adversary may modify a custom admin role in order
 13to elevate the permissions of other user accounts and persist in their target’s environment.
 14"""
 15false_positives = [
 16    """
 17    Google Workspace admin roles may be modified by system administrators. Verify that the configuration change was
 18    expected. Exceptions can be added to this rule to filter expected behavior.
 19    """,
 20]
 21from = "now-130m"
 22index = ["filebeat-*", "logs-google_workspace*"]
 23interval = "10m"
 24language = "kuery"
 25license = "Elastic License v2"
 26name = "Google Workspace Role Modified"
 27note = """## Triage and analysis
 28
 29### Investigating Google Workspace Role Modified
 30
 31Google 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 admin roles for performing business functions related to users, groups, and services. Custom administrator roles can be created where prebuilt roles are not preferred. Each Google Workspace service has a set of custodial privileges that can be added to custom roles.
 32
 33Roles assigned to users will grant them additional permissions and privileges within the Google Workspace domain. Threat actors might modify existing roles with new privileges to advance their intrusion efforts and laterally move throughout the organization. Users with unexpected privileges might also cause operational dysfunction if unfamiliar settings are adjusted without warning.
 34
 35This rule identifies when a Google Workspace role is modified.
 36
 37#### Possible investigation steps
 38
 39- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
 40- Identify the role modified by reviewing the `google_workspace.admin.role.name` field in the alert.
 41- Identify the privilege that was added or removed by reviewing the `google_workspace.admin.privilege.name` field in the alert.
 42- After identifying the involved user, verify administrative privileges are scoped properly.
 43- To identify other users with this role, search for `event.action: ASSIGN_ROLE`
 44  - Add `google_workspace.admin.role.name` with the role added as an additional filter.
 45  - Adjust the relative time accordingly to identify all users that were assigned this role.
 46- Identify if the user account was recently created by searching for `event.action: CREATE_USER`.
 47- If a privilege was added, monitor users assigned this role for the next 24 hours and look for attempts to use the new privilege.
 48  - The `event.provider` field will help filter for specific services in Google Workspace such as Drive or Admin.
 49  - The `event.action` field will help trace actions that are being taken by users.
 50
 51### False positive analysis
 52
 53- After identifying the user account that modified the role, verify the action was intentional.
 54- Verify that the user is expected to have administrative privileges in Google Workspace to modify roles.
 55- Review organizational units or groups the role might have been added to and ensure the new privileges align properly.
 56- Use the `user.name` to filter for `event.action` where `ADD_PRIVILEGE` or `UPDATE_ROLE` has been seen before to check if these actions are new or historical.
 57
 58### Response and remediation
 59
 60- Initiate the incident response process based on the outcome of the triage.
 61- Disable or limit the account during the investigation and response.
 62- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 63    - Identify the account role in the cloud environment.
 64    - Assess the criticality of affected services and servers.
 65    - Work with your IT team to identify and minimize the impact on users.
 66    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 67    - Identify any regulatory or legal ramifications related to this activity.
 68- 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.
 69- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 70- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 71- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 72- 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).
 73
 74## Setup
 75
 76The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 77
 78### Important Information Regarding Google Workspace Event Lag Times
 79- 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.
 80- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 81- 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.
 82- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 83- See the following references for further information:
 84  - https://support.google.com/a/answer/7061566
 85  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 86references = ["https://support.google.com/a/answer/2406043?hl=en"]
 87risk_score = 47
 88rule_id = "6f435062-b7fc-4af9-acea-5b1ead65c5a5"
 89severity = "medium"
 90tags = ["Domain: Cloud", "Data Source: Google Workspace", "Use Case: Identity and Access Audit", "Resources: Investigation Guide", "Tactic: Persistence"]
 91timestamp_override = "event.ingested"
 92type = "query"
 93
 94query = '''
 95event.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:(ADD_PRIVILEGE or UPDATE_ROLE)
 96'''
 97
 98
 99[[rule.threat]]
100framework = "MITRE ATT&CK"
101[[rule.threat.technique]]
102id = "T1098"
103name = "Account Manipulation"
104reference = "https://attack.mitre.org/techniques/T1098/"
105
106
107[rule.threat.tactic]
108id = "TA0003"
109name = "Persistence"
110reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating Google Workspace Role Modified

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 admin roles for performing business functions related to users, groups, and services. Custom administrator roles can be created where prebuilt roles are not preferred. Each Google Workspace service has a set of custodial privileges that can be added to custom roles.

Roles assigned to users will grant them additional permissions and privileges within the Google Workspace domain. Threat actors might modify existing roles with new privileges to advance their intrusion efforts and laterally move throughout the organization. Users with unexpected privileges might also cause operational dysfunction if unfamiliar settings are adjusted without warning.

This rule identifies when a Google Workspace role is modified.

Possible investigation steps

  • Identify the associated user accounts by reviewing user.name or user.email fields in the alert.
  • Identify the role modified by reviewing the google_workspace.admin.role.name field in the alert.
  • Identify the privilege that was added or removed by reviewing the google_workspace.admin.privilege.name field in the alert.
  • After identifying the involved user, verify administrative privileges are scoped properly.
  • To identify other users with 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 assigned this role.
  • Identify if the user account was recently created by searching for event.action: CREATE_USER.
  • If a privilege was added, monitor users assigned this role for the next 24 hours and look for attempts to use the new privilege.
    • 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 actions that are being taken by users.

False positive analysis

  • After identifying the user account that modified the role, verify the action was intentional.
  • Verify that the user is expected to have administrative privileges in Google Workspace to modify roles.
  • Review organizational units or groups the role might have been added to and ensure the new privileges align properly.
  • Use the user.name to filter for event.action where ADD_PRIVILEGE or UPDATE_ROLE has been seen before to check if these actions 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