Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Discord webhook exposed key handling #607

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gjcthinkst
Copy link
Contributor

Proposed changes

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

Types of changes

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

  • New feature (non-breaking change which adds functionality)

Checklist

  • Lint and unit tests pass locally with my changes (if applicable)
  • I have run pre-commit (pre-commit in the repo)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Linked to the relevant github issue or github discussion

Further comments

I tested the changes to the Discord 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 Discord messages displayed correctly.

CleanShot 2024-11-13 at 13 08 17@2x

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

CleanShot 2024-11-07 at 15 54 34@2x

Copy link
Contributor

@wleightond wleightond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving away from typing.{List,Tuple,Dict} to their builtin equivalents will apply to other PRs as well

canarytokens/utils.py Outdated Show resolved Hide resolved
canarytokens/webhook_formatting.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants