[ResponseOps] https proxy agent options assignment is made in the wrong place #196602
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Actions
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
The code below is where we set the custom host ssl options in the agent, before making requests:
kibana/x-pack/plugins/actions/server/lib/get_custom_agents.ts
Lines 134 to 139 in 2f67874
Unfortunately, this seems to be a no-op. By the time the ultimate socket is opened to the endpoint (via CONNECT to the proxy), the options are no longer there, and in fact the default. In this case, the important ones being SSL-related (
rejectUnauthorized
,ca
, etc).Not clear if this is because we are setting them AFTER we create the agent, or if it's an inherent bug in the agent itself. It doesn't look to me like the assignment of the options does anything useful within the agent, and doesn't seem to be used when constructing parameters for the ultimate TLS connection, so feels like the first (options set AFTER agent created). Quite possible this did work at some time, but was dependent on how the agent is actually coded, and doesn't work in newer releases of the agent.
You can see in this PR, we set
rejectUnauthorized
in the constructor options, which is what I expect we should do. Line 47 ofx-pack/plugins/actions/server/builtin_action_types/lib/get_proxy_agents.ts
:https://github.com/elastic/kibana/pull/86415/files#diff-3904070ded12b9cd170538e0e852699e3bb3924b5d45795a8d0a71572da9bc5d
However, shortly after, in this PR, we change it to set the options after the constructor call. Line 113 of the same file.
https://github.com/elastic/kibana/pull/96630/files#diff-e4b9b3cd3d50b6c092a98136bba35c1b001e6602bb102257bf22a564437db5c3
Sometime later, the code was changed to what it is today:
kibana/x-pack/plugins/actions/server/lib/get_custom_agents.ts
Lines 123 to 139 in 2f67874
The text was updated successfully, but these errors were encountered: