Google Workspace
Connect Google Workspace so Safeguard can check users, sign-in policies, devices, email authentication and Drive sharing.
Connect Google Workspace
Safeguard reads your Google Workspace directory and policies with read-only access: users and admins, organizational units and groups, 2-Step Verification and password policies, session length, third-party app access, external Drive sharing, mobile and managed devices, and the SPF, DKIM and DMARC records of your domains.
There are two cards:
- Google Workspace: users, admins, policies, devices and email authentication. The Drive sharing policy is checked here too.
- Google Drive: a separate connection that collects Drive evidence, with the
drive.readonlygrant. It can also connect Google's Drive MCP server so Griffin AI can search and read files (read-only: it never creates, copies or changes them).
Choose a sign-in
| Google sign-in (OAuth) | Service account with domain-wide delegation | |
|---|---|---|
| Who sets it up | A Google Workspace administrator signs in and approves | A Google Cloud project owner and a Workspace super admin |
| Scopes | 6 read-only scopes (below) | The same 6, plus cloud-identity.devices.readonly (7 in all), and one optional scope |
| Users, admins, policies, Drive sharing, email authentication | Covered | Covered |
| Endpoint management checks (Google managed devices) | Not covered: Google does not allow the devices scope in a sign-in | Covered |
| Departed users who still hold app tokens | Reported as could not read | Covered when you add the optional scope |
Use the service account if you want every check. The connect sheet recommends it for Google Workspace. The Google sign-in is quicker and covers everything else.
Scopes
The Google sign-in asks for these 6 read-only scopes:
https://www.googleapis.com/auth/admin.directory.user.readonly: users and adminshttps://www.googleapis.com/auth/admin.directory.domain.readonly: your domains, for the email authentication checkhttps://www.googleapis.com/auth/admin.directory.device.mobile.readonly: phones and tablets in Workspace mobile managementhttps://www.googleapis.com/auth/admin.directory.orgunit.readonly: which organizational unit a policy applies tohttps://www.googleapis.com/auth/admin.directory.group.readonly: a 2-Step Verification policy that applies to a grouphttps://www.googleapis.com/auth/cloud-identity.policies.readonly: password, session length, 2-Step Verification, Drive sharing and API control policies
A service account is granted those 6 plus one more, 7 in all:
https://www.googleapis.com/auth/cloud-identity.devices.readonly: devices for the endpoint management checks
One more scope is optional, for the service account only:
https://www.googleapis.com/auth/admin.directory.user.security: this scope is not read-only. Google has no read-only scope that lists the app tokens a user still holds, and this one also lets the holder revoke tokens and sign users out. Safeguard never uses it to change anything, and only one test uses it: the check on departed users who are still active (idp-leaver-still-active). Without it, that test reports that it could not read the tokens, not a failure. Leave it out if you prefer.
Already connected with the Google sign-in?
A connection made before this release holds only the scopes it was granted then. To grant the new ones, open the Google Workspace card and click Reconnect, then approve again. Until you do, the checks that need a missing scope report that they could not read, naming the scope.
Option A: Google sign-in (OAuth)
- In Safeguard, open Compliance › Connectors, search for Google Workspace and click Connect.
- Choose OAuth and sign in with a Google Workspace administrator account. The directory is visible only to administrators.
- Approve the read-only scopes. The card shows Verified once Google confirms the grant.
If Google says the app is not verified or access is blocked
Google can stop the sign-in with a screen that says the app has not been verified, or that access is blocked by your administrator. You have two ways forward:
- Use the service account instead. It needs no pop-up and no app approval, and it covers every check. On the connect sheet, click Use a service account instead and follow Option B.
- Have an administrator mark Safeguard as trusted. In the Google Admin console, go to Security › Access and data control › API controls and click Manage third-party app access. Click Configure new app, search for Safeguard, select it, choose the organizational units it applies to, select Trusted and finish. Then try the sign-in again.
Option B: Service account with domain-wide delegation
-
In the Google Cloud console, pick or create a project, then go to IAM & Admin › Service accounts and create a service account. It needs no roles.
-
In APIs & Services › Library, enable the Admin SDK API and the Cloud Identity API for that project.
-
Open the service account, go to Keys › Add key › Create new key, choose JSON and download the file. Google shows it only once.
-
Copy the service account's client ID. The connect sheet also shows it once you paste the key.
-
In the Google Admin console, go to Security › Access and data control › API controls › Manage domain-wide delegation. You need a super admin for this step. Click Add new, enter the client ID and paste the scopes as one comma-separated line (the connect sheet has a copy button for it):
https://www.googleapis.com/auth/admin.directory.user.readonly,https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/admin.directory.device.mobile.readonly,https://www.googleapis.com/auth/admin.directory.orgunit.readonly,https://www.googleapis.com/auth/admin.directory.group.readonly,https://www.googleapis.com/auth/cloud-identity.policies.readonly,https://www.googleapis.com/auth/cloud-identity.devices.readonlyTo cover departed users who still hold app tokens, add
https://www.googleapis.com/auth/admin.directory.user.securityto the line (optional, and not read-only: see Scopes). Click Authorize.Google's guide: Control API access with domain-wide delegation.
-
In Safeguard, open Compliance › Connectors › Google Workspace › Connect and choose Service account (the API token method):
| Field | What to enter |
|---|---|
| Service account key (JSON) | The full JSON key file. Paste it or choose the file. |
| Admin email to impersonate | The email of a super admin, or of an admin who can read users, groups and devices, for example admin@your-domain.com. Safeguard reads as this admin and changes nothing. |
| OAuth access token (optional) | Leave empty. It is an alternative for a short-lived token with Admin SDK Directory scopes. |
A scope you did not delegate affects only the checks that need it: those report that they could not read, naming the scope to add under Manage domain-wide delegation, and the rest still run.
Google Drive
Connect the Google Drive card with OAuth (scope drive.readonly) or the same service account form. The external sharing check itself comes from the Google Workspace connection's policy read.
What Safeguard checks
- 2-Step Verification enforced, and weak second factors disabled
- Administrators: how many, and whether they use phishing-resistant MFA
- Password policy and session length
- Inactive users, and departed users who are still active or still hold app tokens
- Third-party app access restrictions
- External Drive sharing
- Phones and tablets in Workspace mobile management
- Endpoint management: disk encryption, operating system updates, screen lock on phones and tablets, firewall and anti-malware on computers that report through Endpoint Verification, and devices of people who have left. These need the service account connection.
- SPF, DKIM and DMARC on your domains, read from public DNS
Policies are judged for every organizational unit and group they target, so a weaker setting on a sub-unit is not hidden by a strong top-level one.
Choose what this connector collects
Each connector has a What this connector collects panel, on the connect sheet and on the connected card. It lists the tests and evidence checks that read from that connector, and each one has a switch. Switch one off to stop collecting it from this connector. Another connector can still supply it: for example, switch MFA off here and take it from your identity provider. Only the person who connected it or an administrator can change these switches.
Troubleshooting
- Could not read, naming a scope: delegate that scope under Manage domain-wide delegation, or reconnect the Google sign-in so it grants the current scopes. Endpoint management checks always need the service account.
- Google says the app is not verified, or access is blocked: see If Google says the app is not verified or access is blocked.
- Not working with a service account: check that the Admin SDK API and the Cloud Identity API are enabled in the key's project, that the admin email is an administrator in the same Workspace, and that the JSON key belongs to the service account you delegated.