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

Webhook action - add support for headers as secrets #56874

Open
peterschretlen opened this issue Feb 5, 2020 · 5 comments
Open

Webhook action - add support for headers as secrets #56874

peterschretlen opened this issue Feb 5, 2020 · 5 comments
Labels
connectivity Issues relating to connectivity between Kibana and external services estimate:small Small Estimated Level of Effort Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@peterschretlen
Copy link
Contributor

peterschretlen commented Feb 5, 2020

Describe the feature:

The webhook action supports user and password secrets which are used to create a Basic authentication header. But there is often other header information we'd like to encrypt:

  • headers for other authentication schemes for example the Bearer scheme for token based authentication.
  • support Proxy-Authorization header
  • support custom headers that can carry sensitive information like keys that need to be encrypted.

While these can be set as headers today, they are not treated as secrets (not encrypted).

Describe a specific use case for the feature:

I may want to use a webhook to call an Elasticsearch API in a different cluster, using an API key.

according to the docs:

The API key returned by this API can then be used by sending a request with a Authorization header with a value having the prefix ApiKey followed by the credentials, where credentials is the base64 encoding of id and api_key joined by a colon.

Having secret headers would allow creating a lightweight external Elasticsearch connector using an API key.

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

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

@pmuellr
Copy link
Member

pmuellr commented Feb 5, 2020

headers already exists in the "config":

const configSchemaProps = {
url: schema.string(),
method: schema.oneOf([schema.literal(WebhookMethods.POST), schema.literal(WebhookMethods.PUT)], {
defaultValue: WebhookMethods.POST,
}),
headers: nullableType(HeadersSchema),
};

While we can easily add a new headers to "secrets", I'm thinking perhaps we should just move headers from "config" to "secrets". There can't be anyone using this yet, can there be?

It seems like it could be possibly confusing to have it in both (eg, two "headers" editors in a create UI). We'd also need to document the priority.

@peterschretlen
Copy link
Contributor Author

I'm thinking perhaps we should just move headers from "config" to "secrets". There can't be anyone using this yet, can there be?

Good point @pmuellr! Aside from a bit of rework I don't think there are any drawback to moving from config to secrets?

@gmmorris
Copy link
Contributor

gmmorris commented Oct 9, 2020

Aside from a bit of rework I don't think there are any drawback to moving from config to secrets?

There is the downside that headers would then be hidden from the user in the UX so they can't actually verify that the field they have set has been saved. It would make debugging a misbehaving connector very hard.

We should probably wait on doing this until we address this issue:#78704

@mikecote
Copy link
Contributor

mikecote commented Feb 4, 2021

Moving from 7.x - Candidates to 8.x - Candidates (Backlog) after the latest 7.x planning session.

@gmmorris gmmorris added the Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework label Jul 1, 2021
@gmmorris gmmorris added the loe:medium Medium Level of Effort label Jul 14, 2021
@gmmorris gmmorris added connectivity Issues relating to connectivity between Kibana and external services estimate:small Small Estimated Level of Effort labels Aug 13, 2021
@gmmorris gmmorris removed the loe:medium Medium Level of Effort label Sep 2, 2021
@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
connectivity Issues relating to connectivity between Kibana and external services estimate:small Small Estimated Level of Effort Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

No branches or pull requests

6 participants