Google Workspace
Copy link

Rapid7 SIEM (InsightIDR) collects Google Workspace data through a cloud connection. After you connect your Google Workspace domain, SIEM (InsightIDR) collects these data types: Users, Groups, Group Members, Email Logs, Activity Logs, and Alerts.

To set up the Google Workspace event source:

  1. Review Before you begin and complete any prerequisite steps.
  2. Configure Google Workspace to send data to SIEM (InsightIDR).
  3. Configure SIEM (InsightIDR) to collect data from the event source.

You can also:

Before you begin
Copy link

You must have administrator-level privileges for your Google Workspace domain. The Admin Email that you provide in SIEM (InsightIDR) must belong to a user with super admin rights.

Configure Google Workspace to send data to SIEM (InsightIDR)
Copy link

Complete these tasks to establish communication between SIEM (InsightIDR) and Google Workspace.

Task 1: Create a service account and key
Copy link

A service account allows SIEM (InsightIDR) to sign in to Google Workspace and read your data. If you already have a service account and key for this event source, skip to Authorize API scopes for the service account.

  1. From the Google Cloud console, create a project , or select an existing project.
  2. Enable the Admin SDK API  and the Alert Center API  for the project.
  3. Create a service account . Enter a name and description for the account. Google generates the service account ID.
  4. When Google prompts you to grant the service account access to the project, from the Role dropdown, select Project > Owner.
  5. Create a key  for the service account, and select JSON as the key type.

Google saves the JSON key file to your browser’s default download location.

Task 2: Authorize API scopes for the service account
Copy link

Domain-wide delegation allows the service account to access Google Workspace data on behalf of users in your domain. Authorize the scopes that SIEM (InsightIDR) needs to collect each data type.

  1. From the Google Workspace Admin console , select Security > Access and data control > API controls. If Security isn’t visible, select More controls first.

  2. Select Manage Domain Wide Delegation.

  3. Select Edit for your existing Client ID, or add a new entry that uses the client_id value from the JSON key file.

  4. Add these API scopes, separated by commas:

    https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.reports.audit.readonly, https://www.googleapis.com/auth/apps.alerts
  5. Save your changes.

Delegation changes usually apply within a few minutes. Google states that changes can take up to 24 hours.

Task 3: Collect the connection details
Copy link

Collect these values before you configure the connection in SIEM (InsightIDR):

  • Client ID - The numeric Unique ID on the service account’s details page. This value is also the client_id field in the JSON key file. Use the same Client ID that you authorized for domain-wide delegation.
  • Client Email - The service account email address, for example name@project-id.iam.gserviceaccount.com. This value is the client_email field in the JSON key file.
  • Admin Email - The email address of an active Google Workspace user with super admin rights.
  • Customer ID - Your Google customer ID. To find it, in the Google Workspace Admin console, go to Account > Account settings > Profile. The ID uses the format C0xxxxxxx.
  • Private Key - The private_key value from the JSON key file, or from a key you previously generated for the service account.

Configure SIEM (InsightIDR) to collect data from the event source
Copy link

After you authorize the API scopes, add the event source in SIEM (InsightIDR).

  1. From Command Home, go to Data Connectors > Data Collectors.
  2. Go to the Event Sources tab, then select Add Event Source.
  3. Do one of the following:
    • Search for Google Workspace in the event sources search bar.
    • In the Product Type filter, select Cloud Service.
  4. Select the Google Workspace event source tile.
  5. Select an existing connection, or select Add a New Connection.
  6. Enter the values that you collected in Collect the connection details.
  7. Select Save & Test Connection.
  8. View the connection status.

If the connection test returns an error, see Troubleshoot connection test errors.

How the connection test works
Copy link

The connection test runs these checks in order and stops at the first check that fails:

  1. Validates that Admin Email and Client Email are email addresses.
  2. Validates that Private Key is a service account key.
  3. Signs in as Admin Email, using the service account, for each required scope.
  4. Confirms that Client ID belongs to the service account in Client Email.
  5. Confirms that Customer ID exists and that Admin Email can read it.

If the test passes, SIEM (InsightIDR) lists each data type with a status of true or false:

Users: true Groups: true Group Members: true Email Logs: false Activity Logs: false Alerts: true

SIEM (InsightIDR) collects a data type only after you authorize its scope. To resolve data types that show false, see Data types show false after a passed test.

Troubleshoot connection test errors
Copy link

Email address is not valid
Copy link

The test returns Admin Email is not a valid email address. or Client Email is not a valid email address. The value is empty or doesn’t use the form user@example.com.

To resolve this error, check these values:

  • Client Email - Enter the service account email address, for example name@project-id.iam.gserviceaccount.com. This value is the client_email field in the JSON key file.
  • Admin Email - Enter the email address of a Google Workspace user with super admin rights. Use a user account, not the service account.

The provided private key is not a valid service account key
Copy link

SIEM (InsightIDR) couldn’t read the Private Key. Copy the full private_key value from the service account’s JSON key file, including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines. Paste the value exactly as it appears in the file, without edits, trimming, or re-wrapping.

Unable to authenticate against Google Workspace
Copy link

Google rejected the sign-in.

To resolve this error, check these items:

  • The Client Email matches the service account that issued the Private Key.
  • The key is active. To check, go to the Google Cloud console and select IAM & Admin > Service Accounts > Keys. If the key was deleted or disabled, create a new key, enter the new key in the connection, and run the test again.
  • The Admin Email belongs to an active user in your domain. Suspended users can’t authenticate.

None of the required scopes are granted to the service account
Copy link

Domain-wide delegation isn’t set up for the service account. Complete the steps in Authorize API scopes for the service account, using the Client ID of the service account. Wait for the changes to apply, and then run the test again.

The Client ID does not match the service account
Copy link

The Client ID belongs to a different service account than the Client Email. Enter the numeric Unique ID from the service account’s details page. This value is also the client_id field in the JSON key file. Use the service account’s Unique ID, not the OAuth client ID of another project or app.

Unable to verify the Client ID
Copy link

The test couldn’t reach Google to check the Client ID. This error is usually a temporary network or Google issue. Run the test again. If the error persists, contact Rapid7 Support.

The Customer ID is invalid or not accessible
Copy link

The test couldn’t list users for the Customer ID.

To resolve this error, check these items:

  • The Customer ID is correct. To find it, in the Google Workspace Admin console, go to Account > Account settings > Profile. The ID uses the format C0xxxxxxx.
  • The Admin Email belongs to an admin of the same Google Workspace account.
  • The Admin SDK API is enabled in the Google Cloud project that owns the service account. To check, in the Google Cloud console, go to APIs & Services > Library > Admin SDK API.

Data types show false after a passed test
Copy link

The connection works, but the domain-wide delegation entry doesn’t include the scope for the data types that show false.

Each data type requires one of these scopes:

Data typeRequired scope
Usershttps://www.googleapis.com/auth/admin.directory.user.readonly
Groupshttps://www.googleapis.com/auth/admin.directory.group.readonly
Group Membershttps://www.googleapis.com/auth/admin.directory.group.member.readonly
Email Logs, Activity Logshttps://www.googleapis.com/auth/admin.reports.audit.readonly
Alertshttps://www.googleapis.com/auth/apps.alerts

To add a missing scope:

  1. From the Google Workspace Admin console, select Security > Access and data control > API controls > Manage Domain Wide Delegation.
  2. Select Edit for the Client ID entry.
  3. Add the scope for each data type that shows false.
  4. Save the entry.
  5. Wait for the changes to apply, and then run the connection test again.