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

Misleading error message when creating a webhook connector with invalid URL #68662

Closed
luizgpsantos opened this issue Jun 9, 2020 · 2 comments · Fixed by #70025
Closed

Misleading error message when creating a webhook connector with invalid URL #68662

luizgpsantos opened this issue Jun 9, 2020 · 2 comments · Fixed by #70025
Assignees
Labels
Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@luizgpsantos
Copy link

luizgpsantos commented Jun 9, 2020

Kibana version:

7.7.1

Elasticsearch version:

7.7.1

Server OS version:

macOS Mojave 10.14.6

Browser version:

Google Chrome Version 83.0.4103.61 (Official Build) (64-bit)

Original install method (e.g. download page, yum, from source, etc.):

Downloaded tar.gz from the download page.

Describe the bug:

When creating a Webhook connector in "Alerts and Actions" page, it requires the protocol (http://, https://). Providing the following value example.com/do-something results in an error message that isn't intuitive (xpack.actions.whitelistedHosts defaults to [*]):

error validating action type config: error configuring webhook action: 
target url "example.com/do-something" is not whitelisted in the Kibana
config xpack.actions.whitelistedHosts

Steps to reproduce:

  1. Go to Management --> Alerts and Actions --> Connectors --> Create connector;
  2. Choose "Webhook" connector;
  3. Provide a "Connector name" and type "example.com/do-something" in the URL field;
  4. Click in "Save";
  5. Check the validation error message.

Expected behavior:

I think there are some options when using example.com/do-something for URL:

  • Kibana could infer the http:// protocol;
  • Or Kibana could provide a more intuitive error message "Invalid URL, please inform the protocol"
  • Any other?

Screenshots (if relevant):

Screen Shot 2020-06-09 at 12 21 02

@luizgpsantos luizgpsantos added Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Jun 9, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@pmuellr
Copy link
Member

pmuellr commented Jun 10, 2020

We have two different types of action params you can whitelist - URLs (used in most cases in our actions) and host names (used at least by the email action). The URL whitelisting code seems to be generating this non-intuitive message. Seems like it should be doing a bit more work to validate the URL before doing the whitelist check, if that's what's happening. Eg, I'd expect a URL without a protocol to generate a message indicating the URL didn't provide a protocol, in this case.

I'm hoping we can use (one of) Node's built-in URL object(s) to do a validation that would provide a reasonable error message that we can eventually display in the UI.

@YulNaumenko YulNaumenko self-assigned this Jun 25, 2020
@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants