1. Resources
  2. Detection rules
  3. Third-Party App Access Controls Weakened in Google Workspace

Third-Party App Access Controls Weakened in Google Workspace detection rules

An attacker with admin rights in Google Workspace trusts an app, lifts the restriction on a Google service or adds an app to the Marketplace allowlist, so that an app they control can reach mail and files again.

Platform
Google Cloud
Severity
Medium
Log source
Google Cloud Audit Logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A super admin, or an admin with the Service Settings or Google Workspace Marketplace privilege, and an app the attacker controls or can use.
Impact
An app can again receive access to data the organization had closed off, such as Gmail or Drive, and it keeps that access after the admin session ends.
Response
Reverse the change in API controls, remove the access the app already has, and secure the admin account that made the change.
Mitigation
Restrict the services that hold sensitive data and trust only reviewed apps, and treat every addition to the Marketplace allowlist as a grant of trust.
API methods
google.admin.AdminService.allowServiceForOauth2Accessgoogle.admin.AdminService.unblockOnDeviceAccessgoogle.admin.AdminService.addApplicationgoogle.admin.AdminService.addApplicationToWhitelistgoogle.admin.AdminService.changeWhitelistSettinggoogle.admin.AdminService.addToTrustedOauth2Appsgoogle.admin.AdminService.trustDomainOwnedOauth2Appsgoogle.admin.AdminService.toggleOauthAccessToAllApisgoogle.admin.AdminService.enableApiAccess
Threat groups
None listed in MITRE ATT&CK for this technique

How the attack works

Google Workspace lets admins decide which apps may reach user data through OAuth. In the Admin console under Security, Access and data control, API controls, each Google service is either unrestricted or restricted, and each app can be configured as Trusted, limited to specific Google data, Limited or Blocked. A restricted service is open only to apps that are Trusted or were given that specific data. A Trusted app has access to all Google Workspace services, including restricted ones. Internal apps can be trusted as a whole, and Google states that apps on the Marketplace allowlist are trusted automatically.

Organizations tighten these controls so that a user who is talked into authorizing an app cannot hand it a mailbox or a Drive. An attacker with admin rights loosens them again. They mark their own app as trusted, trust all internal apps, lift the restriction on Gmail or Drive, add an app to the Marketplace allowlist or install it for the domain. The change reads no data. It prepares the step that does, because the app's request for sensitive scopes is no longer refused.

The Admin audit log records each change, for example ADD_TO_TRUSTED_OAUTH2_APPS, TRUST_DOMAIN_OWNED_OAUTH2_APPS, ALLOW_SERVICE_FOR_OAUTH2_ACCESS and ADD_APPLICATION_TO_WHITELIST. Organizations that share Workspace data with Google Cloud receive them in Cloud Audit Logs at organization level as Admin Activity entries of admin.googleapis.com, with method names such as google.admin.AdminService.addToTrustedOauth2Apps. Not every app access event of the Admin audit log is in Google's list of methods for Cloud Audit Logs, and the rules on this page are written only on events that are in that list.

What an attacker needs

  • A super admin account, or an admin whose role holds the Service Settings privilege (for API controls) or the Google Workspace Marketplace privilege (for Marketplace apps).
  • An app the attacker controls, or an existing app they can use, identified by its OAuth client ID or its Marketplace listing.

Impact

An app can request and receive access that the organization had closed off, such as full access to Gmail or Drive for every user who authorizes it. The app holds that access itself, so it outlasts the admin session that changed the setting. Lifting the restriction on a service opens it to more than the attacker's app. Apps with Limited access can reach it again, and with the default setting for unconfigured apps so can any third-party app a user signs in to.

Detection rules

Google Service Opened to App Access in Google Workspace

Detects an admin allowing API access to a Google service in the API controls of a Google Workspace or Cloud Identity account (Admin audit event ALLOW_SERVICE_FOR_OAUTH2_ACCESS, rendered as the service's "API Access is allowed" for an organizational unit), or unblocking on-device access to a service (UNBLOCK_ON_DEVICE_ACCESS, which Google describes as device access for OAuth2 apps being unblocked). Google's reference does not name the Admin console control behind these events. Their text and parameters correspond to the control that sets a Google service to restricted or unrestricted, where a restricted service is open only to apps that are Trusted or were given that specific data. The service is in the event parameter OAUTH2_SERVICE_NAME in protoPayload.metadata, with documented values such as GMAIL, GMAIL_HIGH_RISK, DRIVE, DRIVE_HIGH_RISK, GSUITE_ADMIN and CLOUD_PLATFORM, and the scope in ORG_UNIT_NAME. The rule fires for every service, so read the parameter to see which one was opened. Blocking a service again is a different event and does not match. The entries reach Cloud Audit Logs as Admin Activity entries at organization level, which are always written once Google Workspace data sharing with Google Cloud is enabled, and reach the SIEM only when the organization-level logs are routed to it.

LevelMediumStatusExperimentalLog sourceGoogle Cloud Audit Logs
title: Google Service Opened to App Access in Google Workspace
id: 2bbcb08e-6688-4588-9aab-e0b93e694b37
status: experimental
description: >-
  Detects an admin allowing API access to a Google service in the API
  controls of a Google Workspace or Cloud Identity account (Admin audit
  event ALLOW_SERVICE_FOR_OAUTH2_ACCESS, rendered as the service's "API
  Access is allowed" for an organizational unit), or unblocking on-device
  access to a service (UNBLOCK_ON_DEVICE_ACCESS, which Google describes as
  device access for OAuth2 apps being unblocked). Google's reference does
  not name the Admin console control behind these events. Their text and
  parameters correspond to the control that sets a Google service to
  restricted or unrestricted, where a restricted service is open only to
  apps that are Trusted or were given that specific data. The service is in
  the event parameter OAUTH2_SERVICE_NAME in protoPayload.metadata, with
  documented values such as GMAIL, GMAIL_HIGH_RISK, DRIVE, DRIVE_HIGH_RISK,
  GSUITE_ADMIN and CLOUD_PLATFORM, and the scope in ORG_UNIT_NAME. The rule
  fires for every service, so read the parameter to see which one was
  opened. Blocking a service again is a different event and does not match.
  The entries reach Cloud Audit Logs as Admin Activity entries at
  organization level, which are always written once Google Workspace data
  sharing with Google Cloud is enabled, and reach the SIEM only when the
  organization-level logs are routed to it.
references:
  - https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
  - https://developers.google.com/workspace/admin/reports/v1/appendix/activity/admin-security-settings
  - https://knowledge.workspace.google.com/admin/apps/control-which-apps-access-google-workspace-data
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484
logsource:
  product: gcp
  service: gcp.audit
detection:
  selection:
    protoPayload.serviceName: admin.googleapis.com
    protoPayload.methodName:
      - google.admin.AdminService.allowServiceForOauth2Access
      - google.admin.AdminService.unblockOnDeviceAccess
  condition: selection
falsepositives:
  - A planned change of the app access policy, for example opening a service for a pilot group in one organizational unit. Give priority to changes that open Gmail, Drive or the admin APIs, and verify each one against a change record.
level: medium

False positives

  • A planned change of the app access policy, for example opening a service for a pilot group in one organizational unit. Give priority to changes that open Gmail, Drive or the admin APIs, and verify each one against a change record.

Marketplace App Added to the Domain or the Allowlist, or Allowlist Setting Changed in Google Workspace

Detects three Admin audit events for Google Workspace Marketplace apps: an application added to the domain (ADD_APPLICATION), an application added to the allowlist for the domain (ADD_APPLICATION_TO_WHITELIST) and a change of an allowlist setting (CHANGE_WHITELIST_SETTING). Google states that apps in the Marketplace allowlist are automatically trusted, so an addition there also lets the app reach restricted Google services. The app is in the event parameters APPLICATION_NAME and APP_ID in protoPayload.metadata. For the setting event the changed setting is in SETTING_NAME with OLD_VALUE and NEW_VALUE. Google's reference does not list the setting names or their values, so the rule fires on any change of the setting, in either direction. The entries reach Cloud Audit Logs as Admin Activity entries at organization level, which are always written once Google Workspace data sharing with Google Cloud is enabled, and reach the SIEM only when the organization-level logs are routed to it.

LevelLowStatusExperimentalLog sourceGoogle Cloud Audit Logs
title: Marketplace App Added to the Domain or the Allowlist, or Allowlist Setting Changed in Google Workspace
id: d11bb7a5-f28a-494b-ae39-91dcd333392f
status: experimental
description: >-
  Detects three Admin audit events for Google Workspace Marketplace apps: an
  application added to the domain (ADD_APPLICATION), an application added to
  the allowlist for the domain (ADD_APPLICATION_TO_WHITELIST) and a change
  of an allowlist setting (CHANGE_WHITELIST_SETTING). Google states that
  apps in the Marketplace allowlist are automatically trusted, so an
  addition there also lets the app reach restricted Google services. The app
  is in the event parameters APPLICATION_NAME and APP_ID in
  protoPayload.metadata. For the setting event the changed setting is in
  SETTING_NAME with OLD_VALUE and NEW_VALUE. Google's reference does not
  list the setting names or their values, so the rule fires on any change of
  the setting, in either direction. The entries reach Cloud Audit Logs as
  Admin Activity entries at organization level, which are always written
  once Google Workspace data sharing with Google Cloud is enabled, and reach
  the SIEM only when the organization-level logs are routed to it.
references:
  - https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
  - https://developers.google.com/workspace/admin/reports/v1/appendix/activity/admin-domain-settings
  - https://knowledge.workspace.google.com/admin/apps/get-started-as-a-marketplace-app-admin
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484
logsource:
  product: gcp
  service: gcp.audit
detection:
  selection:
    protoPayload.serviceName: admin.googleapis.com
    protoPayload.methodName:
      - google.admin.AdminService.addApplication
      - google.admin.AdminService.addApplicationToWhitelist
      - google.admin.AdminService.changeWhitelistSetting
  condition: selection
falsepositives:
  - Routine installation and allowlisting of Marketplace apps by the administrators who manage them. In organizations that add apps often, exclude those administrators by principalEmail in a filter_* selection and review additions by anyone else.
level: low

False positives

  • Routine installation and allowlisting of Marketplace apps by the administrators who manage them. In organizations that add apps often, exclude those administrators by principalEmail in a filter_* selection and review additions by anyone else.

OAuth App or All Internal Apps Trusted in Google Workspace

Detects an admin giving an app the Trusted access setting in the API controls of a Google Workspace or Cloud Identity account (Admin audit event ADD_TO_TRUSTED_OAUTH2_APPS, "App trusted"), or trusting all internal apps at once (TRUST_DOMAIN_OWNED_OAUTH2_APPS, "Domain Owned Apps trusted"). Google describes a Trusted app as having access to all Google Workspace services, including restricted ones, so a restriction on Gmail or Drive no longer applies to it. The app is in the event parameters OAUTH2_APP_NAME, OAUTH2_APP_ID and OAUTH2_APP_TYPE in protoPayload.metadata, and the scope of the change in ORG_UNIT_NAME. Removing trust is a different event and does not match. The entries reach Cloud Audit Logs as Admin Activity entries at organization level, which are always written once Google Workspace data sharing with Google Cloud is enabled, and reach the SIEM only when the organization-level logs are routed to it.

LevelMediumStatusExperimentalLog sourceGoogle Cloud Audit Logs
title: OAuth App or All Internal Apps Trusted in Google Workspace
id: d49fc54c-2844-485e-add7-86b043508e7c
status: experimental
description: >-
  Detects an admin giving an app the Trusted access setting in the API
  controls of a Google Workspace or Cloud Identity account (Admin audit
  event ADD_TO_TRUSTED_OAUTH2_APPS, "App trusted"), or trusting all internal
  apps at once (TRUST_DOMAIN_OWNED_OAUTH2_APPS, "Domain Owned Apps
  trusted"). Google describes a Trusted app as having access to all Google
  Workspace services, including restricted ones, so a restriction on Gmail
  or Drive no longer applies to it. The app is in the event parameters
  OAUTH2_APP_NAME, OAUTH2_APP_ID and OAUTH2_APP_TYPE in
  protoPayload.metadata, and the scope of the change in ORG_UNIT_NAME.
  Removing trust is a different event and does not match. The entries reach
  Cloud Audit Logs as Admin Activity entries at organization level, which
  are always written once Google Workspace data sharing with Google Cloud is
  enabled, and reach the SIEM only when the organization-level logs are
  routed to it.
references:
  - https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
  - https://developers.google.com/workspace/admin/reports/v1/appendix/activity/admin-security-settings
  - https://knowledge.workspace.google.com/admin/apps/control-which-apps-access-google-workspace-data
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484
logsource:
  product: gcp
  service: gcp.audit
detection:
  selection:
    protoPayload.serviceName: admin.googleapis.com
    protoPayload.methodName:
      - google.admin.AdminService.addToTrustedOauth2Apps
      - google.admin.AdminService.trustDomainOwnedOauth2Apps
  condition: selection
falsepositives:
  - Onboarding of a reviewed business application by the team that manages app access. These changes are planned and infrequent. Verify the app's client ID and publisher against the request before accepting the change.
level: medium

False positives

  • Onboarding of a reviewed business application by the team that manages app access. These changes are planned and infrequent. Verify the app's client ID and publisher against the request before accepting the change.

Organization-Wide API or OAuth Access Setting Changed in Google Workspace

Detects a change of two organization-wide settings in the Admin audit log of a Google Workspace or Cloud Identity account: OAuth access for all APIs (TOGGLE_OAUTH_ACCESS_TO_ALL_APIS, rendered as "OAuth access for all APIs changed to" a value) and API access for the organization (ENABLE_API_ACCESS, rendered as "API access for your organization changed from" one value to another). Google's reference gives the message text and the values true and false for these events but does not describe the settings further, so the rule is written on the event names alone and at a low level. It fires on any change. Read NEW_VALUE, and OLD_VALUE where present, in the event parameters (protoPayload.metadata) to see whether access was opened. The entries reach Cloud Audit Logs as Admin Activity entries at organization level, which are always written once Google Workspace data sharing with Google Cloud is enabled, and reach the SIEM only when the organization-level logs are routed to it.

LevelLowStatusExperimentalLog sourceGoogle Cloud Audit Logs
title: Organization-Wide API or OAuth Access Setting Changed in Google Workspace
id: 7cb44772-ff5c-46cc-9663-b2a54b928aa1
status: experimental
description: >-
  Detects a change of two organization-wide settings in the Admin audit log
  of a Google Workspace or Cloud Identity account: OAuth access for all APIs
  (TOGGLE_OAUTH_ACCESS_TO_ALL_APIS, rendered as "OAuth access for all APIs
  changed to" a value) and API access for the organization
  (ENABLE_API_ACCESS, rendered as "API access for your organization changed
  from" one value to another). Google's reference gives the message text and
  the values true and false for these events but does not describe the
  settings further, so the rule is written on the event names alone and at a
  low level. It fires on any change. Read NEW_VALUE, and OLD_VALUE where
  present, in the event parameters (protoPayload.metadata) to see whether
  access was opened. The entries reach Cloud Audit Logs as Admin Activity
  entries at organization level, which are always written once Google
  Workspace data sharing with Google Cloud is enabled, and reach the SIEM
  only when the organization-level logs are routed to it.
references:
  - https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
  - https://developers.google.com/workspace/admin/reports/v1/appendix/activity/admin-domain-settings
author: Forestall
date: 2026-11-18
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484
logsource:
  product: gcp
  service: gcp.audit
detection:
  selection:
    protoPayload.serviceName: admin.googleapis.com
    protoPayload.methodName:
      - google.admin.AdminService.toggleOauthAccessToAllApis
      - google.admin.AdminService.enableApiAccess
  condition: selection
falsepositives:
  - A change that turns the access off matches as well. Read the new value in the event parameters.
  - Planned changes of the organization's API access policy. These settings change rarely, so verify each change with the admin who made it.
level: low

False positives

  • A change that turns the access off matches as well. Read the new value in the event parameters.
  • Planned changes of the organization's API access policy. These settings change rarely, so verify each change with the admin who made it.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

App access opened and closed again within a short time

Detection hypothesisSequence of events

Opening an app access control is a preparation. An attacker who trusts an app or lifts the restriction on a service, lets the app obtain its access and then restores the setting leaves a configuration that looks as strict as before. The pair of opposite events for the same app or service is the trace.

  1. An opening event: google.admin.AdminService.addToTrustedOauth2Apps (note the event parameter OAUTH2_APP_ID), trustDomainOwnedOauth2Apps or allowServiceForOauth2Access (note OAUTH2_SERVICE_NAME), with the scope in ORG_UNIT_NAME.
  2. Within 24 hours the opposite event for the same app or service: removeFromTrustedOauth2Apps, untrustDomainOwnedOauth2Apps or disallowServiceForOauth2Access.
  3. Review the OAuth Token Audit entries of oauth2.googleapis.com between the two events for the app that gained access.

Eventsgoogle.admin.AdminService.addToTrustedOauth2Appsgoogle.admin.AdminService.removeFromTrustedOauth2Appsgoogle.admin.AdminService.trustDomainOwnedOauth2Appsgoogle.admin.AdminService.untrustDomainOwnedOauth2Appsgoogle.admin.AdminService.allowServiceForOauth2Accessgoogle.admin.AdminService.disallowServiceForOauth2Access

LimitsAn admin who corrects a mistake produces the same pair, so ask the admin. The 24 hours are a starting point. Google states that restricting a service revokes the tokens of apps that are not trusted, so closing a service may undo the access again, while an app that was trusted and then set back is a separate case to check.

Triage

  • Read the event parameters in protoPayload.metadata. A trusted app is named by OAUTH2_APP_NAME, OAUTH2_APP_ID and OAUTH2_APP_TYPE, an opened service by OAUTH2_SERVICE_NAME, a Marketplace app by APPLICATION_NAME and APP_ID, and the scope of the change by ORG_UNIT_NAME.
  • Confirm the change with the admin who made it (principalEmail) through a second channel, and check that admin's recent sign-ins.
  • Find out who publishes the app and who asked for it. An app nobody requested, or a client ID from a project outside the organization, needs an explanation.
  • Look at the OAuth Token Audit entries (service name oauth2.googleapis.com) after the change for activity of the app.
  • Review what else the same admin changed, such as other app access settings, domain-wide delegation and admin roles.

Response

Once the attack is confirmed:

  1. Reverse the change in API controls. Set the app to Blocked or remove its trusted setting, restrict the Google service again, and remove the app from the Marketplace allowlist.
  2. Remove the access the app already has. Google states that restricting a service revokes the tokens of apps that are not trusted, and that an admin can revoke the access of an admin-installed Marketplace app. Uninstall a Marketplace app that should not be there.
  3. Secure the admin account that made the change. Reset its password, end its sessions and review its 2-Step Verification methods.
  4. Establish what the app reached while the control was weakened, from the token audit log and the audit logs of the services it had scopes for, and treat that data as exposed.
  5. Compare the full list of configured apps and the restriction state of each service with your record, because the same admin may have changed more than one setting.

Mitigation

  • Restrict the Google services that hold sensitive data, such as Gmail and Drive, and configure only reviewed apps as Trusted or with access to specific Google data.
  • For unconfigured third-party apps, allow sign-in only or no access, instead of access to any third-party app.
  • Let users install only allowlisted Marketplace apps, and review each addition to the allowlist as a grant of trust, because allowlisted apps are trusted automatically.
  • Limit the Service Settings and Google Workspace Marketplace admin privileges to a few administrators, and review the configured apps and the accessed apps lists regularly.
  • Share Workspace data with Google Cloud and route the organization-level audit logs to the SIEM.

Frequently asked questions

Does trusting an app give it access to user data right away?

Trusting an app changes what it is allowed to reach. Google describes a Trusted app as having access to all Google Workspace services, including restricted ones, so a restriction on Gmail or Drive no longer applies to it. The audit entry for the change is not a data access event. What the app then does with the access is recorded separately, in the token audit log and in the logs of the services, which is why activity after the change has to be reviewed.

Which app access changes do the rules on this page not see?

Google's Admin audit reference also has events for an app removed from the blocked list, an app trusted for certain OAuth scopes, an app exempted from API access blocks and the setting for unconfigured third-party apps. These are not in the list of Admin audit methods that Google publishes for Cloud Audit Logs, so no rule here is written on them. Read them in the Admin console's audit log or through the Reports API.

How do I tell a loosening change from a tightening one?

The rules for trusted apps and for opened services match events that only go one way. Removing trust and restricting a service are separate events and do not match. The rules for the Marketplace settings and the organization-wide API access settings fire on any change, because the method name does not carry the direction. Read `NEW_VALUE` and `OLD_VALUE` in the event parameters for those.

Why does the Marketplace allowlist matter for API controls?

Google states that apps in the Marketplace allowlist are automatically trusted. Adding an app to the allowlist is therefore more than letting users install it. It also puts the app among those that can reach restricted services, without a separate entry in the app access list.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.