User Risk: Create a Google Workspace service account
- Overview
- Step 1: Create a user for the integration
- Step 2: Assign the Super admin role or use a custom role instead
Overview
User Risk reads your users and their SaaS usage from Google Workspace through the Google Workspace APIs. You grant access through Google's standard OAuth consent screen, using an account that holds the permissions below.
Setup workflow:
- Create a Google Workspace user for the integration.
- Give that user access; either the Super admin role, or a custom role.
- Connect the account to User Risk in UpGuard.
🎵 If your directory is in Microsoft Entra, see User Risk: Create an Entra app registration instead.
Step 1: Create a user for the integration
❗ The account can only access users in the organizational unit it is created in and the units below it.
Create the account at the highest organizational unit that covers the users you want to see in User Risk.
- Log in to the Google Admin console.
- Navigate to Directory > Users.
- Click Add a New User.
- Fill in the user information.
- Click Add New User.
The account exists but has no permissions yet. Grant them using either Step 2 or Step 3.
Step 2: Assign the Super admin role or use a custom role instead
The Super admin role gives User Risk visibility of every user in your directory. Use this step unless your organization doesn't want the integration account holding Super admin. If this is the case, you'll need to use a custom role instead.
Assign the Super admin role
- In the Google Admin console, navigate to Directory > Users and open the user you created.
- Click Assign Roles under Admin roles and privileges.
- Toggle on the Super admin role.
The account can now scan every user in your directory. Skip the custom role steps and go to Step 3.
Use a custom role instead
Use these steps only if you did not assign the Super admin role.
❗ An account with a custom role cannot list OAuth tokens for users who hold custom admin roles, or whose privileges are equal to or higher than the account; those tokens are omitted from your scan results.
Create the custom role
- In the Google Admin console, navigate to Account > Admin roles.
- Click Create a New Role.
- Fill in the role details and click Continue.
- On the Select privileges screen, scroll down to Admin API privileges.
- Select the following privileges:
- User security management
- Organisation units > Read
- Users > Read
- Click Continue.
- Check that the right permissions are selected, then click Create Role.
Assign the custom role to the user
- Select the custom role you created.
- Click Assign members.
- Search for and select the user you created.
- Click Assign role.
The account now has the permissions User Risk needs.
❗ Google assigns the role to the top organizational unit by default, which grants access to every organizational unit.
To limit which users User Risk scans, create a role assignment for each organizational unit that contains users you want scanned. If your organizational units are nested, create an assignment for the parent unit and one for each child. Google only allows a single assignment at the top organizational unit.
Step 3: Connect User Risk to your directory
- Click the Settings (gear) icon in UpGuard's upper right-hand corner.
- Click Directory Integration under User Risk in the left-hand navigation panel.
-
In the Google Workspace integration section, click Integrate via OAuth.
-
Sign in with the account you created and grant the requested permissions on Google's OAuth consent screen.
Your directory is now connected. The Directory Integration screen shows a Start Scan button and the date your directory was last scanned.
What User Risk collects
User Risk reads the following for each user in your directory:
- name
- role
- team
It also reads SaaS usage information from your workspace. This is similar to the view an individual user sees on their own Google account connections page.
User Risk calls the Google Workspace API to list your organization's users and their associated SaaS usage. It can only do this while the integration is connected and the account has the permissions above.
The integration account grants User Risk these two Google Workspace API scopes: