-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Legacy] Route payload must be set to 'parse' when payload validation enabled #57777
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
I'm with the same problem to use the ElastAlert plugin on Kibana 7.6.0. |
Hi @pgayvallet and @afharo . Is there any update in that issue? Thanks. |
👍 same problem, any update? |
👍 same problem, any update? |
👍 same problem, any update? |
Hello, First of all, my apologies for the lack of answer on this issue. Due to security concerns, default payload validation has been enabled for every route registered on the kibana hapi server, legacy routes included. I can confirm that this was introduced in #48753. I will be honest, after a few tests, I'm not really sure how/why it broke routes registered from some 3rd parties such as Only solution I can think of for now is to manually disable payload validation on 'faulty' routes. This has to be done on the plugin's side. to take the server.route({
path: '/api/elastalert/{path*}',
method: ['GET', 'POST', 'DELETE'],
handler: {
proxy: {
mapUri: request => {
return { uri: `${baseUri}/${request.params.path || ''}` };
}
}
}
}); would have to be adapted to something like: const handler = {
proxy: {
mapUri: request => {
return { uri: `${baseUri}/${request.params.path || ''}` };
}
}
['GET', 'POST', 'DELETE'].forEach(method => {
server.route({
path: '/api/elastalert/{path*}',
method,
handler,
config:
method === 'GET'
? undefined
: {
validate: { payload: null },
payload: { parse: false },
},
});
}); By testing this locally, the error goes away. Please note that as this is not impacting any internal plugins, and as 3rd party plugins support is an experimental API, this is not considered breaking. However if someone with some |
I found a commit in the fork of @aristenio where he adds Kibana 7.6.0 support this way. |
@mmguero Have you tested this fork/commit? If yes, you could release one zip for us. |
testing it out now, i'll let you know |
So today I learned I had no idea how to package one of these up into a zip file for distribution. I did some research and build myself a docker build environment (based on https://github.com/blacktop/kibana-plugin-builder) and |
@pgayvallet thank you so much for your time! |
@pgayvallet Thank you, I tested your example in the bitsensor elastalert kibana plugin with good results, as well. |
This issue only affected legacy plugins which are no longer supported |
Kibana version: 7.6.0
Elasticsearch version: 7.6.0
Server OS version: Any
Browser version: Any
Browser OS version: Any
Original install method (e.g. download page, yum, from source, etc.): Any
Describe the bug:
This error is happens on startup when registering the linked plugin
bitsensor/elastalert-kibana-plugin#141
Steps to reproduce:
Expected behavior:
It should work as it was working back in
7.5.x
(maybe this is the change that broke this behaviour?): #48753Screenshots (if relevant):
Not relevant
Errors in browser console (if relevant):
Not relevant
Provide logs and/or server output (if relevant):
Any additional context:
@pgayvallet and @legrego had an initial discussion about this.
The text was updated successfully, but these errors were encountered: