Skip to content

[ResponseOps][Connectors] Allow additional methods for the Webhook connector#238072

Merged
js-jankisalvi merged 37 commits intoelastic:mainfrom
adcoelho:webhook-methods-ui
Nov 14, 2025
Merged

[ResponseOps][Connectors] Allow additional methods for the Webhook connector#238072
js-jankisalvi merged 37 commits intoelastic:mainfrom
adcoelho:webhook-methods-ui

Conversation

@adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Oct 8, 2025

Closes #236398

Summary

This PR allows the webhook connector to be configured with the GET, PATCH, and DELETE methods.

Screenshot 2025-10-08 at 16 54 52

If the method is one of GET or DELETE, a rule action using this connector will have body parameter as optional.

Although the original issue says otherwise, I decided to exclude the body for DELETE requests too. The documentation says:

The DELETE method has no defined semantics for the message body, so this should be empty.

Release Notes

The webhook connector now allows the following HTTP request methods: POST(default), PUT, PATCH, GET, or DELETE.

@adcoelho adcoelho self-assigned this Oct 8, 2025
@adcoelho adcoelho requested a review from a team as a code owner October 8, 2025 14:55
@adcoelho adcoelho added release_note:enhancement backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework labels Oct 8, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@jcger jcger left a comment

Choose a reason for hiding this comment

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

I've created a connector with POST and used it as rule action with a body. I then updated the webhook to use GET instead. The webhook is not being send (which makes sense), but I would have expected to see an error message in the logs and there is nothing. Also, updating back from GET to POST, still contains the body. Shouldn't the body have been deleted when updating to GET? Seems like we might have GET configs with a body. At the same time (thinking out loud) deleting the body when updating from POST to GET could be a huge disaster if someone updates by mistake or not really thinking about it. If we end up deleting the body when updating from POST to GET, should we show a warning message?

@adcoelho
Copy link
Contributor Author

I've created a connector with POST and used it as rule action with a body. I then updated the webhook to use GET instead. The webhook is not being send (which makes sense), but I would have expected to see an error message in the logs and there is nothing. Also, updating back from GET to POST, still contains the body. Shouldn't the body have been deleted when updating to GET? Seems like we might have GET configs with a body. At the same time (thinking out loud) deleting the body when updating from POST to GET could be a huge disaster if someone updates by mistake or not really thinking about it. If we end up deleting the body when updating from POST to GET, should we show a warning message?

Thanks for this @jcger. After your message I had a chat with tia offline.

Changing all configured actions if the connector changed was not feasible so we opted for the following solution:

  1. Always display the configured method in the rule action of a webhook connector.
  2. The body is optional in the form for GET and DELETE but always shown.
  3. The body is ignored when running execute for GET and DELETE.
Copy link
Contributor

@jcger jcger left a comment

Choose a reason for hiding this comment

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

Image
  1. Should we also indicate that the body will be ignored?

  2. I did not test in latest main, so maybe there is something already in place. What about an intermediate release? I configured a GET and a PATCH webhook, when rolling back, the GET request stops working (GET with body error in the console), PATCH works, so far so good. The problem is that when updating these connectors, I see POST, which is incorrect and would confuse the users

code LGTM

@adcoelho
Copy link
Contributor Author

Should we also indicate that the body will be ignored?

We decided not to. It looked a bit awkward with the subtext there.

I did not test in latest main, so maybe there is something already in place. What about an intermediate release? I configured a GET and a PATCH webhook, when rolling back, the GET request stops working (GET with body error in the console), PATCH works, so far so good. The problem is that when updating these connectors, I see POST, which is incorrect and would confuse the users

I created an intermediate release PR only with the changes from the BE #239847

adcoelho added a commit that referenced this pull request Oct 22, 2025
## Summary

This is an intermediate release for #238072

This PR removes the validation in the webhook connector backend for HTTP
method and body.

Now, if the method does not require a body, it simply isn't passed.

---------

Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
## Summary

This is an intermediate release for elastic#238072

This PR removes the validation in the webhook connector backend for HTTP
method and body.

Now, if the method does not require a body, it simply isn't passed.

---------

Co-authored-by: Christos Nasikas <xristosnasikas@gmail.com>
Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

We need to make the same changes for the components in the triggers_actions_ui, otherwise, I get an error for the DELETE/GET methods in security solution.

Image
validateParams: (
actionParams: ActionParams
actionParams: ActionParams,
connectorConfig?: Record<string, unknown>
Copy link
Member

@cnasikas cnasikas Oct 27, 2025

Choose a reason for hiding this comment

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

Should we use ActionConfig from the template literal?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question. I think this will allow to avoid type casting in the x-pack/platform/plugins/shared/stack_connectors/public/connector_types/webhook/webhook.tsx where connectorConfig is of a WebhookConfig type.

@js-jankisalvi js-jankisalvi requested review from a team as code owners October 29, 2025 18:04
@js-jankisalvi js-jankisalvi requested a review from rylnd October 29, 2025 18:04
Copy link
Contributor

@e40pud e40pud left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all feedback! 🚀

Copy link
Contributor

@dplumlee dplumlee left a comment

Choose a reason for hiding this comment

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

Tested all new methods in the rule edit and create forms, rule management changes LGTM

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

LGTM!

@js-jankisalvi js-jankisalvi requested review from a team as code owners November 14, 2025 09:51
Copy link
Contributor

@janmonschke janmonschke left a comment

Choose a reason for hiding this comment

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

kibana-cases changes lgtm

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Changes to the AI Infra owned tests LGTM

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

Workflows code LGTM

Copy link
Contributor

@arturoliduena arturoliduena left a comment

Choose a reason for hiding this comment

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

LGTM - Obs AI Assistant code review

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 8352 8378 +26

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/alerts-ui-shared 306 307 +1
triggersActionsUi 500 501 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.8MB 2.8MB +111.0B
datasetQuality 426.9KB 427.0KB +111.0B
discover 1.2MB 1.2MB +111.0B
infra 1.1MB 1.1MB +111.0B
ml 5.4MB 5.4MB +111.0B
monitoring 631.7KB 631.8KB +111.0B
observability 1.7MB 1.7MB +112.0B
securitySolution 11.1MB 11.1MB +2.9KB
slo 984.4KB 984.5KB +111.0B
stackConnectors 819.8KB 820.0KB +210.0B
synthetics 1.0MB 1.0MB +111.0B
transform 624.5KB 624.6KB +111.0B
triggersActionsUi 1.5MB 1.5MB +230.0B
uptime 490.6KB 490.7KB +111.0B
total +4.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
stackConnectors 75.8KB 76.3KB +514.0B
Unknown metric groups

API count

id before after diff
@kbn/alerts-ui-shared 325 326 +1
triggersActionsUi 504 505 +1
total +2

History

cc @adcoelho @js-jankisalvi

@js-jankisalvi js-jankisalvi merged commit 39fb1af into elastic:main Nov 14, 2025
12 checks passed
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
…nnector (elastic#238072)

Closes elastic#236398

## Summary

This PR allows the webhook connector to be configured with the `GET`,
`PATCH`, and `DELETE` methods.

<img width="307" height="309" alt="Screenshot 2025-10-08 at 16 54 52"
src="https://github.com/user-attachments/assets/16c99ba6-c75a-4ad6-83d0-045cc132ffa1"
/>

If the method is one of `GET` or `DELETE`, a rule action using this
connector will have `body` parameter as optional.

Although the original issue says otherwise, I decided to exclude the
body for DELETE requests too. [The documentation
says](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE):

> The DELETE method has no defined semantics for the message body, so
this should be empty.

## Release Notes

The webhook connector now allows the following HTTP request methods:
POST(default), PUT, PATCH, GET, or DELETE.

---------

Co-authored-by: Janki Salvi <jankigaurav.salvi@elastic.co>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework release_note:enhancement Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.3.0