kibana/x-pack/plugins/actions/server
Patrick Mueller ff546a1af4
[actions] for simplistic email servers, set rejectUnauthorized to false (#91760)
resolves https://github.com/elastic/kibana/issues/91686

The poor email action has not had great success in setting TLS options
correctly.  Prior to 7.11, it was basically always setting `rejectUnauthorized`
to false, so was never validating certificates.  Starting in 7.11.0, it
started respecting TLS certificates, but there are some simple/test servers
in use that use self-signed certificates.

The real fix for this will be the resolution of issue
https://github.com/elastic/kibana/issues/80120 , but until then, this PR
does a special-case check if the `secure` option is off (so the email client
connects with a plain socket and then upgrades to TLS via STARTTLS) and both
the user and password for the server are not set, then it will use
`rejectUnauthorized: false`.  Otherwise, it uses the global configured value
of this setting.

This also changes some other cases, where `secure: true` often did not
set any `rejectUnauthorized` property at all, and so did not get verified.
Now in all cases, `rejectUnauthorized` will be set, and the value will
correspond to the globally configured value, except for the special case
checked here, and when a proxy is in use (that logic did not change).

So it is possible this would break customers, who were using insecure servers
and email action worked, but with this fix the connections will be rejected.
They should have been rejected all this time though.

The work-around for this problem, if we don't implement a fix like this, is
that customers will need to set the global `rejectUnauthorized` to `false`,
which means NONE of their TLS connections for any actions will be verified.
Which seems extreme.
2021-03-01 16:30:21 -05:00
..
authorization Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
builtin_action_types [actions] for simplistic email servers, set rejectUnauthorized to false (#91760) 2021-03-01 16:30:21 -05:00
constants Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
lib Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
manual_tests Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
routes Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
saved_objects Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
usage [Telemetry] Full schema definition (#90273) 2021-03-01 18:30:51 +00:00
action_type_registry.mock.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
action_type_registry.test.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
action_type_registry.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
actions_client.mock.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
actions_client.test.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
actions_client.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
actions_config.mock.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
actions_config.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
actions_config.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
config.test.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
config.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
create_execute_function.test.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
create_execute_function.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
feature.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
index.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
mocks.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
plugin.test.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
plugin.ts Do not generate an ephemeral encryption key in production. (#81511) 2021-02-10 11:27:31 +01:00
types.ts Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00