This article explains how to configure the Google Drive and Gmail connectors for the SaaS Security API policy for your account and create rules that use this connector in the Data Protection Policy.
The SaaS Security API policy requires a separate license from Cato. Please contact your Cato representative or official reseller for more information.
Note
Note: Please contact SaaSecAPI@catonetworks.com or your official Cato reseller for more information about using the SaaS Security API policy.
Create the connector for the Google tenant for your organization. The connector requires that you configure the Google Cloud and Google Admin consoles to allow and enable the API calls for your Cato account. Then define rules in the Data Protection policy that include the connector and define that files or emails that are scanned and inspected.
This section explains how to create the initial API connector for Google Drive and Gmail, and to connect your organization's Google tenant to your Cato account.
The Google Drive and Gmail connectors let the Cato SaaS API engine scan files (attachments), folders, and emails for the content that you define in the Data Protection policy. Events are generated for content that matches a rule in the policy.
Note
Note: The first time that you create a Google connector, it's necessary to enable Cato to use APIs to connect to your Google account. If you already created a Google connector, and now you creating an additional one, continue with Creating Additional Google Connectors.
This is a high-level overview of the process to create the Cato connector for Google Drive and Gmail:
-
In the Cato Management Application, create a new SaaS Application connector for Google Drive or Gmail.
-
Copy the oAuth scopes for the connector.
-
-
In the Google Cloud console for your company's account:
-
Create a new project for the Cato connector.
-
Enable the required Google APIs and generate the Service account ID.
-
-
In the Google Admin console, define the Domain-wide Delegation for the Cato connector.
-
Paste the oAuth scopes from the connector in the Google Admin console.
-
-
In the Google Cloud console, create the API keys for the Cato connector.
-
In the Cato Management Application, upload the API keys to the SaaS Application connector for Google Drive or Gmail.
In the Cato Management Application, create the Google Drive or Gmail SaaS application for the connector to your Google account.

To create the connector for Google Drive or Gmail:
-
From the navigation pane, select Security > SaaS Security API and select or expand Connectors Settings.
-
Click New. The New Connector window opens.
-
Create a new SaaS Application for Google Drive or Gmail.
-
Enter the Connector Name.
-
Enter the Admin Email for the Google admin account with admin privileges.
-
Click Copy oAuth Scopes.
Save the oAuth Scope data for
-
Continue below with Step 2 - Configuring the Project in Google Cloud Console.
From the console for your Google Cloud Platform, create a new project and enable the Admin SDK API and Cloud Identity for your account. Then create a new Service account, and copy the unique ID (you will need this ID for step 3).
To configure the project in the Google Cloud console:
-
Log in to the Google Cloud console and create a New Project.
-
Enable the Google APIs for the connector:
-
Select the project and from the navigation pane, select API & Services > Library.
-
In the API Library, search for Admin SDK API.
-
Click the Admin SDK API, and in the new window click Enable.
-
Go back to the API Library, and click Google Drive API.
-
In the next window, click Enable.
-
-
Create the Service account for the Cato connector:
-
From the navigation pane, select API & Services > Credentials.
-
From the menu bar, click Create Credentials > Service Account.
-
Enter the Service account name.
-
Click Create and Continue and then click Done.
-
-
In the Service Accounts window, edit the new account.
-
Copy and save the Unique ID for the Service account. You will enter this ID in the Google Admin console (below).
-
Continue below with Step 3 - Defining the Domain-Wide Delegation in Google Admin Console.
Google uses domain-wide delegations to allow apps to access data across the Google Workspace environment. Define a domain-wide delegation with permissions to access the APIs that you enabled in the previous section.
In the Google Admin console, create a new API client and configure it to use the Unique ID for the service account (that you saved from Step 2 - Configuring the Project in Google Cloud Console above).
To define the domain-wide delegation in the Google Admin console:
-
Log in to the Google Admin console for your account.
-
From the navigation pane, select Security > Access and data control > API controls.
-
In the API Controls window, in the Domain wide delegation section at the bottom of the screen, click Manage Domain Wide Delegation.
-
In the API client section, click Add new.
The Add a new client ID pop-up window opens.
-
In Client ID, paste the Unique ID that you copied in the previous section.
-
Paste the OAuth scopes that the connector is allowed to access.
-
See Step 1 - Creating the Google Drive or Gmail SaaS Application above for more information about copying the Oauth scopes in the Cato Management Application.
-
-
Click Authorize.
The domain-wide delegation for the Cato connector is defined to use the Unique ID for the Google APIs.
-
Continue below with Step 4 - Creating the API Keys File in the Google Cloud Console.
After you enable Google's domain-wide delegation for the service account for the Cato connector, use the Google Cloud console to create an API key file for the service account.
To create the API keys file:
-
In the Google Cloud console, from the navigation pane, select IAM & Admin > Service Accounts.
-
Select the service account for the Cato connector, and select Actions > Manage keys.
The Keys tab for the service account opens.
-
Click Add Key > Create New Key.
-
In the pop-up window, and select JSON and click OK.
The browser saves the API key file to the specified folder.
-
Continue below with Step 5 - Uploading the API Key File to the Cato Management Application.
Upload the API key file that you created in the previous section to the Google Drive or Gmail connector in the Cato Management Application. Then the connector is configured and ready to start scanning files and folders for your account.
For the Gmail connector, it's necessary to add a rule to the Third-party email archiving setting in the Google Admin console.
Note
Note: The API key file contains sensitive data, we recommend that you delete the file after uploading it to the Cato Management Application.
To upload the API key file to the Cato Management Application:
-
Open the browser tab for the Cato Management Application where you started configuring the Google Drive or Gmail connector (above Step 1 - Creating the Google Drive or Gmail SaaS Application).
-
In the Upload Key File section, upload the API key file that you created (above Step 4 - Creating the API Keys File in the Google Cloud Console).
-
Click Save.
-
The Google Drive or Gmail SaaS application is added to the Connectors Settings screen.
-
For the Gmail application, perform these additional steps:
-
In the completion screen, copy the email address.
-
Open the Google Admin console.
-
Go to Apps > Google Workspace > Gmail > Routing > Third-party email archiving.
-
Click Add Another Rule.
-
In the Add setting pop-up window, paste the email address from step a (above).
-
Click Save.
-
The Status column on the Connectors Settings screen shows the status of the connection between the Google Drive connector and your Cato account. These are the explanations of the statuses:
-
Connected - Your account is connected to the app and working correctly
-
Connection error - Connectivity or permissions issue with the Google Drive connector. Please open a ticket with Support.
When you are creating an additional Google connector for your account, then your Google account is already configured to use APIs connect to your Cato account. The connectors use the same oAuth scope.
Enable the Google API for the new Google Drive or Gmail API. Then create and download the key file from your Google account and upload it to the connector.
To create an additional Google connector:
-
Log in to the Google Admin console for your account.
-
Enable the Google APIs for the connector:
-
Select the project and from the navigation pane, select API & Services > Library.
-
In the API Library, and search for the new Google Drive API or Gmail API.
-
In the next window, click Enable.
-
-
Create and download the key file for your Google account:
-
In the Google Cloud console, from the navigation pane, select IAM & Admin > Service Accounts.
-
Select the service account for the Cato connector, and select Actions > Manage keys.
-
Click Add Key > Create New Key.
-
In the pop-up window, and select JSON and click OK.
The browser saves the API key file to the specified folder.
-
-
Create the new Google connector:
-
In Security > SaaS Security API, select the Connector Settings tab, and click New.
-
Define the settings for the Google Drive or Gmail connector and enter the Google Admin Email.
-
In the Upload Key File section, upload the API key file that you created above.
-
Click Save.
-
-
For the Gmail application, perform these additional steps:
-
In the completion screen, copy the email address.
-
Open the Google Admin console.
-
Go to Apps > Google Workspace > Gmail > Routing > Third-party email archiving.
-
Click Add Another Rule.
-
In the Add setting pop-up window, paste the email address from step a (above).
-
Click Save.
-
This section explains how to use the Data Protection policy to monitor and manage the files, folders, and emails that are stored in your Google account.
Use the Data Protection screen to add the SaaS application rules in your Data Protection policy.
Create a Data Protection rule to define the traffic that is scanned by SaaS Security API. Create separate rules for each SaaS app, and then define the criteria which determines which traffic is scanned.
For more information about the Google Drive and Gmail rule settings, see below Understanding the Google Connector Rules.
To create a new Data Protection rule for the Google Drive or Gmail app:
-
From the navigation pane, select Security > SaaS Security API and select or expand Data Protection.
-
Click New. The New Rule panel opens.
-
In Application Connector, select the Google Drive or Gmail app.
-
Enter the General settings for the rule.
-
In Owner (for Google Drive) or Sender (for Gmail), select one or more Google users that you are monitoring (default value is Any).
When you select multiple users, there is an OR relationship between them.
-
(For Gmail) In Recipients, define the Google users who are receiving the mail (the default setting is Any).
-
In Sharing Options, select permission level for files and folders that are scanned (default value is Any).
When you select multiple options, there is an OR relationship between them.
-
In File Attributes (for Google Drive) or Attachments (for Gmail), define the criteria to specify the files which are scanned (the default setting is to scan all files).
-
In Content Profile, select the DLP Content Profile for this rule.
-
In Actions, select the Monitor option.
-
(Optional) Define the tracking options for the rules to generate email notifications.
For more information about events and email notifications, see Working with Email Notifications for the Account.
-
Click Apply. The rule is added to the Data Protection policy.
This section explains how to define the settings for the Data Protection rules to scan the correct Google Drive or Gmail traffic. Each rule can be defined according to the following criteria:
-
Owner or Sender - Google users in your workspace (default value is Any)
-
Internal - Owner is any user in your company
-
Google User - Owner is a specific user
-
-
Recipients (for Gmail) - Users that receive the email
-
Internal - Owner is any user in your company
-
External - Defined in your Google account as outside of your company
-
Google User - Owner is a specific user
-
Domain - Enter the domain for the email recipients
-
-
Sharing Options - Select the types of file and folder sharing permissions that match this rule (default value is Any)
-
File Attributes or Attachments - Criteria for attachments that are scanned (default value is all attachments)
-
File Type
-
File Name
-
File Size (maximum file size is 100 MB)
-
-
Content Profile - DLP Content Profile that defines the DLP content inspection
You can create or edit Content Profiles in Security > DLP Configuration > Content Profile
-
Actions - Select if you want to generate an event or email notification when the rule is matched
You can define specific files (or attachments) for a rule and limit the SaaS API engine to only scan the specified files to see if they match the DLP Content Profile.
When you add multiple files to a rule, select the relationship between them:
-
Satisfy any (OR) - Match only one of the File Types in the rule
-
Satisfy all (AND) - Match all the File Types in the rule (otherwise, the rule is ignored)
You can use the File Name setting in a rule to define the exact file name or use wildcards to define keywords. For example, you can define the File Name as internal to match all file names that contain the word internal.
The SaaS Security API engine inspects the data sequentially, and checks to see if it matches a rule. If the data does not match a rule, that it is not inspected. Rules that are at the top of the rulebase have a higher priority and they are applied before the rules lower down in the rulebase. Each type of application or connector is only applied to the data once.
Best Practice - To maximize the efficiency of your rulebase, we recommend that for each connector type, rules for specific users have a higher priority than rules with that apply to Any users.
For example, if the data matches a connector in rule #2, the data is inspected by the SaaS Security API engine. The engine does not continue to apply rules #3 and below for the same connector. However, the data could match a lower priority rule with a different connector.
You can create Threat Protection rules for the connector to scan files and attachment for malware and viruses using the Anti-Malware and Next Gen Anti-Malware engines that are enabled for your account. The SaaS Security API engine scans the connector traffic and applies the action and tracking options that you configure for the rule:
-
Monitor the traffic (block will be supported soon)
-
Generate events
-
Send email notifications
When you create a SaaS Security API Threat Protection rule, the Anti-Malware engines that are enabled for your account (Security > Anti-Malware) preform malware scans on the files that are sent for that connector application.
The following screenshot shows a Threat Protection rule for the OneDrive connector that scans files sent by Internal users or Guests:

The Monitoring > Events screen shows all the SaaS Security API events for your account. The powerful search tools let you drill-down and identify the few events that contain the relevant data that you need.
SaaS Security API events can be identified by the following fields:
-
Event Type - Security
-
Sub-Type - SaaS Security API Data Protection and SaaS Security API Anti Malware
You can learn more about using the Events screen here. You can use the SaaS Security API Data Protection preset to filter the events.
Field Name |
Description |
---|---|
Connector Name |
Name for the connector that is defined for the rule |
Connector Type |
SaaS app that is defined for this connector |
DLP Profile |
DLP Content Profile that generated this event |
File Name |
Name of the attached file |
Matched Data Types |
Data Types in the Content Profile that matched the rule |
Collaborators |
Email addresses of the users that received the file |
Rule |
Name of the rule in the Data Protection policy |
Owner |
File owner |
Severity |
Severity defined for the rule |
Sharing Scope |
Sharing Options for the Google Drive attachment |
Comments
0 comments
Please sign in to leave a comment.