Application Added to Google Workspace Domain
Detects when a Google marketplace application is added to the Google Workspace domain. An adversary may add a malicious application to an organization’s Google Workspace domain in order to maintain a presence in their target’s organization and steal data.
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 Google marketplace application is added to the Google Workspace domain. An adversary may add a malicious
11application to an organization’s Google Workspace domain in order to maintain a presence in their target’s organization
12and steal data.
13"""
14false_positives = [
15 """
16 Applications can be added to a Google Workspace domain by system administrators. Verify that the configuration
17 change was expected. Exceptions can be added to this rule to filter expected behavior.
18 """,
19]
20from = "now-130m"
21index = ["filebeat-*", "logs-google_workspace*"]
22interval = "10m"
23language = "kuery"
24license = "Elastic License v2"
25name = "Application Added to Google Workspace Domain"
26note = """## Triage and analysis
27
28### Investigating Application Added to Google Workspace Domain
29
30Google Workspace Marketplace is an online store for free and paid web applications that work with Google Workspace services and third-party software. Listed applications are based on Google APIs or on Google Apps Script and created by both Google and third-party developers.
31
32Marketplace applications require access to specific Google Workspace resources. Applications can be installed by individual users, if they have permission, or can be installed for an entire Google Workspace domain by administrators. Consent screens typically display what permissions and privileges the application requires during installation. As a result, malicious Marketplace applications may require more permissions than necessary or have malicious intent.
33
34Google clearly states that they are not responsible for any product on the Marketplace that originates from a source other than Google.
35
36This rule checks for applications that were manually added to the Marketplace by a Google Workspace account.
37
38#### Possible investigation steps
39
40- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
41- This rule relies on data from `google_workspace.admin`, thus indicating the associated user has administrative privileges to the Marketplace.
42- With access to the Google Workspace admin console, visit the `Security > Investigation tool` with filters for the user email and event is `Assign Role` or `Update Role` to determine if new cloud roles were recently updated.
43- With the user account, review other potentially related events within the last 48 hours.
44- Re-assess the permissions and reviews of the Marketplace applications to determine if they violate organizational policies or introduce unexpected risks.
45- With access to the Google Workspace admin console, determine if the application was installed domain-wide or individually by visiting `Apps > Google Workspace Marketplace Apps`.
46
47### False positive analysis
48
49- Google Workspace administrators might intentionally remove an application from the blocklist due to a re-assessment or a domain-wide required need for the application.
50- Identify the user account associated with this action and assess their administrative privileges with Google Workspace Marketplace.
51- Contact the user to verify that they intentionally removed the application from the blocklist and their reasoning.
52
53### Response and remediation
54
55- Initiate the incident response process based on the outcome of the triage.
56- Disable or limit the account during the investigation and response.
57- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
58 - Identify the account role in the cloud environment.
59 - Assess the criticality of affected services and servers.
60 - Work with your IT team to identify and minimize the impact on users.
61 - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
62 - Identify any regulatory or legal ramifications related to this activity.
63- 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.
64- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
65- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
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/6328701?hl=en#",
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 = "785a404b-75aa-4ffd-8be5-3334a5a544dd"
88severity = "medium"
89tags = [
90 "Domain: Cloud",
91 "Data Source: Google Workspace",
92 "Use Case: Configuration Audit",
93 "Tactic: Persistence",
94 "Resources: Investigation Guide",
95]
96timestamp_override = "event.ingested"
97type = "query"
98
99query = '''
100event.dataset:google_workspace.admin and event.provider:admin and event.category:iam and event.action:ADD_APPLICATION
101'''
102
103
104[[rule.threat]]
105framework = "MITRE ATT&CK"
106
107[rule.threat.tactic]
108id = "TA0003"
109name = "Persistence"
110reference = "https://attack.mitre.org/tactics/TA0003/"
Triage and analysis
Investigating Application Added to Google Workspace Domain
Google Workspace Marketplace is an online store for free and paid web applications that work with Google Workspace services and third-party software. Listed applications are based on Google APIs or on Google Apps Script and created by both Google and third-party developers.
Marketplace applications require access to specific Google Workspace resources. Applications can be installed by individual users, if they have permission, or can be installed for an entire Google Workspace domain by administrators. Consent screens typically display what permissions and privileges the application requires during installation. As a result, malicious Marketplace applications may require more permissions than necessary or have malicious intent.
Google clearly states that they are not responsible for any product on the Marketplace that originates from a source other than Google.
This rule checks for applications that were manually added to the Marketplace by a Google Workspace account.
Possible investigation steps
- Identify the associated user accounts by reviewing
user.name
oruser.email
fields in the alert. - This rule relies on data from
google_workspace.admin
, thus indicating the associated user has administrative privileges to the Marketplace. - With access to the Google Workspace admin console, visit the
Security > Investigation tool
with filters for the user email and event isAssign Role
orUpdate Role
to determine if new cloud roles were recently updated. - With the user account, review other potentially related events within the last 48 hours.
- Re-assess the permissions and reviews of the Marketplace applications to determine if they violate organizational policies or introduce unexpected risks.
- With access to the Google Workspace admin console, determine if the application was installed domain-wide or individually by visiting
Apps > Google Workspace Marketplace Apps
.
False positive analysis
- Google Workspace administrators might intentionally remove an application from the blocklist due to a re-assessment or a domain-wide required need for the application.
- Identify the user account associated with this action and assess their administrative privileges with Google Workspace Marketplace.
- Contact the user to verify that they intentionally removed the application from the blocklist and their reasoning.
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
- Google Workspace 2SV Policy Disabled
- Google Workspace User Organizational Unit Changed
- Application Removed from Blocklist in Google Workspace
- Domain Added to Google Workspace Trusted Domains
- Google Workspace API Access Granted via Domain-Wide Delegation