You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
google_workspace: add support for Gmail events (#14399)
This adds support for the Gmail logs as a new data stream to enhance
the overall visibility of data in the Google Workspace integration.
This changes includes updating navigation links in to the relevant dashboards.
Sanitized test case inputs were obtained from a live Google Workspace instance
using the BigQuery API[1]. The schema for Gmail logs can be found in the
documentation[2].
[1] https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs
[2] https://support.google.com/a/answer/12384955
Copy file name to clipboardExpand all lines: packages/google_workspace/_dev/build/docs/README.md
+95Lines changed: 95 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,93 @@ Click the Advanced option of Google Workspace Audit Reports. The default value o
53
53
54
54
> NOTE: The `Delegated Account` value in the configuration, is expected to be the email of the administrator account, and not the email of the ServiceAccount.
55
55
56
+
# Google Workspace Gmail Logs
57
+
58
+
The integration collects and parses Gmail audit logs data available for reporting in Google Workspace. You must first export Google Workspace logs to Google BigQuery. This involves exporting all activity log events and usage reports to Google BigQuery. Only certain Google Workspace editions support this feature. For more details see [About reporting logs and BigQuery](https://support.google.com/a/answer/9079364?hl=en). The integration uses the [BigQuery API](https://cloud.google.com/bigquery/docs/reference/rest) to query logs from BigQuery.
59
+
60
+
## Requirements
61
+
62
+
In order to ingest data from the Google BigQuery API, you must:
63
+
64
+
1. Enable BigQuery API if not already
65
+
66
+
- In the [Google Cloud console](https://console.cloud.google.com), navigate to **APIs & Services > Library**.
67
+
- Search for **BigQuery API** and select it.
68
+
- Click **Enable**.
69
+
70
+
2. Create a service account:
71
+
72
+
- In the [Google Cloud console](https://console.cloud.google.com), navigate to **APIs & Services > Credentials**.
73
+
- Click Create **Credentials > Service account**.
74
+
- In the setup:
75
+
- Enter a name for the service account.
76
+
- Click **Create and Continue**.
77
+
- (Optional) Grant project access.
78
+
- Click **Continue**.
79
+
- (Optional) Grant user access.
80
+
- Click **Done**.
81
+
82
+
3. Generate a JSON Key:
83
+
84
+
- From the **Credentials** page, click on the name of your new service account.
85
+
- Go to the **Keys** tab.
86
+
- Click **Add Key > Create new key**.
87
+
- Choose **JSON** format and click **Create**.
88
+
- Save the downloaded JSON key securely.
89
+
90
+
4. Grant IAM Role to service account:
91
+
92
+
- Go to **IAM & Admin > IAM** in the Cloud Console.
93
+
- Click **Grant access**.
94
+
- Paste the service account email in the **New principals** field.
95
+
- Click **Select a role**, search for and select **BigQuery Job User**.
- Under **New dataset within project**, enter the name of the dataset to use for storing the logs in the project.
120
+
A new dataset will be created with this name in your BigQuery project.
121
+
- (Optional) Check the **Restrict the dataset to a specific geographic location** box > select the location from the menu.
122
+
- Click **Save**.
123
+
- For more details see [Set up a BigQuery Export configuration](https://support.google.com/a/answer/9079365?hl=en).
124
+
125
+
6. Grant Dataset Permissions:
126
+
127
+
- Go to [Google Cloud console](https://console.cloud.google.com) and search for **BigQuery**.
128
+
- Click your Google Cloud project on the left pane.
129
+
- Locate the dataset, click the **three-dot menu > Share > Manage Permissions**.
130
+
- Click **Add principal**.
131
+
- Paste the service account email in **New principals**.
132
+
- Select **BigQuery Data Viewer** as the role.
133
+
- Click **Save**.
134
+
135
+
This integration will make use of the following *oauth2 scope*:
136
+
137
+
-`https://www.googleapis.com/auth/bigquery`
138
+
139
+
Once you have downloaded your service account credentials as a JSON file, you are ready to set up your integration for collecting Gmail logs.
140
+
141
+
> NOTE: For Gmail data stream, the default value of "BigQuery API Host" is `https://bigquery.googleapis.com`. The BigQuery API Host will be used for collecting gmail logs only.
142
+
56
143
# Google Workspace Alert
57
144
58
145
The [Google Workspace](https://developers.google.com/admin-sdk/alertcenter) Integration collects and parses data received from the Google Workspace Alert Center API using HTTP JSON Input.
0 commit comments