logstash-input-beats 6.3.0-java → 6.4.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/VERSION +1 -1
- data/docs/index.asciidoc +73 -33
- data/lib/logstash/inputs/beats/message_listener.rb +2 -2
- data/lib/logstash/inputs/beats.rb +45 -21
- data/lib/logstash-input-beats_jars.rb +1 -1
- data/spec/inputs/beats_spec.rb +40 -3
- data/vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.4.1/logstash-input-beats-6.4.1.jar +0 -0
- metadata +3 -3
- data/vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.3.0/logstash-input-beats-6.3.0.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68a12c2391dc30949874806c2fc7fcda4466e9e61069743e59b86a5897db0adf
|
4
|
+
data.tar.gz: c45c2f91cc595fa038ca25001b86bd9f68808eb985c57c9660810e657ed50ceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0a6672e755ddd5ca081213c88ac99f5f4d62fdd31bcd793a31e1873436a8b78eba730dfc331fadd38afb0ca63c62a2e056b9687b3f7ab910ee49e401c68e033
|
7
|
+
data.tar.gz: 0f350faaa0187da56c9d00107c66c27172ff13b357627fd0366bfba48572f4f59d843daa35911746ccb9b99fa8bae4a9c6aed8da532fc72e11744f9017c69260
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 6.4.1
|
2
|
+
- [DOC] Add direct memory example [#454](https://github.com/logstash-plugins/logstash-input-beats/pull/454)
|
3
|
+
|
4
|
+
## 6.4.0
|
5
|
+
- Feat: review and deprecate ssl protocol/cipher settings [#450](https://github.com/logstash-plugins/logstash-input-beats/pull/450)
|
6
|
+
|
7
|
+
## 6.3.1
|
8
|
+
- Fix: Removed use of deprecated `import` of java classes in ruby [#449](https://github.com/logstash-plugins/logstash-input-beats/pull/449)
|
9
|
+
|
1
10
|
## 6.3.0
|
2
11
|
- Added support for TLSv1.3. [#447](https://github.com/logstash-plugins/logstash-input-beats/pull/447)
|
3
12
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.4.1
|
data/docs/index.asciidoc
CHANGED
@@ -88,6 +88,19 @@ will be similar to events directly indexed by {plugin-uc} into Elasticsearch.
|
|
88
88
|
endif::[]
|
89
89
|
|
90
90
|
|
91
|
+
[id="plugins-{type}s-{plugin}-memory"]
|
92
|
+
===== Memory usage
|
93
|
+
|
94
|
+
This plugin uses "off-heap" direct memory in addition to heap memory.
|
95
|
+
By default, a JVM's off-heap direct memory limit is the same as the heap size.
|
96
|
+
For example, setting `-Xmx10G` without setting the direct memory limit will allocate `10GB` for heap and an additional `10GB` for direct memory, for a total of `20GB` allocated.
|
97
|
+
You can set the amount of direct memory with `-XX:MaxDirectMemorySize` in {logstash-ref}/jvm-settings.html[Logstash JVM Settings].
|
98
|
+
Consider setting direct memory to half of the heap size.
|
99
|
+
Setting direct memory too low decreases the performance of ingestion.
|
100
|
+
|
101
|
+
NOTE: Be sure that heap and direct memory combined does not exceed the total memory available on the server to avoid an OutOfDirectMemoryError
|
102
|
+
|
103
|
+
|
91
104
|
//Content for Beats
|
92
105
|
ifeval::["{plugin}"=="beats"]
|
93
106
|
[id="plugins-{type}s-{plugin}-multiline"]
|
@@ -101,6 +114,7 @@ plugin] to handle multiline events. Doing so will result in the failure to start
|
|
101
114
|
Logstash.
|
102
115
|
endif::[]
|
103
116
|
|
117
|
+
|
104
118
|
//Content for Beats
|
105
119
|
ifeval::["{plugin}"=="beats"]
|
106
120
|
[id="plugins-{type}s-{plugin}-versioned-indexes"]
|
@@ -159,8 +173,8 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
159
173
|
[cols="<,<,<",options="header",]
|
160
174
|
|=======================================================================
|
161
175
|
|Setting |Input type|Required
|
162
|
-
| <<plugins-{type}s-{plugin}-add_hostname>> |<<boolean,boolean>>|
|
163
|
-
| <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|
|
176
|
+
| <<plugins-{type}s-{plugin}-add_hostname>> |<<boolean,boolean>>|__Deprecated__
|
177
|
+
| <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|__Deprecated__
|
164
178
|
| <<plugins-{type}s-{plugin}-client_inactivity_timeout>> |<<number,number>>|No
|
165
179
|
| <<plugins-{type}s-{plugin}-ecs_compatibility>> | <<string,string>>|No
|
166
180
|
| <<plugins-{type}s-{plugin}-executor_threads>> |<<number,number>>|No
|
@@ -173,10 +187,11 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
173
187
|
| <<plugins-{type}s-{plugin}-ssl_handshake_timeout>> |<<number,number>>|No
|
174
188
|
| <<plugins-{type}s-{plugin}-ssl_key>> |a valid filesystem path|No
|
175
189
|
| <<plugins-{type}s-{plugin}-ssl_key_passphrase>> |<<password,password>>|No
|
176
|
-
| <<plugins-{type}s-{plugin}-ssl_verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|No
|
177
190
|
| <<plugins-{type}s-{plugin}-ssl_peer_metadata>> |<<boolean,boolean>>|No
|
178
|
-
| <<plugins-{type}s-{plugin}-
|
179
|
-
| <<plugins-{type}s-{plugin}-
|
191
|
+
| <<plugins-{type}s-{plugin}-ssl_supported_protocols>> |<<array,array>>|No
|
192
|
+
| <<plugins-{type}s-{plugin}-ssl_verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|No
|
193
|
+
| <<plugins-{type}s-{plugin}-tls_max_version>> |<<number,number>>|__Deprecated__
|
194
|
+
| <<plugins-{type}s-{plugin}-tls_min_version>> |<<number,number>>|__Deprecated__
|
180
195
|
|=======================================================================
|
181
196
|
|
182
197
|
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
@@ -194,15 +209,13 @@ input plugins.
|
|
194
209
|
|
195
210
|
Flag to determine whether to add `host` field to event using the value supplied by the {plugin-singular} in the `hostname` field.
|
196
211
|
|
197
|
-
|
198
212
|
[id="plugins-{type}s-{plugin}-cipher_suites"]
|
199
213
|
===== `cipher_suites`
|
214
|
+
deprecated[6.4.0, Replaced by <<plugins-{type}s-{plugin}-ssl_cipher_suites>>]
|
200
215
|
|
201
216
|
* Value type is <<array,array>>
|
202
|
-
* Default value is `java.lang.String[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256]@459cfcca`
|
203
217
|
|
204
|
-
The list of
|
205
|
-
The default values applies for OpenJDK 11.0.14 and higher, for older versions the list does not include suites not supported by the JDK, such as the ChaCha20 family of ciphers.
|
218
|
+
The list of cipher suites to use, listed by priorities.
|
206
219
|
|
207
220
|
[id="plugins-{type}s-{plugin}-client_inactivity_timeout"]
|
208
221
|
===== `client_inactivity_timeout`
|
@@ -215,14 +228,14 @@ Close Idle clients after X seconds of inactivity.
|
|
215
228
|
[id="plugins-{type}s-{plugin}-ecs_compatibility"]
|
216
229
|
===== `ecs_compatibility`
|
217
230
|
|
218
|
-
* Value type is <<string,string>>
|
219
|
-
* Supported values are:
|
220
|
-
** `disabled`: unstructured connection metadata added at root level
|
221
|
-
** `v1`: structured connection metadata added under ECS v1 compliant namespaces
|
222
|
-
** `v8`: structured connection metadata added under ECS v8 compliant namespaces
|
223
|
-
* Default value depends on which version of Logstash is running:
|
224
|
-
** When Logstash provides a `pipeline.ecs_compatibility` setting, its value is used as the default
|
225
|
-
** Otherwise, the default value is `disabled`.
|
231
|
+
* Value type is <<string,string>>
|
232
|
+
* Supported values are:
|
233
|
+
** `disabled`: unstructured connection metadata added at root level
|
234
|
+
** `v1`: structured connection metadata added under ECS v1 compliant namespaces
|
235
|
+
** `v8`: structured connection metadata added under ECS v8 compliant namespaces
|
236
|
+
* Default value depends on which version of Logstash is running:
|
237
|
+
** When Logstash provides a `pipeline.ecs_compatibility` setting, its value is used as the default
|
238
|
+
** Otherwise, the default value is `disabled`.
|
226
239
|
|
227
240
|
Refer to <<plugins-{type}s-{plugin}-ecs_metadata,ECS mapping>> for detailed information.
|
228
241
|
|
@@ -298,6 +311,16 @@ You can define multiple files or paths. All the certificates will
|
|
298
311
|
be read and added to the trust store. You need to configure the `ssl_verify_mode`
|
299
312
|
to `peer` or `force_peer` to enable the verification.
|
300
313
|
|
314
|
+
[id="plugins-{type}s-{plugin}-ssl_cipher_suites"]
|
315
|
+
===== `ssl_cipher_suites`
|
316
|
+
|
317
|
+
* Value type is <<array,array>>
|
318
|
+
* Default value is `['TLS_AES_256_GCM_SHA384', 'TLS_AES_128_GCM_SHA256', 'TLS_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384', 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256']`
|
319
|
+
|
320
|
+
The list of cipher suites to use, listed by priorities.
|
321
|
+
This default list applies for OpenJDK 11.0.14 and higher.
|
322
|
+
For older JDK versions, the default list includes only suites supported by that version.
|
323
|
+
For example, the ChaCha20 family of ciphers is not supported in older versions.
|
301
324
|
|
302
325
|
[id="plugins-{type}s-{plugin}-ssl_handshake_timeout"]
|
303
326
|
===== `ssl_handshake_timeout`
|
@@ -331,6 +354,33 @@ openssl pkcs8 -inform PEM -in path/to/logstash.key -topk8 -nocrypt -outform PEM
|
|
331
354
|
|
332
355
|
SSL key passphrase to use.
|
333
356
|
|
357
|
+
[id="plugins-{type}s-{plugin}-ssl_peer_metadata"]
|
358
|
+
===== `ssl_peer_metadata`
|
359
|
+
|
360
|
+
* Value type is <<boolean,boolean>>
|
361
|
+
* Default value is `false`
|
362
|
+
|
363
|
+
Enables storing client certificate information in event's metadata.
|
364
|
+
|
365
|
+
This option is only valid when `ssl_verify_mode` is set to `peer` or `force_peer`.
|
366
|
+
|
367
|
+
[id="plugins-{type}s-{plugin}-ssl_supported_protocols"]
|
368
|
+
===== `ssl_supported_protocols`
|
369
|
+
|
370
|
+
* Value type is <<array,array>>
|
371
|
+
* Allowed values are: `'TLSv1.1'`, `'TLSv1.2'`, `'TLSv1.3'`
|
372
|
+
* Default depends on the JDK being used. With up-to-date Logstash, the default is `['TLSv1.2', 'TLSv1.3']`.
|
373
|
+
`'TLSv1.1'` is not considered secure and is only provided for legacy applications.
|
374
|
+
|
375
|
+
List of allowed SSL/TLS versions to use when establishing a connection to the HTTP endpoint.
|
376
|
+
|
377
|
+
For Java 8 `'TLSv1.3'` is supported only since **8u262** (AdoptOpenJDK), but requires that you set the
|
378
|
+
`LS_JAVA_OPTS="-Djdk.tls.client.protocols=TLSv1.3"` system property in Logstash.
|
379
|
+
|
380
|
+
NOTE: If you configure the plugin to use `'TLSv1.1'` on any recent JVM, such as the one packaged with Logstash,
|
381
|
+
the protocol is disabled by default and needs to be enabled manually by changing `jdk.tls.disabledAlgorithms` in
|
382
|
+
the *$JDK_HOME/conf/security/java.security* configuration file. That is, `TLSv1.1` needs to be removed from the list.
|
383
|
+
|
334
384
|
[id="plugins-{type}s-{plugin}-ssl_verify_mode"]
|
335
385
|
===== `ssl_verify_mode`
|
336
386
|
|
@@ -347,33 +397,23 @@ If the client doesn't provide a certificate, the connection will be closed.
|
|
347
397
|
|
348
398
|
This option needs to be used with `ssl_certificate_authorities` and a defined list of CAs.
|
349
399
|
|
350
|
-
[id="plugins-{type}s-{plugin}-ssl_peer_metadata"]
|
351
|
-
===== `ssl_peer_metadata`
|
352
|
-
|
353
|
-
* Value type is <<boolean,boolean>>
|
354
|
-
* Default value is `false`
|
355
|
-
|
356
|
-
Enables storing client certificate information in event's metadata.
|
357
|
-
|
358
|
-
This option is only valid when `ssl_verify_mode` is set to `peer` or `force_peer`.
|
359
|
-
|
360
400
|
[id="plugins-{type}s-{plugin}-tls_max_version"]
|
361
401
|
===== `tls_max_version`
|
402
|
+
deprecated[6.4.0, Replaced by <<plugins-{type}s-{plugin}-ssl_supported_protocols>>]
|
362
403
|
|
363
404
|
* Value type is <<number,number>>
|
364
|
-
* Default value is `1.3`
|
365
405
|
|
366
|
-
The maximum TLS version allowed for the encrypted connections.
|
367
|
-
|
406
|
+
The maximum TLS version allowed for the encrypted connections.
|
407
|
+
The value must be the one of the following: 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLSv1.3
|
368
408
|
|
369
409
|
[id="plugins-{type}s-{plugin}-tls_min_version"]
|
370
410
|
===== `tls_min_version`
|
411
|
+
deprecated[6.4.0, Replaced by <<plugins-{type}s-{plugin}-ssl_supported_protocols>>]
|
371
412
|
|
372
413
|
* Value type is <<number,number>>
|
373
|
-
* Default value is `1`
|
374
414
|
|
375
|
-
The minimum TLS version allowed for the encrypted connections.
|
376
|
-
|
415
|
+
The minimum TLS version allowed for the encrypted connections.
|
416
|
+
The value must be one of the following: 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
377
417
|
|
378
418
|
|
379
419
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "thread_safe"
|
3
3
|
require "logstash-input-beats_jars"
|
4
|
-
|
5
|
-
|
4
|
+
java_import "javax.net.ssl.SSLPeerUnverifiedException"
|
5
|
+
java_import "org.logstash.beats.MessageListener"
|
6
6
|
|
7
7
|
module LogStash module Inputs class Beats
|
8
8
|
class MessageListener
|
@@ -51,6 +51,8 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
51
51
|
require "logstash/inputs/beats/message_listener"
|
52
52
|
require "logstash/inputs/beats/tls"
|
53
53
|
|
54
|
+
java_import 'org.logstash.netty.SslContextBuilder'
|
55
|
+
|
54
56
|
# adds ecs_compatibility config which could be :disabled or :v1
|
55
57
|
include LogStash::PluginMixins::ECSCompatibilitySupport(:disabled,:v1, :v8 => :v1)
|
56
58
|
|
@@ -89,9 +91,6 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
89
91
|
#
|
90
92
|
config :ssl_certificate_authorities, :validate => :array, :default => []
|
91
93
|
|
92
|
-
# Flag to determine whether to add host information (provided by the beat in the 'hostname' field) to the event
|
93
|
-
config :add_hostname, :validate => :boolean, :default => false, :deprecated => 'This option will be removed in the future as beats determine the event schema'
|
94
|
-
|
95
94
|
# By default the server doesn't do any client verification.
|
96
95
|
#
|
97
96
|
# `peer` will make the server ask the client to provide a certificate.
|
@@ -112,22 +111,31 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
112
111
|
# Time in milliseconds for an incomplete ssl handshake to timeout
|
113
112
|
config :ssl_handshake_timeout, :validate => :number, :default => 10000
|
114
113
|
|
115
|
-
|
116
|
-
|
117
|
-
config :tls_min_version, :validate => :number, :default => TLS.min.version
|
114
|
+
config :ssl_cipher_suites, :validate => SslContextBuilder::SUPPORTED_CIPHERS.to_a,
|
115
|
+
:default => SslContextBuilder.getDefaultCiphers, :list => true
|
118
116
|
|
119
|
-
|
120
|
-
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2
|
121
|
-
config :tls_max_version, :validate => :number, :default => TLS.max.version
|
117
|
+
config :ssl_supported_protocols, :validate => ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], :default => ['TLSv1.2', 'TLSv1.3'], :list => true
|
122
118
|
|
123
|
-
# The list of ciphers suite to use, listed by priorities.
|
124
|
-
config :cipher_suites, :validate => :array, :default => org.logstash.netty.SslContextBuilder.getDefaultCiphers
|
125
119
|
# Close Idle clients after X seconds of inactivity.
|
126
120
|
config :client_inactivity_timeout, :validate => :number, :default => 60
|
127
121
|
|
128
122
|
# Beats handler executor thread
|
129
123
|
config :executor_threads, :validate => :number, :default => LogStash::Config::CpuCoreStrategy.maximum
|
130
124
|
|
125
|
+
# Flag to determine whether to add host information (provided by the beat in the 'hostname' field) to the event
|
126
|
+
config :add_hostname, :validate => :boolean, :default => false, :deprecated => 'This option will be removed in the future as beats determine the event schema'
|
127
|
+
|
128
|
+
# The list of ciphers suite to use, listed by priorities.
|
129
|
+
config :cipher_suites, :validate => :array, :default => [], :deprecated => "Set 'ssl_cipher_suites' instead."
|
130
|
+
|
131
|
+
# The minimum TLS version allowed for the encrypted connections. The value must be one of the following:
|
132
|
+
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2
|
133
|
+
config :tls_min_version, :validate => :number, :default => TLS.min.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
134
|
+
|
135
|
+
# The maximum TLS version allowed for the encrypted connections. The value must be the one of the following:
|
136
|
+
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2
|
137
|
+
config :tls_max_version, :validate => :number, :default => TLS.max.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
138
|
+
|
131
139
|
attr_reader :field_hostname, :field_hostip
|
132
140
|
attr_reader :field_tls_protocol_version, :field_tls_peer_subject, :field_tls_cipher
|
133
141
|
|
@@ -156,6 +164,26 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
156
164
|
if client_authentication_metadata? && !require_certificate_authorities?
|
157
165
|
configuration_error "Configuring ssl_peer_metadata => true requires ssl_verify_mode => to be configured with 'peer' or 'force_peer'"
|
158
166
|
end
|
167
|
+
|
168
|
+
if original_params.key?('cipher_suites') && original_params.key?('ssl_cipher_suites')
|
169
|
+
raise LogStash::ConfigurationError, "Both `ssl_cipher_suites` and (deprecated) `cipher_suites` were set. Use only `ssl_cipher_suites`."
|
170
|
+
elsif original_params.key?('cipher_suites')
|
171
|
+
@ssl_cipher_suites_final = @cipher_suites
|
172
|
+
else
|
173
|
+
@ssl_cipher_suites_final = @ssl_cipher_suites
|
174
|
+
end
|
175
|
+
|
176
|
+
if original_params.key?('tls_min_version') && original_params.key?('ssl_supported_protocols')
|
177
|
+
raise LogStash::ConfigurationError, "Both `ssl_supported_protocols` and (deprecated) `tls_min_ciphers` were set. Use only `ssl_supported_protocols`."
|
178
|
+
elsif original_params.key?('tls_max_version') && original_params.key?('ssl_supported_protocols')
|
179
|
+
raise LogStash::ConfigurationError, "Both `ssl_supported_protocols` and (deprecated) `tls_max_ciphers` were set. Use only `ssl_supported_protocols`."
|
180
|
+
else
|
181
|
+
if original_params.key?('tls_min_version') || original_params.key?('tls_max_version')
|
182
|
+
@ssl_supported_protocols_final = TLS.get_supported(tls_min_version..tls_max_version).map(&:name)
|
183
|
+
else
|
184
|
+
@ssl_supported_protocols_final = @ssl_supported_protocols
|
185
|
+
end
|
186
|
+
end
|
159
187
|
else
|
160
188
|
@logger.warn("configured ssl_certificate => #{@ssl_certificate.inspect} will not be used") if @ssl_certificate
|
161
189
|
@logger.warn("configured ssl_key => #{@ssl_key.inspect} will not be used") if @ssl_key
|
@@ -184,9 +212,9 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
184
212
|
ssl_context_builder = new_ssl_context_builder
|
185
213
|
if client_authentification?
|
186
214
|
if @ssl_verify_mode == "force_peer"
|
187
|
-
ssl_context_builder.setVerifyMode(
|
215
|
+
ssl_context_builder.setVerifyMode(SslContextBuilder::SslClientVerifyMode::FORCE_PEER)
|
188
216
|
elsif @ssl_verify_mode == "peer"
|
189
|
-
ssl_context_builder.setVerifyMode(
|
217
|
+
ssl_context_builder.setVerifyMode(SslContextBuilder::SslClientVerifyMode::VERIFY_PEER)
|
190
218
|
end
|
191
219
|
ssl_context_builder.setCertificateAuthorities(@ssl_certificate_authorities)
|
192
220
|
end
|
@@ -247,20 +275,16 @@ class LogStash::Inputs::Beats < LogStash::Inputs::Base
|
|
247
275
|
passphrase = @ssl_key_passphrase.nil? ? nil : @ssl_key_passphrase.value
|
248
276
|
begin
|
249
277
|
org.logstash.netty.SslContextBuilder.new(@ssl_certificate, @ssl_key, passphrase)
|
250
|
-
.setProtocols(
|
251
|
-
.setCipherSuites(
|
278
|
+
.setProtocols(@ssl_supported_protocols_final)
|
279
|
+
.setCipherSuites(normalized_cipher_suites)
|
252
280
|
rescue java.lang.IllegalArgumentException => e
|
253
281
|
@logger.error("SSL configuration invalid", error_details(e))
|
254
282
|
raise LogStash::ConfigurationError, e
|
255
283
|
end
|
256
284
|
end
|
257
285
|
|
258
|
-
def
|
259
|
-
@
|
260
|
-
end
|
261
|
-
|
262
|
-
def convert_protocols
|
263
|
-
TLS.get_supported(@tls_min_version..@tls_max_version).map(&:name)
|
286
|
+
def normalized_cipher_suites
|
287
|
+
@ssl_cipher_suites_final.map(&:upcase)
|
264
288
|
end
|
265
289
|
|
266
290
|
def configuration_error(message)
|
@@ -7,4 +7,4 @@ require_jar('com.fasterxml.jackson.core', 'jackson-core', '2.9.10')
|
|
7
7
|
require_jar('com.fasterxml.jackson.core', 'jackson-annotations', '2.9.10')
|
8
8
|
require_jar('com.fasterxml.jackson.core', 'jackson-databind', '2.9.10.8')
|
9
9
|
require_jar('com.fasterxml.jackson.module', 'jackson-module-afterburner', '2.9.10')
|
10
|
-
require_jar('org.logstash.beats', 'logstash-input-beats', '6.
|
10
|
+
require_jar('org.logstash.beats', 'logstash-input-beats', '6.4.1')
|
data/spec/inputs/beats_spec.rb
CHANGED
@@ -47,6 +47,9 @@ describe LogStash::Inputs::Beats do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
context "with ssl enabled" do
|
50
|
+
|
51
|
+
let(:config) { { "ssl" => true, "port" => port, "ssl_key" => certificate.ssl_key, "ssl_certificate" => certificate.ssl_cert } }
|
52
|
+
|
50
53
|
context "without certificate configuration" do
|
51
54
|
let(:config) { { "port" => 0, "ssl" => true, "ssl_key" => certificate.ssl_key, "type" => "example" } }
|
52
55
|
|
@@ -78,7 +81,7 @@ describe LogStash::Inputs::Beats do
|
|
78
81
|
end
|
79
82
|
|
80
83
|
context "with invalid ciphers" do
|
81
|
-
let(:config) { super().merge("
|
84
|
+
let(:config) { super().merge("cipher_suites" => "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA38") }
|
82
85
|
|
83
86
|
it "should raise a configuration error" do
|
84
87
|
plugin = LogStash::Inputs::Beats.new(config)
|
@@ -92,7 +95,7 @@ describe LogStash::Inputs::Beats do
|
|
92
95
|
|
93
96
|
context "verify_mode" do
|
94
97
|
context "verify_mode configured to PEER" do
|
95
|
-
let(:config) { super().merge("
|
98
|
+
let(:config) { super().merge("ssl_verify_mode" => "peer") }
|
96
99
|
|
97
100
|
it "raise a ConfigurationError when certificate_authorities is not set" do
|
98
101
|
plugin = LogStash::Inputs::Beats.new(config)
|
@@ -107,7 +110,7 @@ describe LogStash::Inputs::Beats do
|
|
107
110
|
end
|
108
111
|
|
109
112
|
context "verify_mode configured to FORCE_PEER" do
|
110
|
-
let(:config) { super().merge("
|
113
|
+
let(:config) { super().merge("ssl_verify_mode" => "force_peer") }
|
111
114
|
|
112
115
|
it "raise a ConfigurationError when certificate_authorities is not set" do
|
113
116
|
plugin = LogStash::Inputs::Beats.new(config)
|
@@ -120,6 +123,40 @@ describe LogStash::Inputs::Beats do
|
|
120
123
|
expect {plugin.register}.not_to raise_error
|
121
124
|
end
|
122
125
|
end
|
126
|
+
|
127
|
+
context "with ssl_cipher_suites and cipher_suites set" do
|
128
|
+
let(:config) do
|
129
|
+
super().merge('ssl_cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'],
|
130
|
+
'cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'])
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should raise a configuration error" do
|
134
|
+
plugin = LogStash::Inputs::Beats.new(config)
|
135
|
+
expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_cipher_suites.?/i
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context "with ssl_supported_protocols and tls_min_version set" do
|
140
|
+
let(:config) do
|
141
|
+
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_min_version' => 1.2)
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should raise a configuration error" do
|
145
|
+
plugin = LogStash::Inputs::Beats.new(config)
|
146
|
+
expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
context "with ssl_supported_protocols and tls_max_version set" do
|
151
|
+
let(:config) do
|
152
|
+
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_max_version' => 1.2)
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should raise a configuration error" do
|
156
|
+
plugin = LogStash::Inputs::Beats.new(config)
|
157
|
+
expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
158
|
+
end
|
159
|
+
end
|
123
160
|
end
|
124
161
|
end
|
125
162
|
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-beats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.4.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,7 +298,7 @@ files:
|
|
298
298
|
- vendor/jar-dependencies/com/fasterxml/jackson/module/jackson-module-afterburner/2.9.10/jackson-module-afterburner-2.9.10.jar
|
299
299
|
- vendor/jar-dependencies/io/netty/netty-all/4.1.65.Final/netty-all-4.1.65.Final.jar
|
300
300
|
- vendor/jar-dependencies/org/javassist/javassist/3.24.0-GA/javassist-3.24.0-GA.jar
|
301
|
-
- vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.
|
301
|
+
- vendor/jar-dependencies/org/logstash/beats/logstash-input-beats/6.4.1/logstash-input-beats-6.4.1.jar
|
302
302
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
303
303
|
licenses:
|
304
304
|
- Apache License (2.0)
|