- 27 Dec 2024
- 3 Minutes to read
- Print
- DarkLight
Google Workspace Integration
- Updated on 27 Dec 2024
- 3 Minutes to read
- Print
- DarkLight
The Security Manager Google Cloud Platform integration monitors Google Workspace logs to provide the Google Workspace Alerts
Prerequisites
An account with Google Super Administrator Access
A Google Cloud Console Organization for your Domain
Owner permissions for Google Cloud Console Organization
A Google Cloud Console Billing Account
Integration Setup
Create a Pub/Sub Subscription
In Google Cloud Console, in the project selector drop-down, select or create a Google Cloud project.
Activate Cloud Shell, which provides an interactive command-line interface with the Cloud SDK installed.
Set Project ID environment variable
export PROJECT_ID=[YOUR_PROJECT_ID]
Set Organization ID environment variable
export ORG_ID=[YOUR_ORGANIZATION_ID]
5. Set the project for your active session:
gcloud config set project $PROJECT_ID
6. Enable the Pub/Sub API:
gcloud services enable pubsub.googleapis.com
7. Enable the Dataflow API
gcloud services enable dataflow.googleapis.com
8. Enable the Cloud Security Command Center API
gcloud services enable securitycenter.googleapis.com
9. Enable the Cloud Asset Inventory API
gcloud services enable cloudasset.googleapis.com
10. Create a Pub/Sub topic to which the data will be sent:
gcloud pubsub topics create export-topic
11. Create a Pub/Sub subscription where the data will be aggregated:
gcloud pubsub subscriptions create export-subscription \
--topic=export-topic \
--expiration-period="never"
12. Create an organization log sink to capture Cloud audit logs from all Google Cloud projects in your organization:
gcloud logging sinks create org-audit-logs-all \
pubsub.googleapis.com/projects/$PROJECT_ID/topics/export-topic \
--organization=$ORG_ID \
--include-children \
--log-filter="logName:logs/cloudaudit.googleapis.com"
Log Sink Creation
The log-filter option specifies that Cloud audit logs are routed to the Pub/Sub topic export-topic
. You want to edit the log filter or create additional log sinks to export more logs such as VPC flow logs, load balancing request logs, or virtual machine logs such as application logs and system logs, depending on your retention compliance requirements.
This command returns the service account of the log sink writer, usually in the form o#####-####@gcp-sa-logging.iam.gserviceaccount.com
Set an environment variable to the service account of the log sink:
export LOG_SINK_SA=[YOUR_SERVICE_ACCOUNT]@gcp-sa-logging.iam.gserviceaccount.com
Give permissions to the log sink service account to publish to the Pub/Sub topic:
gcloud pubsub topics add-iam-policy-binding export-topic \
--member=serviceAccount:$LOG_SINK_SA \
--role=roles/pubsub.publisher
Setting up Service Account Access Key
Create a service account in the project
Generate a JSON format access key
Create Service Account Environment variable
export SUBSCRIBER_SA=[YOUR_SERVICE_ACCOUNT_EMAIL]
Give permissions to the subscriber service account to subscribe to the Pub/Sub subscription
gcloud pubsub subscriptions add-iam-policy-binding export-subscription \
--member=serviceAccount:$SUBSCRIBER_SA \
--role=roles/pubsub.subscriber
Give permissions to the subscriber service account to view details of the Pub/Sub subscription
gcloud pubsub subscriptions add-iam-policy-binding export-subscription \
--member=serviceAccount:$SUBSCRIBER_SA \
--role=roles/pubsub.viewer
User Authentication Events
To ingest user authentication events, you must share data from your Google Workspace, Cloud Identity, or Essentials account with services in your organization's Google Cloud account.
In the Google Admin Console, go to Menu → Account → Account settings → Legal and compliance.
Click Sharing options
Click Enabled
Click Save
Google DLP Alerts
Go to the Google Cloud Console, and select the Google Cloud Project you created in the steps above
Search for APIs & Services in the search box and click API and services
Select ENABLE APIS AND SERVICES
Search for Alert Center API
Select Google Workspace Alert Center API, and click Enable
Go to the Google Admin Console → Security → Access and data control → API Controls → Manage domain wide delegation
Add New API Client:
Client ID: The client id from the downloaded JSON format access key in the Setting Up Service Account Access Keys steps
OAuth scopes:
https://www.googleapis.com/auth/apps.alerts
Click Authorize
Go to RapidIdentity and select Connect from the module dropdown
Select the Connect Project dropdown and select the
sec_mgr
projectSelect OAuth2 Credentials and click ADD OAUTH2 CREDENTIAL
Enter a name, select GOOGLE_EXTENDED as the provider, and paste in the JSON Format access key you downloaded previously
In the
sec_mgr
project select FilesIn the root directory select Globals.properties and click edit
Under the Google section make the following edits and click save
googleDomain: The Google domain to pull Alert Center alerts
googleOAuthCredential: The name of the Google OAuth2 credential created in step 12
googleServiceAccount: An email address of a user with Alert Center Access in the Google Admin Console (preferably a service account)
In the
sec_mgr
project select JobsSelect the checkbox for GoogleAlertCenterIntegration and click Enable
The Google DLP Integration has now been setup and you will start seeing the alerts generated from Google DLP in the Security Manager Console