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

Feat: add ssl_supported_protocols option #1055

Merged
merged 31 commits into from
Apr 4, 2022
Merged

Conversation

kares
Copy link
Contributor

@kares kares commented Nov 29, 2021

The new ssl_supported_protocols option default is aligned with what the Manticore/HttpClient defaults to
-> whatever the SSL engine defaults to -> on up to date Java (>= 8) it's TLSv1.3,TLSv1.2

Having a configuration option (similar to ES' xpack.security.http.ssl.supported_protocols: TLSv1.3,TLSv1.2) allows for more flexibility.

This PR also establishes confidence that TLSv1.3 is working and supported on recent LS (JVM) versions.

@kares kares mentioned this pull request Jan 25, 2022
40 tasks
@kares kares changed the title Feat: support ssl_enabled_protocols => TLSv1.3 Feat: add ssl_supported_protocols option Jan 25, 2022
@kares kares marked this pull request as ready for review January 26, 2022 08:21
@@ -66,6 +66,8 @@ module APIConfigs
# Set the keystore password
:keystore_password => { :validate => :password },

:ssl_supported_protocols => { :validate => ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], :default => [], :list => true },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ES also (still) supports: SSLv3, TLSv1 and SSLv2Hello but since these are disabled by default in an up-to-date Java I do not think we need to support them give even an old 6.0 cluster is expected to run on at least Java 8.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly wary of removing something that is a valid option with Elasticsearch, maybe we should keep it but warn?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we had a discussion with @jsvd on the topic and part of that outcome was that we start with >= TLSv1.1 (for all plugins), in this case despite ES' support for legacy SSLv3 and TLSv1.
existing plugin versions using TLS <= 1.1, on an up-to-date JDK, need tampering with the java.security files so if they're upgrading they either upgrade to secure TLS or we'll hear them complaining on the feature per plugin basis (the default - not setting the option is expected to work for them as before).

@kares kares requested a review from jsvd March 15, 2022 12:32
Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reran the travis tests and there's still one configuration failing: SECURE_INTEGRATION=true INTEGRATION=true ELASTIC_STACK_VERSION=8.x SNAPSHOT=true LOG_LEVEL=info

The logs don't seem to show anything relevant, may require some investigation to rule out as unrelated.

@kares
Copy link
Contributor Author

kares commented Mar 28, 2022

I reran the travis tests and there's still one configuration failing: SECURE_INTEGRATION=true INTEGRATION=true ELASTIC_STACK_VERSION=8.x SNAPSHOT=true LOG_LEVEL=info

good catch, the issue was simply 8.x requiring auth credentials (for _refresh and friends), this slipped under the sleeve with the 🔴 storm on CI. now all 🟢

@kares kares requested review from jsvd and robbavey March 28, 2022 15:12
Copy link
Contributor

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, I'd like to get feedback from @karenzone on the docs changes, and from @jsvd on whether we need to continue supporting TLS < v1.1 as it is a valid configuration for Elasticsearch, or that we can safely drop support


* Value type is <<string,string>>
* Allowed values are: `'TLSv1.1'`, `'TLSv1.2'`, `'TLSv1.3'`
* Default depends on the JDK being used. With up-to-date Logstash, the default is `['TLSv1.2', 'TLSv1.3']`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to have a Logstash page equivalent to https://www.elastic.co/guide/en/elasticsearch/reference/current/jdk-tls-versions.html for Logstash for a single point of reference, given that this is copied across multiple plugins.
cc @karenzone

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does @robbavey ! That refactor should happen separately from that PR, but I agree we should centralize this information. Pls open a docs issue so the idea isn't lost.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created - elastic/logstash#13962

@@ -66,6 +66,8 @@ module APIConfigs
# Set the keystore password
:keystore_password => { :validate => :password },

:ssl_supported_protocols => { :validate => ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], :default => [], :list => true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly wary of removing something that is a valid option with Elasticsearch, maybe we should keep it but warn?

@robbavey robbavey requested a review from karenzone March 30, 2022 20:38
@jsvd
Copy link
Member

jsvd commented Mar 31, 2022

@jsvd on whether we need to continue supporting TLS < v1.1

While it makes sense for ES to still allow the possibility of a client using tls1.0 because you many need to have a component sending to ES directly that can only do tls1.0 or lower, on the Logstash ES output we are essentially connecting only to ES, and all ES versions we support also support tls1.1+. We can certainly but a higher bar on the encryption parameters used between Elastic components.
If anything we should make tls1.1 deprecated and remove support afterwards, but we can tackle that more broadly in a separate effort.

@robbavey
Copy link
Contributor

Thanks for the explanations @kares, @jsvd - makes sense. Code LGTM, leaving to @karenzone for final approval on doc

Copy link
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kares kares merged commit 48ddb89 into logstash-plugins:main Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support configuration of TLS/SSL parameters like protocol version and ciphers
5 participants