For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Workspace: Disable Accounts

This guide helps you set up your Google Workspace device and grant necessary permissions so that you can enable the Disable Accounts auto remediation in Workbench.

This guide is the first step of a larger process to enable auto remediations. After completing the steps on this page, you will be instructed to return to the Enable an Auto Remediation in Workbench guide to finish your setup.

How It Works

If our SOC identifies an account (username or email address) that is compromised and must be disabled, Workbench completes the action automatically and logs the user out of their session. You have the option to restrict these actions to specific accounts by configuring an allow or deny list (the accounts must first be added as context, and then the list can be configured in Workbench; see Step 3).

Some vendors refer to disabling a user account as blocking a user, suspending a user, changing user status, removing a user from the org, or locking a user account.

Endpoints Used

Google Admin SDK Directory API

admin/directory/v1, via the google-api-python-client SDK

Method
Endpoint
Purpose

GET (users.get)

admin/directory/v1/users/{userKey}

Look up the user and read the current suspended flag

POST (users.signOut)

admin/directory/v1/users/{userKey}/signOut

Sign the user out of all sessions (must run before suspend)

PUT (users.update)

admin/directory/v1/users/{userKey}

Suspend the account

Session revocation and suspension are two separate calls. users.signOut invalidates all web/device sign-in sessions (done first because it is not allowed once suspended); it does not revoke third-party OAuth app grants. Revert sets suspended: false (no users.signOut on revert); requires a write scope (admin.directory.user) on the device.

Step 1: Add OAuth Scopes to Google

  1. Open the Google Workspace admin console: https://admin.google.com/ac/owl/domainwidedelegation.

  2. Navigate to Security > API Controls > Manage Domain Wide Delegation.

  3. Select Edit next to the Expel API client.

  4. Scroll to the bottom and add the following OAuth scopes:

    • https://www.googleapis.com/auth/admin.directory.user

    • https://www.googleapis.com/auth/admin.directory.user.security

      The two OAuth scopes are added on the Edit scopes screen.
  5. Select Authorize.

Step 2: Add OAuth Scopes to Workbench

  1. In a new browser tab, log in to Workbench.

  2. Navigate to Organization Settings > Security Devices.

  3. Find Google Workspace in the list.

  4. Select the down arrow in the Google Workspace row, and select View & Edit.

  5. Scroll to the end of API scopes field and add the OAuth scopes:

    • https://www.googleapis.com/auth/admin.directory.user

    • https://www.googleapis.com/auth/admin.directory.user.security

      The two OAuth scopes are added to the API scopes field, separated by a comma.
  6. Select Save.

Step 3: Update Your Context

If you do not want to specify any accounts for a "do not disable" or "always disable" list, and instead wish for Expel to automatically disable all identified accounts, skip to Step 4.

Working with your Customer Success Manager, prepare to create an allow or deny list by adding accounts as org context for your environment. You will then be able to select those accounts as "Never disable" or "Always disable" assets when you enable the auto remediation in Workbench.

If our SOC identifies an account that must be disabled and you have created either an allow ("Always disable") or deny ("Never disable") list in Workbench, any accounts falling outside of those parameters are assigned to you as actions rather than being disabled automatically.

Step 4: Return to the Main Setup Guide

Your Google Workspace device is now ready for the Disable Accounts auto remediation. You should now do one of the following:

  • If you do not need to set up any other devices for this auto remediation, you can return to the Enable an Auto Remediation in Workbench guide to finish Step 2 of the process.

  • If you need to set up additional devices for this auto remediation, or wish to use this device with multiple auto remediations, be sure to complete those setup guides as well before returning to the Enable an Auto Remediation in Workbench guide to finish Step 2 of the process. Make sure to follow the setup guide that is specific to your auto remediation, as device setup instructions are unique to each auto remediation and device.

Last updated

Was this helpful?