Domain Added to Google Workspace Trusted Domains

Detects when a domain is added to the list of trusted Google Workspace domains. An adversary may add a trusted domain in order to collect and exfiltrate data from their target’s organization with less restrictive security controls.

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 domain is added to the list of trusted Google Workspace domains. An adversary may add a trusted domain in
 13order to collect and exfiltrate data from their target’s organization with less restrictive security controls.
 14"""
 15false_positives = [
 16    """
 17    Trusted domains may be added by system administrators. Verify that the configuration change was expected. Exceptions
 18    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 = "Domain Added to Google Workspace Trusted Domains"
 27note = """## Triage and analysis
 28
 29### Investigating Domain Added to Google Workspace Trusted Domains
 30
 31Organizations use trusted domains in Google Workspace to give external users access to resources.
 32
 33A threat actor with administrative privileges may be able to add a malicious domain to the trusted domain list. Based on the configuration, potentially sensitive resources may be exposed or accessible by an unintended third-party.
 34
 35This rule detects when a third-party domain is added to the list of trusted domains in Google Workspace.
 36
 37#### Possible investigation steps
 38
 39- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
 40- After identifying the user, verify if the user should have administrative privileges to add external domains.
 41- Check the `google_workspace.admin.domain.name` field to find the newly added domain.
 42- Use reputational services, such as VirusTotal, for the trusted domain's third-party intelligence reputation.
 43- Filter your data. Create a filter where `event.dataset` is `google_workspace.drive` and `google_workspace.drive.file.owner.email` is being compared to `user.email`.
 44    - If mismatches are identified, this could indicate access from an external Google Workspace domain.
 45
 46### False positive analysis
 47
 48- Verify that the user account should have administrative privileges that allow them to edit trusted domains in Google Workspace.
 49- Talk to the user to evaluate why they added the third-party domain and if the domain has confidentiality risks.
 50
 51### Response and remediation
 52
 53- Initiate the incident response process based on the outcome of the triage.
 54- Disable or limit the account during the investigation and response.
 55- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 56    - Identify the account role in the cloud environment.
 57    - Assess the criticality of affected services and servers.
 58    - Work with your IT team to identify and minimize the impact on users.
 59    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 60    - Identify any regulatory or legal ramifications related to this activity.
 61- 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.
 62- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 63- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 64- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 65- 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).
 66
 67## Setup
 68
 69The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 70
 71### Important Information Regarding Google Workspace Event Lag Times
 72- 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.
 73- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 74- 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.
 75- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 76- See the following references for further information:
 77  - https://support.google.com/a/answer/7061566
 78  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 79references = ["https://support.google.com/a/answer/6160020?hl=en"]
 80risk_score = 73
 81rule_id = "cf549724-c577-4fd6-8f9b-d1b8ec519ec0"
 82severity = "high"
 83tags = [
 84    "Domain: Cloud",
 85    "Data Source: Google Workspace",
 86    "Use Case: Configuration Audit",
 87    "Tactic: Defense Evasion",
 88    "Resources: Investigation Guide"
 89]
 90timestamp_override = "event.ingested"
 91type = "query"
 92
 93query = '''
 94event.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:ADD_TRUSTED_DOMAINS
 95'''
 96
 97
 98[[rule.threat]]
 99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1562"
102name = "Impair Defenses"
103reference = "https://attack.mitre.org/techniques/T1562/"
104[[rule.threat.technique.subtechnique]]
105id = "T1562.007"
106name = "Disable or Modify Cloud Firewall"
107reference = "https://attack.mitre.org/techniques/T1562/007/"
108
109
110
111[rule.threat.tactic]
112id = "TA0005"
113name = "Defense Evasion"
114reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Domain Added to Google Workspace Trusted Domains

Organizations use trusted domains in Google Workspace to give external users access to resources.

A threat actor with administrative privileges may be able to add a malicious domain to the trusted domain list. Based on the configuration, potentially sensitive resources may be exposed or accessible by an unintended third-party.

This rule detects when a third-party domain is added to the list of trusted domains in Google Workspace.

Possible investigation steps

  • Identify the associated user accounts by reviewing user.name or user.email fields in the alert.
  • After identifying the user, verify if the user should have administrative privileges to add external domains.
  • Check the google_workspace.admin.domain.name field to find the newly added domain.
  • Use reputational services, such as VirusTotal, for the trusted domain's third-party intelligence reputation.
  • Filter your data. Create a filter where event.dataset is google_workspace.drive and google_workspace.drive.file.owner.email is being compared to user.email.
    • If mismatches are identified, this could indicate access from an external Google Workspace domain.

False positive analysis

  • Verify that the user account should have administrative privileges that allow them to edit trusted domains in Google Workspace.
  • Talk to the user to evaluate why they added the third-party domain and if the domain has confidentiality risks.

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