Google Workspace Restrictions for Google Marketplace Modified to Allow Any App

Detects when the Google Marketplace restrictions are changed to allow any application for users in Google Workspace. Malicious APKs created by adversaries may be uploaded to the Google marketplace but not installed on devices managed within Google Workspace. Administrators should set restrictions to not allow any application from the marketplace for security reasons. Adversaries may enable any app to be installed and executed on mobile devices within a Google Workspace environment prior to distributing the malicious APK to the end user.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2022/08/25"
  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 the Google Marketplace restrictions are changed to allow any application for users in Google Workspace.
 13Malicious APKs created by adversaries may be uploaded to the Google marketplace but not installed on devices managed
 14within Google Workspace. Administrators should set restrictions to not allow any application from the marketplace for
 15security reasons. Adversaries may enable any app to be installed and executed on mobile devices within a Google
 16Workspace environment prior to distributing the malicious APK to the end user.
 17"""
 18false_positives = [
 19    """
 20    Applications can be added and removed from blocklists by Google Workspace administrators, but they can all be
 21    explicitly allowed for users. Verify that the configuration change was expected. Exceptions can be added to this
 22    rule to filter expected behavior.
 23    """,
 24]
 25from = "now-130m"
 26index = ["filebeat-*", "logs-google_workspace*"]
 27interval = "10m"
 28language = "kuery"
 29license = "Elastic License v2"
 30name = "Google Workspace Restrictions for Google Marketplace Modified to Allow Any App"
 31note = """## Triage and analysis
 32
 33### Investigating Google Workspace Restrictions for Google Marketplace Modified to Allow Any App
 34
 35Google 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 Google Apps Script and created by both Google and third-party developers.
 36
 37Marketplace 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.
 38
 39Google clearly states that they are not responsible for any product on the Marketplace that originates from a source other than Google.
 40
 41This rule identifies when the global allow-all setting is enabled for Google Workspace Marketplace applications.
 42
 43#### Possible investigation steps
 44
 45- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
 46- This rule relies on data from `google_workspace.admin`, thus indicating the associated user has administrative privileges to the Marketplace.
 47- Search for `event.action` is `ADD_APPLICATION` to identify applications installed after these changes were made.
 48    - The `google_workspace.admin.application.name` field will help identify what applications were added.
 49- With the user account, review other potentially related events within the last 48 hours.
 50- Re-assess the permissions and reviews of the Marketplace applications to determine if they violate organizational policies or introduce unexpected risks.
 51- 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`.
 52
 53### False positive analysis
 54
 55- Identify the user account associated with this action and assess their administrative privileges with Google Workspace Marketplace.
 56- Google Workspace administrators may intentionally add an application from the marketplace based on organizational needs.
 57    - Follow up with the user who added the application to ensure this was intended.
 58- Verify the application identified has been assessed thoroughly by an administrator.
 59
 60### Response and remediation
 61
 62- Initiate the incident response process based on the outcome of the triage.
 63- Disable or limit the account during the investigation and response.
 64- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 65    - Identify the account role in the cloud environment.
 66    - Assess the criticality of affected services and servers.
 67    - Work with your IT team to identify and minimize the impact on users.
 68    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 69    - Identify any regulatory or legal ramifications related to this activity.
 70- 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.
 71- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
 72- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
 73- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
 74- 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).
 75
 76## Setup
 77
 78The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
 79
 80### Important Information Regarding Google Workspace Event Lag Times
 81- 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.
 82- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
 83- 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.
 84- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
 85- See the following references for further information:
 86  - https://support.google.com/a/answer/7061566
 87  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
 88references = ["https://support.google.com/a/answer/6089179?hl=en"]
 89risk_score = 47
 90rule_id = "a2795334-2499-11ed-9e1a-f661ea17fbce"
 91severity = "medium"
 92tags = [
 93    "Domain: Cloud",
 94    "Data Source: Google Workspace",
 95    "Use Case: Configuration Audit",
 96    "Tactic: Defense Evasion",
 97    "Resources: Investigation Guide"
 98]
 99timestamp_override = "event.ingested"
100type = "query"
101
102query = '''
103event.dataset:"google_workspace.admin" and event.action:"CHANGE_APPLICATION_SETTING" and event.category:(iam or configuration)
104    and google_workspace.event.type:"APPLICATION_SETTINGS" and google_workspace.admin.application.name:"Google Workspace Marketplace"
105        and google_workspace.admin.setting.name:"Apps Access Setting Allowlist access"  and google_workspace.admin.new_value:"ALLOW_ALL"
106'''
107
108
109[[rule.threat]]
110framework = "MITRE ATT&CK"
111[[rule.threat.technique]]
112id = "T1562"
113name = "Impair Defenses"
114reference = "https://attack.mitre.org/techniques/T1562/"
115[[rule.threat.technique.subtechnique]]
116id = "T1562.001"
117name = "Disable or Modify Tools"
118reference = "https://attack.mitre.org/techniques/T1562/001/"
119
120
121
122[rule.threat.tactic]
123id = "TA0005"
124name = "Defense Evasion"
125reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Investigating Google Workspace Restrictions for Google Marketplace Modified to Allow Any App

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 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 identifies when the global allow-all setting is enabled for Google Workspace Marketplace applications.

Possible investigation steps

  • Identify the associated user accounts by reviewing user.name or user.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.
  • Search for event.action is ADD_APPLICATION to identify applications installed after these changes were made.
    • The google_workspace.admin.application.name field will help identify what applications were added.
  • 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

  • Identify the user account associated with this action and assess their administrative privileges with Google Workspace Marketplace.
  • Google Workspace administrators may intentionally add an application from the marketplace based on organizational needs.
    • Follow up with the user who added the application to ensure this was intended.
  • Verify the application identified has been assessed thoroughly by an administrator.

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