This action aims to create an easy way to format and send alerts as Google Chat messages.
-
Google Chat's webhook functionality is currently only accessible with an admin account.
-
To enable webhooks in your Google Chat room, click on the room's title when it's opened and active on your page. Select configure webhooks within the dropdown menu. More information on Google Chat webhook configuration can be found here.
-
Inside the actions folder are specified folders for each service. SendGoogleChat will have a
config-default.yml
that holds the value representing your webhook url. Replace this value with your Google Chat Webhook URL you configured in the previous step. -
(optional) Configure and locally test your Google Chat integration. Once you are satisfied with your configuration, you must re-deploy Responder to finalize your changes.
-
Congratulations you should now be able receive custom Responder alerts in your Google Chat room!
The Google Chat integration can be used in a two different ways.
-
Simple text alerts can be customized to higher complexity using Google's message formatting guidelines. These alteration will be synonymous to your
actions.yml
file located in main directory of this repository. Any changes made within this file will subsequently change the structure of your webhook alert. -
Additionally you can utilize templates. By default Responder comes with a prebuilt template for AWS. However, in the future we hope to add templates for other platforms.
A simple text message can be specified by configuring a value for the message
property in the actions.yml
file.
- rule: TheRuleName
sequential:
...
- command: SendGoogleChat
message: "Write your custom message here"
...
A simple header message can be created by adding a value to the header
property in the actions.yml
file.
- rule: TheRuleName
sequential:
...
- command: SendGoogleChat
message:
header: "Write your custom header here"
...
A Header and Values message can be created by adding a value to the header
property, as well as adding / configuring the values
property in the actions.yml
file.
Values are a JSONPath of the context object
- rule: TheRuleName
sequential:
...
- command: SendGoogleChat
message:
header: "e.g. Root has logged in"
values:
- label: "e.g. Account"
value: "$.event.rawEvent.account"
- label: "e.g. From"
value: "$.event.rawEvent.detail.sourceIPAddress"
...
It's easy to specify a template as well. This will provide more advanced formatting options. This is also done in the actions.yml
file.
As mentioned above, Responder comes with a prebuilt template for AWS.
The aws-event
template is preconfigured to be used "right out of the box" with no further setup. But remember the template is just a starting point so feel free to customize it to suit your needs!
For more information on customizing event templates, refer to our templating section
- rule: TheRuleName
sequential:
...
- command: SendGoogleChat
template: aws-event
...
Existing templates are located in the actions/SendGoogleChat/templates
directory. The name of the template is the file itself. The existing templates were built referencing this: Google Chat webhooks formatting