docs/ref/modules/integrations/gcp.md
The Wazuh GCP (Google Cloud Platform) module retrieves logs from Google Cloud services and forwards them to the Wazuh analysis engine. The module supports two collection methods:
The GCP module runs as a Wazuh wodle on the Wazuh agent. It invokes the wodles/gcloud/gcloud Python script to connect to Google Cloud services using a service account credentials file.
The GCP module is configured inside the <ossec_config> block of the Wazuh agent configuration file (ossec.conf).
<wodle name="gcp-pubsub">
<enabled>yes</enabled>
<project_id>my-gcp-project</project_id>
<subscription_name>wazuh-subscription</subscription_name>
<credentials_file>/var/ossec/etc/credentials.json</credentials_file>
<max_messages>100</max_messages>
<num_threads>1</num_threads>
<pull_on_start>yes</pull_on_start>
<interval>1h</interval>
</wodle>
| Option | Required | Default | Description |
|---|---|---|---|
enabled | No | yes | Enables or disables the module. |
project_id | Yes | — | The Google Cloud project ID. |
subscription_name | Yes | — | The name of the Pub/Sub subscription to pull messages from. |
credentials_file | Yes | — | Path to the Google Cloud service account JSON credentials file. |
max_messages | No | 100 | Maximum number of messages to pull per request. |
num_threads | No | 1 | Number of threads used for pulling messages. |
pull_on_start | No | yes | Pull messages immediately when the module starts. |
interval | No | 1h | Time interval between pull requests. |
<wodle name="gcp-bucket">
<enabled>yes</enabled>
<run_on_start>yes</run_on_start>
<interval>1h</interval>
<bucket type="access_logs">
<name>my-gcp-bucket</name>
<credentials_file>/var/ossec/etc/credentials.json</credentials_file>
<path>logs/</path>
<only_logs_after>2024-01-01</only_logs_after>
<remove_from_bucket>no</remove_from_bucket>
</bucket>
</wodle>
| Option | Required | Default | Description |
|---|---|---|---|
enabled | No | yes | Enables or disables the module. |
run_on_start | No | yes | Process logs immediately when the module starts. |
interval | No | 1h | Time interval between bucket scans. |
bucket | Yes | — | Defines a bucket to monitor. Use type attribute to specify the bucket type (for example, access_logs). |
name | Yes | — | Name of the Cloud Storage bucket. |
credentials_file | Yes | — | Path to the service account credentials file. |
path | No | — | Prefix (path) filter for objects in the bucket. |
only_logs_after | No | — | Only process logs created after this date (format: YYYY-MM-DD). |
remove_from_bucket | No | no | Delete log objects from the bucket after processing. |
wazuh-topic).wazuh-subscription).Pub/Sub Subscriber (for Pub/Sub integration)Storage Object Viewer (for bucket integration)After configuring the module, restart the Wazuh agent:
systemctl restart wazuh-agent
Check the Wazuh agent logs for GCP module activity:
grep "gcp" /var/ossec/logs/ossec.log
GCP events appear in the Wazuh alerts with the gcp data field populated.