Quick Links

Configuring Google Workspace Threat Response

Overview

Google Workspace Threat Response allows you to respond to suspicious activity in your Google Workspace environment directly from Blumira. You can respond as soon as you receive a finding notification. From a supported finding, you can suspend a user, sign the user out, revoke third-party app access, remove external mail forwarding, and reset a password. You do not need to log in to the Google Admin console.

Before you begin

Before you use Google Workspace response actions, ensure the following:

  • You are an administrator in both Google Workspace and Blumira.
  • Your Blumira account has a Google Workspace Cloud Connector configured for logging.
  • You have a Google Cloud service account and its JSON key for Directory actions. To remove external forwarding, you also need a second service account and its JSON key for Gmail actions.
  • You have a Google Workspace administrator account for Blumira to impersonate. This account needs the User Management and Security admin privileges.

Service accounts

Blumira separates response permissions into two service accounts so that each one holds the least privilege that it needs. If a key is exposed, it grants only one set of permissions. You can also revoke either key without affecting the other. The following table describes the two service accounts:

Service account Required Actions that it allows
Directory Yes
  • Suspend User & Revoke Access
  • Suspend User
  • Unsuspend User
  • Sign Out User
  • Revoke Third-Party App Access
  • Reset Password & Revoke Sessions
  • Reset Password
Gmail No Remove External Forwarding. If you skip this service account, every other action still works.
Note: Blumira never requests the super administrator role. The Gmail scopes cover mail settings only and cannot read message bodies.

Configuring response actions

Configuration has three parts. First, add the service account keys in Blumira. Next, allow-list the client IDs in the Google Admin console. Finally, test the connection. To use your logging service account for Directory actions instead of a separate key, see Reusing or separating the logging credential.

Adding the service account keys

To add the service account keys, do the following:

  1. In Blumira, navigate to Ingestion > Cloud Connectors, and then open your Google Workspace Cloud Connector.
  2. Click the Threat Response tab.
  3. Under Directory service account key, do one of the following:
    • Click Upload key file, and then select the JSON key file.
    • Paste the contents of the JSON key file into the box.
  4. Copy the client ID that Blumira displays below the key, and copy the scopes. You need both in the Google Admin console.
  5. (Optional) To allow Blumira to remove external forwarding, repeat Steps 3 and 4 under Gmail service account key. The Gmail key has its own client ID.
  6. In Admin Email, type the email address of the administrator account that Blumira impersonates.

    Note: This will be the user that all response and API actions are attributed to. Best practice is to have a separate account for attribution, such as blumira_connection@domain.com.
  7. In Customer ID, type your Google Workspace customer ID. To find it, navigate to the Account settings page in the Google Admin console (Account > Account settings).
    Note: Blumira uses the Customer ID to select the correct connector when your organization has more than one Google Workspace connector. The value must match your tenant's customer ID exactly. If you leave it blank, Blumira fills it in after a successful connection test.
  8. If your users log in through a third-party identity provider, click the check box next to Users sign in through a third-party identity provider.

    Important: Set this check box accurately. If you clear it when another provider handles login, a password action runs and reports success, but it does not affect the attacker. If you are unsure, consider whether your users type a Google password or go to another login page. When this check box is selected, Blumira refuses password actions for your organization. Changing a Google password does not affect an attacker when another provider handles login.
  9. Click Connect.

Note: Domain-wide delegation uses the numeric client ID, not the service account email address. Blumira displays the client ID as soon as it reads the key. To find a client ID yourself, run the following command:

gcloud iam service-accounts describe SA@PROJECT.iam.gserviceaccount.com --format="value(oauth2ClientId)"

Allow-listing the scopes

Add every scope in the list below. If one scope is missing, every action fails, not only the action that uses that scope. Keep any scopes that the entry already has, and do not add other scopes. If you reuse your logging service account, removing its existing scope stops Google Workspace log ingestion.

To allow-list the scopes, do the following:

  1. In the Google Admin console, navigate to Security > Access and data control > API controls > Domain-wide delegation.
  2. Click Manage Domain Wide Delegation.
  3. If the Directory client ID already appears in the list, edit that entry. Otherwise, click Add new, and then type the client ID.
  4. Add the following three Directory scopes exactly as shown, and keep any scopes that the entry already has, such as for the logging connector:
  5. Click Authorize.
  6. (Optional) If you added a Gmail key, repeat Steps 3 through 5 with the Gmail client ID and the following two Gmail scopes:
Note: Google can take up to 24 hours to apply a domain-wide delegation change.

Reusing or separating the logging credential

Instead of uploading a Directory key, you can reuse the service account that your Google Workspace Cloud Connector uses for logging. To reuse it, select the Also use these credentials for Threat Response check box on the Cloud Connector's Logging tab. This option saves you from entering the key twice.

Blumira clears this check box by default. Selecting it gives a read-only logging credential permission to act on every user in your domain.

When you reuse the logging credential, note the following:

  • For a new connector, enter both the service account key and the administrator email address.
  • The logging administrator email address becomes the Threat Response Admin Email. Verify that this account has the User Management and Security admin privileges.
  • Add the Directory scopes to the logging client ID, and keep its existing logging scope. For more information, see Allow-listing the scopes.
  • Reuse does not add the Gmail key. To remove external forwarding, add the Gmail key on the Threat Response tab.
  • Before you run a password action, open the Threat Response tab and verify the Users sign in through a third-party identity provider check box and the Customer ID.
  • To reuse the credential on an existing connector, enter the logging credentials again. Blumira hides stored credentials after the first save, so it cannot copy them.

Testing the connection

After you save the connector, test it on the Threat Response tab. The test is read-only, and you can run it as often as you like.

Note: The test runs against the saved connector, not the values in the form, so saving the connector is required before testing. Google can take up to 24 hours to apply a delegation change, so a first test can fail. Blumira keeps your credentials, and you can save the connector without a passing test. 

To test the connection, do the following:

  1. In your Google Workspace Cloud Connector, click the Threat Response tab.
  2. In Test user, type the email address of any user. When you test an administrator, the result shows which administrator rules apply to that account.
    Note: The test does not check the Protected Accounts list. Blumira checks that list when an action runs.
  3. Click Test connection.

Blumira reports a result for Directory, Gmail, and Customer ID. When the connection passes, Blumira reports that the connector is ready, and response actions appear on supported findings.

If you entered a test user, Blumira also simulates each action against that user without changing anything. The report shows the following:

  • Whether each action would run, and the reason if it would not, such as a missing Gmail key, an administrator target, or a user that does not exist
  • The number of third-party app grants that a revoke would remove
  • Whether forwarding is on, and the number of mail filters
  • Whether the user is already suspended

Disabling and re-enabling Threat Response

Disabling a response connector

To pause response actions without losing your credentials, do the following:

  1. Navigate to Cloud Connectors, and then open your Google Workspace Cloud Connector.

  2. Click the Threat Response tab.

  3. Click Disable.

Blumira turns off Threat Response and keeps your stored service account keys. Response actions no longer appear.

Re-enabling a disabled response connector

To turn Threat Response back on, open the Threat Response tab, and then click Enable. Blumira re-enables it with your stored credentials, so you do not re-enter the keys.

Note: The Enable action fails if the stored credentials were removed, if someone has set up a newer Threat Response connector since you disabled it, or if your organization's license no longer includes Threat Response. In that case, click Remove, and then set up Threat Response again.

Removing a response connector

To delete Threat Response and its credentials permanently, click Remove, and then click Confirm. Blumira deletes the stored keys, so setting it up again means re-entering them.

Troubleshooting test results

The following table describes the test results that need action:

Result Cause Solution
Directory not ready yet or Gmail not ready yet The client ID and scopes are not allow-listed, or Google is still applying them. Verify the client ID and scopes in the Google Admin console. Then wait and test again. Your key does not need to change.
The administrator account is not privileged enough The allow-listing worked, but the Admin Email account lacks the required privileges. Use an account with the User Management and Security admin privileges.
Google could not resolve the administrator account The Admin Email account does not exist or is not active. Verify that Admin Email is an active user in your domain.
The stored key is not usable Blumira cannot use the saved key. Upload the service account key again.
The Customer ID does not match The Customer ID does not match the tenant that the credentials belong to. Change Customer ID to the value that Blumira displays, and then save.
Gmail not configured You did not add a Gmail key. No action is needed unless you want to remove external forwarding.
The key looks like an OAuth client file You uploaded an OAuth client file instead of a service account key. Download the JSON key for the service account, and then upload it.

What each action does

The following table describes each response action:

Action What it does
Suspend User & Revoke Access Lists the third-party app grants of a user, suspends the account, signs the user out, and then revokes every third-party app grant. Use this action to contain a compromised account.
Suspend User Suspends the account in Google Workspace. This action does not revoke third-party app grants, so it does not stop an attacker who holds an app grant.
Sign Out User Resets the sign-in cookies of a user. Google documents up to one hour to clear current Gmail sessions, and this action does not sign a user out of desktop apps such as Drive for desktop. Suspension contains an account faster.
Revoke Third-Party App Access Revokes every third-party OAuth grant that the user made, not only the grant that an attacker uses. Google restores access if the user authorizes the app again. Revoking third-party access is the only step that stops consent phishing, because suspension does not affect a grant that an attacker already holds.
Remove External Forwarding Turns off auto-forwarding and removes forwarding addresses and filters that send mail outside your domains. Your domains include domain aliases, so internal forwards stay in place. Blumira never deletes all of the filters of a user. The action reports each change, including the previous auto-forwarding address and the full definition of each removed filter, so that you can restore a rule that it removed in error. This action requires the Gmail service account, and the user must have a Gmail mailbox.
Reset Password & Revoke Sessions Replaces the password with a random passphrase that Blumira does not store, requires a password change at the next login, and signs the user out. Google also revokes the mail-scope OAuth grants of the user when the password changes.
Reset Password Replaces the password the same way as Reset Password & Revoke Sessions, but does not sign the user out. Use this action for routine help-desk resets, not for a compromised account.
Unsuspend User Restores a suspended account. If the Admin Email account is a delegated administrator, this action cannot restore a super administrator account. Use the Google Admin console instead.
Important: Password actions hold the account. They do not give the user a working password. Because Blumira does not store the passphrase, an administrator must reset the password in the Google Admin console before the user can log in.
Note: Blumira refuses password actions when the “Users sign in through a third-party identity provider” check box is selected. In that case, reset the password in your identity provider, and then use the "Suspend User & Revoke Access" action to contain the account in Google.

Reviewing partial results

Some actions run several steps, and each step can succeed or fail on its own. If any step fails, Blumira reports the action as failed, even when other steps succeeded. For example, Suspend User & Revoke Access might suspend the user but fail to revoke the app grants. The action reports a failure because the account still has third-party access.

Acting on administrator accounts

Blumira can act on administrator accounts, with limits that keep your domain from losing admin access:

  • Blumira never acts on the administrator account that the connector signs in as (the Admin Email).
  • If the Admin Email account is a delegated administrator, which is the recommended setup, Blumira refuses every action on a super administrator. Act on super administrators in the Google Admin console. Blumira acts on delegated (non-super) administrators the same way as any other user.
  • If the Admin Email account is a super administrator, Blumira can act on other super administrators, with these limits:
Action On a super administrator

Suspend User, Suspend User & Revoke Access

Runs, unless the target is the last active super administrator

Sign Out User, Remove External Forwarding, Revoke Third-Party App Access, Unsuspend User

Runs

Reset Password, Reset Password & Revoke Sessions

Never runs

If Blumira cannot confirm that another super administrator stays active, it refuses the suspend. If the response says to try again, wait a moment and run the action again.

Ongoing validation

Blumira rechecks the stored credentials on a schedule to find drift before you need an action during an incident. Examples of drift include a key that rotated on the logging side but not on the response side, and a scope that is no longer allow-listed. A failed check does not disable the connector, because Google can take up to 24 hours to apply a change. If the Customer ID is blank, the scheduled check fills it in from your tenant. To check the connection yourself, see Testing the connection.