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

Changed teams output module to POST an adaptive card to the power automate webhook #1739

Conversation

domwhewell-sage
Copy link
Contributor

@domwhewell-sage domwhewell-sage commented Sep 2, 2024

I have made changes to the teams output webhook to send any configured events to a Power Automate workflow webhook in the form of an adaptive card.

The color attribute in a TextBlock does not take a HEX color code so I have changed the get_severity_color() to return the strings it does accept.

You can use the adaptive card designer here https://adaptivecards.io/designer/ and paste in the adaptive_card['attachments'][0]['content'] to see how it will appear in MS teams

@domwhewell-sage domwhewell-sage changed the title Changed webhook to POST an adaptive card Changed teams output module to POST an adaptive card to the power automate webhook Sep 2, 2024
@TheTechromancer TheTechromancer mentioned this pull request Sep 2, 2024
1 task
@domwhewell-sage domwhewell-sage marked this pull request as ready for review September 3, 2024 08:43
@TheTechromancer
Copy link
Collaborator

TheTechromancer commented Sep 3, 2024

Thanks for doing this. In my testing, the messages display well, but the response code is 200 which causes them to be repeated infinitely:

image

I wonder if we need to add support for multiple good_status_codes.

@domwhewell-sage
Copy link
Contributor Author

Oh that's weird I got the opposite HTTP 202 response was causing it to loop indefinitely. Maybe it depends on the power automate workflow you have enabled 🤔

Yeh it's probably easy to implement a list of 'good' status codes.

@TheTechromancer
Copy link
Collaborator

Actually let's just change up the default evaluate_response() to use response.is_success(). That will match any 2xx response code. Modules can override the function if they need to.

@TheTechromancer TheTechromancer merged commit b7c1ecd into blacklanternsecurity:dev Sep 5, 2024
8 checks passed
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.

3 participants