Capsule8 Docs
Capsule8 Docs
Help

Exporting Alerts to Google Cloud Pub/Sub

The pubsub output type sends alerts to a Google Cloud Pub/Sub service.

Key Required Description
project_name yes The name of the gcp project.
topic_id yes The name of the topic you wish to publish to.
credentials_json no The path to gcp profile credentials file. You can alternativly set the GOOGLE_APPLICATION_CREDENTIALS enviroment variable.
validate_topic no When set to true, validates the topic and project at startup. Note that it requires the extra pubsub.Viewer permission to work.

Example:

The following two require an existing pubsub project and topic along with gcp pubsub.publisher permissions.

# Send alerts to alert topic in the pubsub in capsule8 project
alert_output:
  outputs:
    - type: pubsub
      enabled: true
      project_name: capsule8
      topic_id: alert

# Send alerts to alert topic in the pubsub in capsule8 project with credentials
alert_output:
  outputs:
    - type: pubsub
      enabled: true
      project_name: capsule8
      topic_id: alert
      credentials_json: /home/ubuntu/.gcp/credentials.json

Additionally if you give the sensor pubsub.viewer permissions you may also enable the option to check that the topic and project are valid at start-up.

alert_output:
  outputs:
    - type: pubsub
      enabled: true
      project_name: capsule8
      topic_id: alert
      validate_topic: true