thinkst / canarytokens

Canarytokens helps track activity and actions on your network.
http://canarytokens.org
Other
1.76k stars 258 forks source link

Add Google Chat webhook exposed key handling #606

Closed gjcthinkst closed 1 week ago

gjcthinkst commented 3 weeks ago

Proposed changes

Add Google Chat webhook support for exposed API key alerts. While we're in the area also do some refactoring and general improvements for the Google Chat webhook.

Types of changes

What types of changes does your code introduce to this repository?

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

I tested the changes to the Google Chat webhook by creating a new AWS API key token, triggering it normally and manually creating an exposed key alert with CURL (with 25 Dec as the exposed time) and checked that all three Google chat messages displayed correctly.

CleanShot 2024-11-08 at 15 45 59@2x

An example of the current (before this change) Google Chat message format is shown below.

CleanShot 2024-11-07 at 15 55 55@2x