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 MS Teams webhook exposed key handling #608

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

gjcthinkst
Copy link
Contributor

Proposed changes

Add MS Teams webhook support for exposed API key alerts. While we're in the area also do some refactoring and general improvements for the MS Teams 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 MS Teams 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 MS Teams messages displayed correctly.

CleanShot 2024-11-13 at 13 28 21@2x

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

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

@thinkst-tom
Copy link
Contributor

@gjcthinkst It looks like we're using the legacy format here. There is a newer payload format using "Adaptive Cards".

Did you set up the webhook you used to test here with the Workflows app on MS Teams? Or with Connectors (doing it this way is going to be retired at some stage - MS is very vague about when though)?

@gjcthinkst
Copy link
Contributor Author

@gjcthinkst It looks like we're using the legacy format here. There is a newer payload format using "Adaptive Cards".

Did you set up the webhook you used to test here with the Workflows app on MS Teams? Or with Connectors (doing it this way is going to be retired at some stage - MS is very vague about when though)?

@thinkst-tom I've had a quick look at the new format and the new Workflows app on MS Teams, but I think it's going to be a larger change to get the webhooks working with that. For this PR I think we should stick to the legacy format and connectors and leave the change to Workflows for a future PR.

Copy link
Contributor

@thinkst-tom thinkst-tom left a comment

Choose a reason for hiding this comment

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

I think we should stick to the legacy format and connectors and leave the change to Workflows for a future PR.

That sounds reasonable to me 👍

@gjcthinkst gjcthinkst force-pushed the aws_exposed_key_webhooks_ms_teams branch from 66a0586 to 061afb0 Compare November 20, 2024 14:06
@gjcthinkst gjcthinkst merged commit 8e71ee4 into master Nov 20, 2024
2 checks passed
@gjcthinkst gjcthinkst deleted the aws_exposed_key_webhooks_ms_teams branch November 20, 2024 14:16
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