Optional ssl for fleet logstash output#216216
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
| updateData | ||
| updateData, | ||
| { | ||
| mergeAttributes: false, |
There was a problem hiding this comment.
Our fleet API route for updating outputs uses a PUT HTTP verb, but our update of the saved object was performing partial updates and merging existing fields with fields included in the update. This had the effect of persisting the secrets field when it was omitted in the update. This change makes sure this is a full replace of the object.
There was a problem hiding this comment.
Fleet APIs are not following strictly REST guidelines and all of our PUT APIs are in reality PATCH, like most of the Kibana APIs
There was a problem hiding this comment.
Gotcha! I'll refactor towards the PATCH behavior instead. Looks like anyways this change broke a bunch of tests which I missed.
|
|
||
| const isSSLEditable = isDisabled('ssl'); | ||
| // Logstash inputs | ||
| const logstashEnableSSLInput = useSwitchInput(output ? Boolean(output?.ssl) : true); |
There was a problem hiding this comment.
The idea here is that if we don't have any pre-existing output, we assume its a new configuration and set the default state to true. Otherwise if we are editing an existing output, we set the enable state based on the presence of existing SSL settings.
This is fine for editing an existing Logstash config, but if you are editing an existing output of a different type like Kafka where SSL values may not have been setup, and changing it to Logstash, it can default to false which is not ideal. We have a failing cypress test around this.
|
@MichelLosier I have been trying to save a logstash output without ssl configuration and it seems it's stuck without any error message, looking at the original issue it seems to me we should be able to save the logstash even with an incomplete ssl configuration, maybe I missed something |
|
Thanks for catching that, seeing that too. It seems this happens now if its a brand new output config, or if its an existing output already with SSL disabled and you are trying to save again with SSL still disabled. Looking into it. |
|
58161af should address that issue, following a similar pattern with the Kafka output form. Seems what was missing here was not running validation for SSL fields if the SSL switch was off, otherwise as you observed, it would quietly fail validation. |
|
@MichelLosier looks better just tested on create and it seems to work, but on update it seems I still have issues when providing only a server certificate (that should be a scenario we accept)
|
|
From my understanding that looks to be expected, if the new SSL switch is turned off this allows you to submit a configuration that doesn't use the SSL fields and omits that part of the form altogether. Otherwise, if the SSL switch is turned on, the SSL certificate and key values are required which is the current state on Worth noting: I see on It sounds like though from here when SSL is in use we do want to make sure a key and cert is defined and used at both the agent and ES pipeline end because its also serving as an auth mechanism. Our template config for elastic_agent input for ES sets |
|
It seems the issue we want to solve is to allow user to use a logstash output without ssl client verification, in that scenario they may want to provide a server certificate authority but no client certificate. |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
|
Right! From the original ticket, as I understood it there seemed to be two asks:
For 2, I split into its own ticket: #216243, since there was concern about the complexity introduced to the form. I think my initial proposal of an approach we can take for that case made some incorrect requirements, and I have just revised it and it seems a bit more simpler. So for this PR I was just scoping to the story of using / not using SSL. For supporting turning off client verification, I agree that having the client certificate and key fields as optional would support that, but I think we would need to have the elastic agent pipeline config field |
|
Thanks got it, I was missing that second issue context :) I am wondering if the second ticket could be simplified by providing all the option in the pipeline with comments, and avoiding a dropdown, but not related to that one |
Yeah, I like this option! I'll add it as a consideration for #216243 |

Summary
Resolves: #145266
Fix: Fleet API output update usage (HTTP PUT) of saved object client is aligned as full object update instead of partialSets themergeAttributes: falseoption on the saved object clientReviewer asks
Current / Default State

SSL disabled state: form

SSL disabled state: Logstash config input with SSL fields removed

Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesIdentify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.