Install Guide
Overview
google-workspace-gmail-logs query command are available in 1.10.2611.0 or later.
The Google Workspace app collects Google Workspace audit logs (admin activity, login, Drive, Gmail, Meet, Chat, OAuth token) and Alert Center alerts, and provides query commands to look up domains, users, groups, and Drive connected apps, and to read and write Google Sheets.
Setup Flow
First, decide which loggers and query commands you will use in 1. Required Permissions, and prepare only the permissions they need. Choose an authentication method in 3. Choosing an Authentication Method.
The steps depend on the authentication method. In the table below, follow in order only the steps marked Required for the method you chose. Click a task name to go to its setup page.
| Task | Where | Service account | User account OAuth |
|---|---|---|---|
| 2. Prepare a dedicated integration account and admin role | Admin console | Required | Required (not needed if you use only the Drive apps and spreadsheet commands) |
| 2. Create a project and enable APIs | Google Cloud console | Required | Required |
| 3-1. Create a service account and key | Google Cloud console | Required | - |
| 3-1. Register domain-wide delegation | Admin console | Required | - |
| 3-2. Configure the OAuth consent screen and client | Google Cloud console | - | Required |
| 3-2. Issue a refresh token | OAuth 2.0 Playground | - | Required |
| 4. Install the app, add a connect profile and loggers | Logpresso Sonar | Required | Required |
Gmail Log Limitations
Gmail logs have the following limitations due to what Google provides.
- Gmail logs may not be available depending on your Google Workspace edition.
- Google keeps Gmail logs for 180 days, so the logger's Scan Days is up to 180 days.
- The
google-workspace-gmail-logsquery command requires thefromordurationoption, and queries up to 30 days at a time within the last 180 days. - The sender address, attachment names and URLs of clicked links are not provided.
- Recipients do not distinguish To, Cc and Bcc.
- Bounces are recorded with mail event type
UNKNOWNand action typeBOUNCED, and forwarding asFIRST_REPLIEDon the original mail. - Marking as read, downloading a mail, and blocking the sender when reporting spam are not recorded.
- Delivery stage events (
UNKNOWN) make up about half of all events.
Network Requirements
Sonar must be allowed outbound HTTPS (443) access to the addresses for the features you use.
| Address | Used by |
|---|---|
oauth2.googleapis.com | All features (token issuance) |
admin.googleapis.com | Admin Activity, Login, Drive, Gmail, Meet, and Chat loggers, *-logs query commands, google-workspace-domains, users, groups |
alertcenter.googleapis.com | Alert Center logger, google-workspace-alerts |
www.googleapis.com | Drive Activity logger, google-workspace-drive-logs, drive-apps, drive-app |
sheets.googleapis.com | google-workspace-sheets-values, sheets-write-values |