To run this collector, there are some configurations detailed below that you need to take into account.
Configuration
Details
GCP console
You have the right credentials to access the GCP console.
Permissions
You have to be the owner of the account or have administrator’s permissions in the GCP console.
Delegated email
You need to have a delegated email with the right permissions. Refer to Google documentation to know how to do it.
More information
Refer to the Vendor setup section to know more about these configurations.
Overview
Workspace is Google’s suite of products that includes email, calendar, driver, meet, and other collaboration solutions. This collector provides the possibility to integrate Google Workspace with the Devo Platform making it easy to query and analyze the relevant data from Workspace, view it in the pre-configured Activeboards, or customize them to enable Enterprise IT and Cybersecurity teams to make impactful data-driven decisions.
This collector will retrieve alerts on potential issues within your domain. Apps you develop can use Google’s Alert Center API to retrieve alerts in order to respond to them. Apps can also use the API to create and retrieve alert feedback. For example, a monitoring app could retrieve new alerts, prioritize them, and then notify members of your organization when action is needed. The collector processes the API responses and sends them to the Devo platform which then categorizes all data received on tables along rows and columns in your Devo domain.
In the search bar, search Workspace Alert Center API.
Click on Google Workspace Alert Center API.
Click on Enable to activate the API.
3. Create credentials
In the search bar, search Credentials.
Click on Credentials (APIs & Services).
In the Service Accounts section, click on Manage service accounts.
Click on the + Create service account button.
Enter a Service account name and click Done.
Click on the Email field of the created service account to access its details.
Copy and save the Unique ID of the created service account.
Click on the Keys tab.
Click on Add key button.
Click on Create new key. A pop-up window will open to select the details of the key.
In key type select JSON.
Click on the Create button.
The file with the credentials will be downloaded automatically.
Rename the file credentials.json.
Save the file in <any_directory>/devo-collectors/gsuite-google-workspace-alerts/credentials/
Convert the content of the credentials.json to base64. Recommended method using Python version higher or equal 3.6
Copy the Python script below:
import base64
def main():
with open('credentials.json', 'r') as credentials:
creds_as_bytes = credentials.read().encode('utf-8')
base64creds = base64.b64encode(creds_as_bytes).decode("utf-8")
print(f'Base64 encoded credentials.json: {base64creds}')
if __name__ == '__main__':
main()
Save the script to <any_directory>/devo-collectors/gsuite-google-workspace-alerts/credentials/.
Rename it to b64encoder.py.
Run the command below in the <any_directory>/devo-collectors/gsuite-google-workspace-alerts/credentials/ directory.
$ python b64encoder.py
The script will output a line starting with Base64 encoded credentials.json: Copy the base64 value as this will be required for the collector configuration.
Copy the content of the json file. You can use any free software to convert the content of the json file to base64.
Paste it into a base64 encoder and copy the result.
Save base64 value
It is important to save the base64 value to later run the collector on-premise and in the collector server.
Unique ID
The Unique ID (step 7) will be used later in the domain delegation.
Don’t use base64 encoders
Online base64 encoders are not recommended for security reasons.
4. Authorize the service account through Domain Wide Delegation.
Once the service account is created and with credentials, it is necessary to authorize it through Domain Wide Delegation.
In the left menu select Security → Access and data control → API controls.
Click Manage domain wide delegation in the Domain wide delegation section.
Click on Add new. A pop-up window will open to enter the details.
In Client ID field enter the previously copied Service Account Unique ID.
In OAuth scopes field add the following: https://www.googleapis.com/auth/apps.alerts.
Finally click on Authorize.
Delegated email
You can copy the email used to login to https://accounts.google.com/ to later use it as delegated_email in the collector configuration.
Delegated email
delegated_email field should contain the email of a real user (you cannot use a service account here) with enough access to display the alerts in the Google WorkSpace Admin Console → Alert Center (https://admin.google.com/ac/ac).
5. Delegate and collaborate on email
You will need to provide a valid email address belonging to a user account. The user account must have appropriate permissions, such as alert viewing. Refer to Google documentation to know how to do it.
Minimum configuration required for basic pulling
Although this collector supports advanced configuration, the fields required to retrieve data with basic configuration are defined below.
This minimum configuration refers exclusively to those specific parameters of this integration. There are more required parameters related to the generic behavior of the collector.
Setting
Details
filename_value
This parameter is the name that you want to give to the token generated by the Collector. For example: token.pickle
content_base64
This parameter is the credentials in base64 format. To know how to obtain this value review the sectionVendor setup.
delegated_email
This parameter is the email of the user whose domain is delegated to authorize the service account to access the alerts. To know how to obtain this value review the section Vendor setup.
Use a real email
delegated_email field should contain the email of a real user (you cannot use a service account here) with enough access to display the alerts in the Google WorkSpace Admin Console → Alert Center (https://admin.google.com/ac/ac).
source_id_value
This parameter will be used when {source_id} placeholder is present when using custom tags. Please use "abc" value when not used.
See the Accepted authentication methodssection to verify what settings are required based on the desired authentication method.
Accepted authentication methods
Depending on how did you obtain your credentials, you will have to either fill or delete the following properties on the JSON credentials configuration block.
Authentication Method
Filename
Base64 credentials
Delegated email
Service Account with Base64
REQUIRED
REQUIRED
REQUIRED
Run the collector
Once the data source is configured, you can either send us the required information if you want us to host and manage the collector for you (Cloud collector), or deploy and host the collector in your own machine using a Docker image (On-premise collector).
Collector services detail
This section is intended to explain how to proceed with specific actions for services.
Devo categorization and destination
The alerts are ingested in the Devo tables with the format cloud.gsuite.alerts.<alert_type> when alert_type is the alert type of the Alert Center. The alert types are listed below:
Once the collector has been launched, it is important to check if the ingestion is performed in a proper way. To do so, go to the collector’s logs console.
This service has the following components:
Component
Description
Setup
The setup module is in charge of authenticating the service and managing the token expiration when needed.
Puller
The setup module is in charge of pulling the data in a organized way and delivering the events via SDK.
Setup output
A successful run has the following output messages for the setup module:
INFO InputProcess::GSuiteAlertsPullerSetup(gsuite_collector,gsuite_alerts#1234,activity_rule#predefined) -> Path for credentials file has been transformed to absolute: "token.pickle" -> "/../devo-collector-gsuite-google-workspace-alerts/credentials/token.pickle"
INFO InputProcess::GSuiteAlertsPullerSetup(gsuite_collector,gsuite_alerts#1234,activity_rule#predefined) -> File "/../devo-collector-gsuite-google-workspace-alerts/credentials/token.pickle" has been created from base64 content
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> PrePull method started
Puller output
A successful initial run has the following output messages for the puller module:
Note that the PrePull action is executed only one time before the first run of the Pull action.
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> PrePull method started
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Retrieving persisted data
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> No persisted data found. The content will be initialized.
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> The <initial_start_time> did not change, so the persistence will not be reset
WARNING InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> The persistence changed and it will be updated. Current -> None | New -> {'initial_start_time': '2022-05-26T00:00:00.000Z', 'last_alert_timestamp': '2022-05-26T00:00:00.000Z', 'last_alert_ids': []}
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> PrePull method completed
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Starting data collection every 60 seconds
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Unpacking messages to start the delivery
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Made 1 request(s), received 24 message(s), filtered 0 message(s), delivered 24 message(s), tag used: "cloud.gsuite.alerts.activity_rule.1.unknown". avg_time_per_source_message: 61.463 ms
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Data collection completed. Elapsed time: 1.480 seconds. Waiting for 58.520 second(s) until the next one
After a successful collector’s execution (that is, no error logs found), you will see the following log message:
INFO InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Made 1 request(s), received 24 message(s), filtered 0 message(s), delivered 24 message(s), tag used: "cloud.gsuite.alerts.activity_rule.1.unknown". avg_time_per_source_message: 61.463 ms
Restart the persistence
This collector uses persistent storage to download events in an orderly fashion and avoid duplicates. In case you want to re-ingest historical data or recreate the persistence, you can restart the persistence of this collector by following these steps:
Edit the configuration file.
Change the value of the start_time parameter to a different one.
Save the changes.
Restart the collector.
The collector will detect this change and will restart the persistence using the parameters of the configuration file or the default configuration in case it has not been provided.
Note that this action clears the persistence and cannot be recovered in any way. Resetting persistence could result in duplicate or lost events.
Troubleshooting
This collector has different security layers that detect both an invalid configuration and abnormal operation. This table will help you detect and resolve the most common errors.
This error is raised when token.pickle does not exist.
Regenerate the token.json and save it in the file devo-collector-gsuite-google-workspace-alerts/credentials/. To know how the token is regenerated, consult the section Vendor setup.
SetupError
101
Error
This error is raised when unknown error occurs while loading token.pickle
Check that the token.pickle is in the correct format and if not, regenerate it again.
SetupError
102
HTTP error: <error_message>
This error is raised when an HTTP error appears during setup.
The solution depends on the type of error. Contact with Devo Support team.
SetupError
103
Unable to refresh token or client Auth was deleted. Detail: <error_message>
This error is raised when the token cannot be refreshed. The reason may be that it has been deleted.
Regenerate the token.json and save it in the file devo-collector-gsuite-google-workspace-alerts/credentials/. To know how the token is regenerated, consult the section Vendor setup.
SetupError
104
Operation timed out: <error_message>
This error is raised when the maximum time to wait for the connection has been exceeded.
Check that the connection is working properly.
SetupError
105
HTTP/1.1 503 Service Unavailable at moment - Retrying reconnection: <error_message>
This error is raised when the service is not available.
This is an internal issue. Contact the support team.
SetupError
106
DefaultCredentials: <error_message>
This error is raised when credentials cannot be automatically determined.
This is an internal issue. Contact the support team.
InitVariablesError
1
start_time is not set as per the datetime_format
Start time in config is not as per right format
Put start time in the correct format.
InitVariablesError
2
Date {initial_start_time_str} is in the future
Start time in config is in future
Put start time less than the current UTC time.
PullError
300
Operation timed out: <error_message>
This error is raised when the maximum time to wait for the connection has been exceeded.
Check that the connection is working properly.
PullError
301
Could not automatically determine credentials.
This error is raised when credentials are not loaded successfully.
This is an internal issue. Contact the support team.
PullError
302
The <next_timestamp> value cannot be calculated, please check the related error logs.
This error is raised when timestamp is invalid.
This is an internal issue. Contact the support team.
PullError
303
HTTP/1.1 503 Service Unavailable at moment - Retrying reconnection: <error_message>
This error is raised when the service is not available.
This is an internal issue. Contact the support team.
PullError
304
DefaultCredentialsError
DefaultCredentialsError
This is an internal issue. Contact the support team.
PullError
305
Error detected -> {e.class}: {e.str()}
Some error occurred during the pull cycle.
This is an internal issue. Contact the support team.
Collector operations
This section is intended to explain how to proceed with specific operations of this collector.
Verify collector operations
Initialization
The initialization module is in charge of setup and running the input (pulling logic) and output (delivering logic) services and validating the given configuration.
A successful run has the following output messages for the initializer module:
INFO MainProcess::MainThread -> [OUTPUT] OutputMultiprocessingController::__init__ Configuration -> {'devo_1': {'type': 'devo_platform', 'config': {'address': ..
INFO MainProcess::MainThread -> OutputProcess - Starting thread (executing_period=300s)
INFO MainProcess::MainThread -> InputProcess - Starting thread (executing_period=300s)
INFO OutputProcess::MainThread -> Process started
INFO InputProcess::MainThread -> Process Started
INFO OutputProcess::MainThread -> [INTERNAL LOGIC] DevoSender::_validate_kwargs_for_method__init__ -> The <address> does not appear to be an IP address and cannot be verified: collector-eu.devo.io
INFO OutputProcess::MainThread -> [INTERNAL LOGIC] DevoSender::_validate_kwargs_for_method__init__ -> The <address> does not appear to be an IP address and cannot be verified: collector-eu.devo.io
INFO InputProcess::MainThread -> InputThread(gsuite_alerts,1234) - Starting thread (execution_period=600s)
INFO InputProcess::MainThread -> ServiceThread(gsuite_alerts,1234,activity_rule,predefined) - Starting thread (execution_period=600s)
INFO InputProcess::MainThread -> GSuiteAlertsPullerSetup(gsuite_collector,gsuite_alerts#1234,activity_rule#predefined) -> Starting thread
INFO InputProcess::MainThread -> GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) - Starting thread
INFO InputProcess::GSuiteAlertsPullerSetup(gsuite_collector,gsuite_alerts#1234,activity_rule#predefined) -> Path for credentials file has been transformed to absolute: "token.pickle" -> "/../devo-collector-gsuite-google-workspace-alerts/credentials/token.pickle"
WARNING InputProcess::GSuiteAlertsPuller(gsuite_alerts,1234,activity_rule,predefined) -> Waiting until setup will be executed
INFO OutputProcess::MainThread -> [INTERNAL LOGIC] DevoSender::_validate_kwargs_for_method__init__ -> The <address> does not appear to be an IP address and cannot be verified: collector-eu.devo.io
INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(standard_senders,devo_1) -> Starting thread (every 300 seconds)
INFO OutputProcess::MainThread -> DevoSenderManager(standard_senders,manager,devo_1) -> Starting thread
INFO OutputProcess::MainThread -> DevoSender(lookup_senders,devo_sender_0) -> Starting thread
INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(lookup_senders,devo_1) -> Starting thread (every 300 seconds)
INFO OutputProcess::MainThread -> DevoSenderManager(lookup_senders,manager,devo_1) -> Starting thread
INFO OutputProcess::MainThread -> DevoSender(internal_senders,devo_sender_0) -> Starting thread
INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(internal_senders,devo_1) -> Starting thread (every 300 seconds)
INFO OutputProcess::MainThread -> DevoSenderManager(internal_senders,manager,devo_1) -> Starting thread
INFO InputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(42.63MiB -> 42.69MiB), VMS(439.63MiB -> 503.63MiB)
INFO InputProcess::GSuiteAlertsPullerSetup(gsuite_collector,gsuite_alerts#1234,activity_rule#predefined) -> File "/../devo-collector-gsuite-google-workspace-alerts/credentials/token.pickle" has been created from base64 content
INFO OutputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(42.19MiB -> 44.24MiB), VMS(935.90MiB -> 935.90MiB)
INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> Created a sender: {..
INFO OutputProcess::DevoSender(standard_senders,devo_sender_0) -> Created a sender: {..
Events delivery and Devo ingestion
The event delivery module is in charge of receiving the events from the internal queues where all events are injected by the pullers and delivering them using the selected compatible delivery method.
A successful run has the following output messages for the initializer module:
INFO OutputProcess::SyslogSenderManagerMonitor(standard_senders,sidecar_0) -> Number of available senders: 1, sender manager internal queue size: 0
INFO OutputProcess::SyslogSenderManagerMonitor(standard_senders,sidecar_0) -> enqueued_elapsed_times_in_seconds_stats: {}
INFO OutputProcess::SyslogSenderManagerMonitor(standard_senders,sidecar_0) -> Sender: SyslogSender(standard_senders,syslog_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
INFO OutputProcess::SyslogSenderManagerMonitor(standard_senders,sidecar_0) -> Standard - Total number of messages sent: 44, messages sent since "2022-06-28 10:39:22.511671+00:00": 44 (elapsed 0.007 seconds)
INFO OutputProcess::SyslogSenderManagerMonitor(internal_senders,sidecar_0) -> Number of available senders: 1, sender manager internal queue size: 0
INFO OutputProcess::SyslogSenderManagerMonitor(internal_senders,sidecar_0) -> enqueued_elapsed_times_in_seconds_stats: {}
INFO OutputProcess::SyslogSenderManagerMonitor(internal_senders,sidecar_0) -> Sender: SyslogSender(internal_senders,syslog_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
INFO OutputProcess::SyslogSenderManagerMonitor(internal_senders,sidecar_0) -> Internal - Total number of messages sent: 1, messages sent since "2022-06-28 10:39:22.516313+00:00": 1 (elapsed 0.019 seconds)
By default, these information traces will be displayed every 10 minutes.
Sender services
The Integrations Factory Collector SDK has 3 different senders services depending on the event type to delivery (internal, standard, and lookup). This collector uses the following Sender Services:
Sender services
Description
internal_senders
In charge of delivering internal metrics to Devo such as logging traces or metrics.
standard_senders
In charge of delivering pulled events to Devo.
Sender statistics
Each service displays its own performance statistics that allow checking how many events have been delivered to Devo by type:
Logging trace
Description
Number of available senders: 1
Displays the number of concurrent senders available for the given Sender Service.
sender manager internal queue size: 0
Displays the items available in the internal sender queue.
This value helps detect bottlenecks and needs to increase the performance of data delivery to Devo. This last can be made by increasing the concurrent senders.
Total number of messages sent: 44, messages sent since "2022-06-28 10:39:22.511671+00:00": 21 (elapsed 0.007 seconds)
Displayes the number of events from the last time and following the given example, the following conclusions can be obtained:
44 events were sent to Devo since the collector started.
The last checkpoint timestamp was 2022-06-28 10:39:22.511671+00:00.
21 events where sent to Devo between the last UTC checkpoint and now.
Those 21 events required 0.007 seconds to be delivered.
By default these traces will be shown every 10 minutes.
Check memory usage
To check the memory usage of this collector, look for the following log records in the collector which are displayed every 5 minutes by default, always after running the memory-free process.
The used memory is displayed by running processes and the sum of both values will give the total used memory for the collector.
The global pressure of the available memory is displayed in the global value.
All metrics (Global, RSS, VMS) include the value before freeing and after previous -> after freeing memory
RSS is the Resident Set Size, which is the actual physical memory the process is using
VMS is the Virtual Memory Size which is the virtual memory that process is using
Enable/disable the logging debug mode
Sometimes it is necessary to activate the debug mode of the collector's logging. This debug mode increases the verbosity of the log and allows you to print execution traces that are very helpful in resolving incidents or detecting bottlenecks in heavy download processes.
To enable this option you just need to edit the configuration file and change the debug_status parameter from false to true and restart the collector.
To disable this option, you just need to update the configuration file and change the debug_status parameter from true to false and restart the collector.
For more information, visit the configuration and parameterization section corresponding to the chosen deployment mode.
Change log
Release
Released on
Release type
Details
Recommendations
v1.9.0
IMPROVEMENT
BUG FIX
Improvements
Updated DCSDK from 1.12.4 to 1.13.1
Upgraded Base Docker Image to 1.3.1
Bug Fix
Fixed ingestion stoppage issue
Recommended version
v1.8.0
IMPROVEMENT
Improvements
Updated DCSDK from 1.10.2 to 1.12.4
Upgraded Base Docker Image to 1.3.0
Recommended version
v1.7.0
IMPROVEMENTNEW FEATURE
Improvements
Updated DCSDK from 1.8.0 to 1.10.2
New features:
Added new alert types:
Access Approvals request
APNS certificate is expiring soon
APNS certificate has expired
MSA Billing
MSA Legal
MSA Product
MSA Security
Customer abuse detected
Drive settings changed
Email settings changed
Mobile settings changed
New user Added
Suspended user made active
User deleted
User granted Admin privilege
Users Admin privilege revoked
Users password changed
Reporting Rule
Account suspension warning
Chrome devices auto-update expiration warning
Update
v1.6.0
IMPROVEMENT
Improvements:
Updated DCSDK from 1.4.1 to 1.8.0.
Update
v1.5.0
IMPROVEMENT
Improvements:
The Google Workspace Collector has been divided into two: Google Workspace Alerts and Google Workspace Reports to improve the user experience.
Added base64 validation: Validates whether the credentials token is in the correct base64 format.
Update
v1.4.2
BUG FIX
Bugs fixes:
Fixed a bug that prevented Syslog output from being enabled.
Update
v1.4.1
IMPROVEMENT
Improvements:
Upgraded underlay Devo Collector SDK from v1.1.4 to v1.4.1.
The resilience has been improved with a new feature that restart the collector when the Devo connections is lost and it cannot be recovered.
When an exception is raised by the Collector Setup, the collector retries after 5 seconds. For consecutive exceptions, the waiting time is multiplied by 5 until hits 1800 seconds, which is the maximum waiting time allowed. No maximum retries are applied.
When an exception is raised by the Collector Pull method, the collector retries after 5 seconds. For consecutive exceptions, the waiting time is multiplied by 5 until hits 1800 seconds, which is the maximum waiting time allowed. No maximum retries are applied.
When an exception is raised by the Collector pre-pull method, the collector retries after 30 seconds. No maximum retries are applied.
Updated the underlying DevoSDK package to v3.6.4 and dependencies, this upgrade increases the resilience of the collector when the connection with Devo or the Syslog server is lost. The collector is able to reconnect in some scenarios without running the self-kill feature.
Support for stopping the collector when a GRACEFULL_SHUTDOWN system signal is received.
Re-enabled the logging to devo.collector.out for Input threads.
Improved self-kill functionality behavior.
Added more details in log traces.
Added log traces for knowing system memory usage.
Update
v1.3.0
NEW FEATURE
New features:
Added new alert types:
Data Loss Prevention
Apps outage
Primary admin changed
SSO profile added
SSO profile updated
SSO profile deleted
Super admin password reset
Update
v1.2.0
NEW FEATURE IMPROVEMENT
New features:
We added to the Alerts puller the feature to restart the persistence when the config start_time is updated at service level.
Improvements:
The performance has been improved after switching the internal delivery method. The events are delivered in batches instead of one by one.