Skip to main content

Google Workspace User Inventory Source

thumbnail icon

The Google Workspace User Inventory source collects a list of users from the Google Workspace Users API. It securely stores the required authentication, scheduling, and state tracking information.

Data collected

Polling IntervalData
24 hoursUsers

Setup

Vendor configuration

In this configuration, you will set up a Google Workspace User Inventory source account and configure it to be authorized and authenticated to use Google Workspace User Inventory. To set up a Google Workspace User Inventory account, you need to configure Google service account credentials. You may refer to the Google Documentation for more information.

Creating Service Account

To create service account credentials, follow the steps below:

  1. Navigate to the Google Console service account page.
  2. Log in with your credentials.
  3. Create a new project or select from the existing projects.
    workspace-setup1.png
  4. Enable Admin SDK API to have an administrator access. To locate this setting, you can search for Admin SDK in the search bar. Then select the Enable button.
    workspace-setup2.png
  5. You will be redirected to the Admin dashboard page. Select the Credentials option from the left navigation.
    select-credentials.png
  6. Click the create-cred-button.png button at the menu bar of the Google Console page, and select Service account from the options that appear.
    create-credentials-service.png
  7. After entering the service account details, you may leave the Optional fields and continue to click Done.
    login-service-account-details.png
  8. To create JSON for the service account, you must create a key. Select the service account email to navigate to the Keys tab.
    google_workspace_service_account_create_key.png.
  9. Click Keys tab on the same service account page.
    add-key.png
  10. From Add Key dropdown, select Create new key. At the prompt, select JSON and click Create to create a key
    generate-key.png
  11. JSON for the service account is automatically downloaded. Use this JSON file while configuring the Google Workspace User Inventory source.

Domain-wide Delegation

To add domain-wide delegation to your service account using the client ID or Key generated in above section, follow the steps below:

  1. Navigate to the Google Console service account page.
  2. Select your service account.
  3. Go to Advanced settings section.
  4. Under Domain-wide delegation, find your service account's Client ID. Click Copy to copy the client ID value to your clipboard.
    domain-delegation.png
  5. If you have super administrator access to the relevant Google Workspace account, click View Google Workspace Admin Console, then sign in using a super administrator user account and continue following the steps in the section below.
note

If you do not have super administrator access to the relevant Google Workspace account, contact a super administrator for that account and send them your service account's Client ID and list of OAuth Scopes so they can complete the following steps in the Admin console.

Adding OAuth Scope

OAuth Scope enables delegated access to a user's resources on a service, such as Google, without exposing the user's credentials to the third-party application. By adding the necessary OAuth scopes, you are specifying the level of access the service account has to your resources, while also ensuring security and privacy.

  1. From the Google admin console, go to Security section, then click API Controls.
    google_workspace_adding_scope1.png
  2. To add the OAuth scopes, locate the settings under Manage Domain Wide Delegation section.
    manage-domainwide-delegation.png
  3. Click Add new.
  4. In the Client ID field, paste the client ID you copied in step 5 of the Creating Service Account section.
  5. In the OAuth Scopes field, enter a comma-delimited list of the scopes required by your application.
    google_workspace_adding_scope2.png.

You can add any of the following OAuth scopes. Note the ones you select, you'll need to provide them when configuring the Sumo Logic Google Workspace Source.

 https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/cloud-platform

note

To ensure that you are authorized to fetch the users' details, it is recommended to add an OAuth scope to your Google Workspace service account. Adding the appropriate OAuth scope(s) maintains security and privacy for your users.

Learn more about OAuth scopes:

Source configuration

When you create a Google User Inventory source, you add it to a Hosted Collector. Before creating the Source, identify the Hosted Collector you want to use or create a new Hosted Collector. For instructions, see Configure a Hosted Collector.

To configure a Google Workspace User Inventory source:

  1. Classic UI. In the main Sumo Logic menu, select Manage Data > Collection > Collection.
    New UI. In the Sumo Logic top menu select Configuration, and then under Data Collection select Collection. You can also click the Go To... menu at the top of the screen and select Collection.
  2. On the Collectors page, click Add Source next to a Hosted Collector.
  3. Select Google Workspace: User Inventory.
  4. Enter a Name to display for the Source in the Sumo web application. The description is optional.
  5. (Optional) For Source Category, enter any string to tag the output collected from the Source. Category metadata is stored in a searchable field called _sourceCategory.
  6. Forward to SIEM. Check the checkbox to forward your data to Cloud SIEM so it becomes part of User Inventory.
    note

    Select Forward to SIEM only if you have Cloud SIEM installed.

  7. (Optional) Fields. Click the +Add Field link to define the fields you want to associate, each field needs a name (key) and value.
    • green check circle.png A green circle with a check mark is shown when the field exists in the Fields table schema.
    • orange exclamation point.png An orange triangle with an exclamation point is shown when the field doesn't exist in the Fields table schema. In this case, an option to automatically add the nonexistent fields to the Fields table schema is provided. If a field is sent to Sumo that does not exist in the Fields schema it is ignored, known as dropped. 
  8. The Delegated User Email is the email address of the user you want to call the API on behalf of. This user should have the necessary permissions to view the details of other users in your Google Workspace domain, such as an Admin role. At a minimum, the user should have the Users:Read permission. Learn more about Domain-Wide Delegation of Authority:
  9. Google Workspace Credentials. You can authenticate your service account credentials directly by uploading a JSON file credentials instead of breaking down the file into different sections for the UI schema. Click Upload and select the JSON file that you downloaded in the Service Account Credentials section.
  10. Provide the same Scope you defined for your service account during the Adding OAuth Scope above.
  11. The Query Parameter for Collecting User Data section provides two options, Customer or Domain Parameter. See the Directory API documentation from Google for details.
    • Customer ID. The unique ID for the customer's Google Workspace account. In the case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain. You can also use the my_customer alias to represent your account's customerId. The customerId is also returned as part of the Users resource.
    • Domain. The domain name. Use this field to get fields from only one domain. To return all domains for a customer account, use the customer query parameter instead.
  12. Processing Rules for Logs. (Optional) Configure any desired filters, such as allowlist, denylist, hash, or mask, as described in Create a Processing Rule.
  13. When you are finished configuring the Source, click Save.

Metadata fields

FieldValueDescription
_siemVendorGoogleSet when Forward To SIEM is checked.
_siemProductWorkspaceSet when Forward To SIEM is checked.
_siemDataTypeInventorySet when Forward To SIEM is checked and specific to the API collected.

JSON schema

Sources can be configured using UTF-8 encoded JSON files with the Collector Management API. See how to use JSON to configure Sources for details. 

ParameterTypeValueRequiredDescription
schemaRefJSON Object{"type":"Google Workspace User Inventory"}YesDefine the specific schema type.
sourceTypeString"Universal"YesType of source.
configJSON ObjectConfiguration objectYesSource type specific values.

Configuration Object

ParameterTypeRequiredDefaultDescriptionExample
nameStringYesnullType a desired name of the source. The name must be unique per Collector. This value is assigned to the metadata field _source."mySource"
descriptionStringNonullType a description of the source."Testing source"
categoryStringNonullType a category of the source. This value is assigned to the metadata field _sourceCategory. See best practices for details."mySource/test"
fieldsJSON ObjectNonullJSON map of key-value fields (metadata) to apply to the Collector or Source. Use the boolean field _siemForward to enable forwarding to SIEM.{"_siemForward": false, "fieldA": "valueA"}
clientEmailStringYesnullProvide the Client Email you got in the JSON file after you created service account credentials
delegatedUserEmailStringYesnullProvide the super-administrator email address for the domain that granted access to the service account you created.
credentialsJsonStringYesnullAuthentication service account's credentials to access Google Workspace Platform.
scopeStringYesnullProvide the same Scope you defined for your service account
queryParamBooleanNotrueBy default, the Customer parameter is selected with a CustomerID value of my_customer. To assign a different CustomerID provide the customerID parameter. Set to false to use the Domain parameter. You need to provide the domain parameter when false.
customerIDStringNomy_customerThe unique ID for the customer's Google Workspace account.
domainStringNo(except when queryParam is set to false.)The domain name. Use this field to get fields from only one domain.

JSON example

{
"type": "service_account",
"project_id": "sample_project",
"private_key_id": "asdfgh1234556",
"private_key": "-----BEGIN PRIVATE KEY-----\nsample_private_key\n-----END PRIVATE KEY-----\n",
"client_email": "sample_project@sample_service_account.com",
"client_id": "12345678",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sample_url.com"
}
Download example

Terraform example

resource "sumologic_cloud_to_cloud_source" "google-workspace-source" {
collector_id = sumologic_collector.collector.id
schema_ref = {
type = "Google Workspace User Inventory"
}
config = jsonencode({
"type": "service_account",
"project_id": "sample_project",
"private_key_id": "asdfgh1234556",
"private_key": "-----BEGIN PRIVATE KEY-----\nsample_private_key\n-----END PRIVATE KEY-----\n",
"client_email": "sample_project@sample_service_account.com",
"client_id": "12345678",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sample_url.com"
})
}
resource "sumologic_collector" "collector" {
name = "my-collector"
description = "Just testing this"
}
Download example

FAQ

info

Click here for more information about Cloud-to-Cloud sources.

Status
Legal
Privacy Statement
Terms of Use

Copyright © 2024 by Sumo Logic, Inc.