Send Google Workspace logs to LogPulse
Google Workspace audit activity from the Reports API (sign-ins, admin, OAuth tokens, SAML, Drive) and the alerts of the Alert Center.
Configure → Sources → Cloud. LogPulse reads the Reports API and Alert Center API itself, without an agent. Events land in the iam, audit indexes with source google_workspace and fill the Authentication, Change, Alerts data models.Overview
- Reports API and Alert Center API to Integration poller
- Integration poller to index=iam
- Integration poller to index=audit
LogPulse signs in to Google Workspace with the credential you give it and fetches new events every five minutes by default. You can set the interval per integration, from one minute to 24 hours.
What you need
- A service account with domain-wide delegation for admin.reports.audit.readonly and apps.alerts
- A super admin to act as
- In LogPulse: a role that may manage API keys. Cloud integrations fall under that right.
1. Create a credential in Google Workspace
| Field in LogPulse | Where you find it |
|---|---|
| Service account key (JSON) | In Google Cloud: IAM, Service accounts, Keys, Add key (JSON). Then in the Admin console: Security, API controls, Domain-wide delegation, add its client ID with the scopes admin.reports.audit.readonly and apps.alerts. Stored encrypted and never shown again. |
| Admin to act as | A super admin of the domain. LogPulse only reads. |
| Customer ID (optional) | Only when the admin manages more than one account. |
2. Add the integration in LogPulse
Go to Configure → Sources → Cloud and choose Google Workspace. Fill in the fields, tick the data sources you want and save. LogPulse first tests the connection with your credential and tells you what is wrong when it fails.
What arrives
| Data source | Index | Source | Sourcetype | What it holds |
|---|---|---|---|---|
| Login | iam | google_workspace | gws:reports:login | Every sign-in to Google: user, result, method, IP address and suspicious sign-ins. |
| Admin | audit | google_workspace | gws:reports:admin | Changes in the Admin console: users, roles, security settings, apps. |
| OAuth tokens | iam | google_workspace | gws:reports:token | Third-party apps that users authorised or revoked, with their scopes. |
| SAML | iam | google_workspace | gws:reports:saml | Sign-ins to SAML apps with Google as identity provider. |
| Drive (off by default) | audit | google_workspace | gws:reports:drive | File activity in Drive: views, downloads, sharing and visibility changes. High volume. |
| Alert Center | audit | google_workspace | gws:alerts | Alerts Google raises: phishing, suspicious sign-ins, government-backed attacks, leaked passwords. |
The index is the kind of data and the source is the product, so detection rules for that kind of data find Google Workspace without changes.
Fields and data models
| Data model | What you get |
|---|---|
| Authentication | Sign-ins with user, result, method and IP address. |
| Change | Admin changes, OAuth grants and Drive sharing. |
| Alerts | Alert Center alerts with severity and status. |
Field names follow the CIM field names. These are the fields LogPulse sets on Google Workspace events; a field is left out when Google Workspace did not send a value.
actionalert_idauthentication_methodcategoryclient_iddescriptiondestdest_userevent_namesfile_typeidnew_valueobjectobject_categoryobject_idold_valueownerreasonscopeseveritysignaturesrc_ipstatustenant_idthreat_suspecteduseruser_iduser_typevendor_actionvisibility
The original record of Google Workspace is kept with each event under raw, so nothing the vendor sent is lost.
3. Check the data
The first events arrive within a few minutes. Check what came in:
earliest=-1h index IN (iam, audit) source IN (google_workspace)
| stats count by index, source, sourcetypeThe integration page in LogPulse shows when it last read events and the last error, if any.
Troubleshooting
The connection test names what is wrong. These are the answers you are most likely to see.
| What you see | What to do |
|---|---|
| Paste the JSON key of a service account (type service_account) | Paste the whole JSON key file, from the opening to the closing brace. An OAuth client secret file is not a service account key. |
| Google refused the service account. In the Admin console: Security, API controls, Domain-wide delegation, add its client ID with the scopes admin.reports.audit.readonly and apps.alerts. | Add the client ID of the service account under Domain-wide delegation with exactly those two scopes. |
| [email protected] cannot read the audit reports. Use a super admin. | Fill in the address of a super admin of the domain as the admin to act as. |
| The test passes but no events arrive. | Run the search above over a longer time. No results: check on the integration page that the data source is switched on and when it last read events. Google Workspace may also simply have had nothing new. |
Frequently asked questions
- How do I send Google Workspace logs to LogPulse?
- Add the Google Workspace cloud integration under Configure, Sources, Cloud in LogPulse and fill in Service account key (JSON), Admin to act as. LogPulse reads the Reports API and Alert Center API itself, every five minutes by default; there is nothing to install.
- Which permissions does LogPulse need in Google Workspace?
- A service account with domain-wide delegation for admin.reports.audit.readonly and apps.alerts. A super admin to act as. Read access is enough for collecting logs.
- Which index does Google Workspace data go to?
- The index is the kind of data: iam, audit. The source is the product: google_workspace. Each data source has its own sourcetype, listed on this page.
- Which data models does Google Workspace fill?
- Authentication, Change, Alerts. Detection rules and dashboards written for a data model work on Google Workspace without changes.
- Why is Drive off by default?
- To keep your daily ingest down until you need it: Drive is high volume or of use to fewer teams. Tick the data source in the integration to switch it on.
- Why do Google Workspace sign-ins arrive an hour late?
- Google makes sign-in and admin events available in the Reports API up to an hour after they happen. LogPulse reads an hour behind so that it misses none. Alert Center alerts arrive after about five minutes.