logstash-input-http 3.5.1-java → 3.6.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 +6 -0
- data/VERSION +1 -1
- data/docs/index.asciidoc +46 -30
- data/lib/logstash/inputs/http.rb +50 -28
- data/lib/logstash-input-http_jars.rb +8 -2
- data/spec/inputs/http_spec.rb +93 -32
- data/vendor/jar-dependencies/io/netty/netty-buffer/4.1.87.Final/netty-buffer-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-codec/4.1.87.Final/netty-codec-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-codec-http/4.1.87.Final/netty-codec-http-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-common/4.1.87.Final/netty-common-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-handler/4.1.87.Final/netty-handler-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-transport/4.1.87.Final/netty-transport-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.87.Final/netty-transport-native-unix-common-4.1.87.Final.jar +0 -0
- data/vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/{3.5.1/logstash-input-http-3.5.1.jar → 3.6.1/logstash-input-http-3.6.1.jar} +0 -0
- metadata +10 -4
- data/vendor/jar-dependencies/io/netty/netty-all/4.1.65.Final/netty-all-4.1.65.Final.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: bbb47f975f16beea81522f5307114560f5d6005218d3c246dfb62db54208c817
|
|
4
|
+
data.tar.gz: 47dc0325473f1d9c8a99b427f7b695c99cfc8f5c4f35b2e88df6fbd0d0ef67d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55f0a67b04f6c5f159433df787cfd9e93a5f42414452889e486fedeb3bd53f57b1074645fdefd19a763625ca294bca89a39496ae89c5bc105c9bafb22f5382c1
|
|
7
|
+
data.tar.gz: b9b9afe52a6155ae774b98f7c615d699d4ad1e297d7e61a8de99d9e83b87e33bd94264df27737196bfcd7894e2e9f98a20629c2bf39802e4d950415073933ce6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 3.6.1
|
|
2
|
+
- Update Netty dependency to 4.1.87 [#162](https://github.com/logstash-plugins/logstash-input-http/pull/162)
|
|
3
|
+
|
|
4
|
+
## 3.6.0
|
|
5
|
+
- Feat: review and deprecate ssl protocol/cipher related settings [#151](https://github.com/logstash-plugins/logstash-input-http/pull/151)
|
|
6
|
+
|
|
1
7
|
## 3.5.1
|
|
2
8
|
- Fix: codecs provided with `additional_codecs` now correctly run in the pipeline's context, which means that they respect the `pipeline.ecs_compatibility` setting [#152](https://github.com/logstash-plugins/logstash-input-http/pull/152)
|
|
3
9
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.6.1
|
data/docs/index.asciidoc
CHANGED
|
@@ -91,11 +91,11 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
|
91
91
|
|=======================================================================
|
|
92
92
|
|Setting |Input type|Required
|
|
93
93
|
| <<plugins-{type}s-{plugin}-additional_codecs>> |<<hash,hash>>|No
|
|
94
|
-
| <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|
|
|
94
|
+
| <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|__Deprecated__
|
|
95
95
|
| <<plugins-{type}s-{plugin}-ecs_compatibility>> | <<string,string>>|No
|
|
96
96
|
| <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
|
|
97
|
-
| <<plugins-{type}s-{plugin}-keystore>> |<<path,path>>|
|
|
98
|
-
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|
|
|
97
|
+
| <<plugins-{type}s-{plugin}-keystore>> |<<path,path>>|__Deprecated__
|
|
98
|
+
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|__Deprecated__
|
|
99
99
|
| <<plugins-{type}s-{plugin}-password>> |<<password,password>>|No
|
|
100
100
|
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
|
|
101
101
|
| <<plugins-{type}s-{plugin}-max_pending_requests>> |<<number,number>>|No
|
|
@@ -104,15 +104,17 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
|
104
104
|
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|No
|
|
105
105
|
| <<plugins-{type}s-{plugin}-ssl_certificate>> |a valid filesystem path|No
|
|
106
106
|
| <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> |<<array,array>>|No
|
|
107
|
+
| <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |<<array,array>>|No
|
|
107
108
|
| <<plugins-{type}s-{plugin}-ssl_handshake_timeout>> |<<number,number>>|No
|
|
108
109
|
| <<plugins-{type}s-{plugin}-ssl_key>> |a valid filesystem path|No
|
|
109
110
|
| <<plugins-{type}s-{plugin}-ssl_key_passphrase>> |<<password,password>>|No
|
|
111
|
+
| <<plugins-{type}s-{plugin}-ssl_supported_protocols>> |<<array,array>>|No
|
|
110
112
|
| <<plugins-{type}s-{plugin}-ssl_verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|No
|
|
111
113
|
| <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
|
|
112
|
-
| <<plugins-{type}s-{plugin}-tls_max_version>> |<<number,number>>|
|
|
113
|
-
| <<plugins-{type}s-{plugin}-tls_min_version>> |<<number,number>>|
|
|
114
|
+
| <<plugins-{type}s-{plugin}-tls_max_version>> |<<number,number>>|__Deprecated__
|
|
115
|
+
| <<plugins-{type}s-{plugin}-tls_min_version>> |<<number,number>>|__Deprecated__
|
|
114
116
|
| <<plugins-{type}s-{plugin}-user>> |<<string,string>>|No
|
|
115
|
-
| <<plugins-{type}s-{plugin}-verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|
|
|
117
|
+
| <<plugins-{type}s-{plugin}-verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|__Deprecated__
|
|
116
118
|
|=======================================================================
|
|
117
119
|
|
|
118
120
|
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
|
@@ -132,29 +134,24 @@ and no codec for the request's content-type is found
|
|
|
132
134
|
|
|
133
135
|
[id="plugins-{type}s-{plugin}-cipher_suites"]
|
|
134
136
|
===== `cipher_suites`
|
|
137
|
+
deprecated[3.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_cipher_suites>>]
|
|
135
138
|
|
|
136
139
|
* Value type is <<array,array>>
|
|
137
|
-
* Default value is `[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]`
|
|
138
140
|
|
|
139
141
|
The list of cipher suites to use, listed by priorities.
|
|
140
|
-
This default list applies for OpenJDK 11.0.14 and higher.
|
|
141
|
-
For older JDK versions, the default list includes only suites supported by that version.
|
|
142
|
-
For example, the ChaCha20 family of ciphers is not supported in older versions.
|
|
143
142
|
|
|
144
143
|
[id="plugins-{type}s-{plugin}-ecs_compatibility"]
|
|
145
144
|
===== `ecs_compatibility`
|
|
146
145
|
|
|
147
|
-
* Value type is <<string,string>>
|
|
148
|
-
* Supported values are:
|
|
149
|
-
** `disabled`: unstructured connection metadata added at root level
|
|
150
|
-
** `v1`,`v8`: headers added under `[@metadata][http][header]`. Some are copied to structured ECS fields `http`, `url`, `user_agent` and `host`
|
|
146
|
+
* Value type is <<string,string>>
|
|
147
|
+
* Supported values are:
|
|
148
|
+
** `disabled`: unstructured connection metadata added at root level
|
|
149
|
+
** `v1`,`v8`: headers added under `[@metadata][http][header]`. Some are copied to structured ECS fields `http`, `url`, `user_agent` and `host`
|
|
151
150
|
|
|
152
151
|
Controls this plugin's compatibility with the
|
|
153
152
|
{ecs-ref}[Elastic Common Schema (ECS)].
|
|
154
153
|
See <<plugins-{type}s-{plugin}-ecs_metadata>> for detailed information.
|
|
155
154
|
|
|
156
|
-
Example output:
|
|
157
|
-
|
|
158
155
|
**Sample output: ECS disabled**
|
|
159
156
|
[source,text]
|
|
160
157
|
-----
|
|
@@ -217,28 +214,22 @@ The host or ip to bind
|
|
|
217
214
|
|
|
218
215
|
[id="plugins-{type}s-{plugin}-keystore"]
|
|
219
216
|
===== `keystore`
|
|
217
|
+
deprecated[3.1.0, Use <<plugins-{type}s-{plugin}-ssl_certificate>> and <<plugins-{type}s-{plugin}-ssl_key>> instead]
|
|
220
218
|
|
|
221
219
|
* Value type is <<path,path>>
|
|
222
220
|
* There is no default value for this setting.
|
|
223
|
-
* This option is deprecated
|
|
224
221
|
|
|
225
222
|
The JKS keystore to validate the client's certificates
|
|
226
223
|
|
|
227
|
-
Note: This option is deprecated and it will be removed in the next major version of Logstash.
|
|
228
|
-
Use `ssl_certificate` and `ssl_key` instead.
|
|
229
|
-
|
|
230
224
|
[id="plugins-{type}s-{plugin}-keystore_password"]
|
|
231
225
|
===== `keystore_password`
|
|
226
|
+
deprecated[3.1.0, Use <<plugins-{type}s-{plugin}-ssl_certificate>> and <<plugins-{type}s-{plugin}-ssl_key>> instead]
|
|
232
227
|
|
|
233
228
|
* Value type is <<password,password>>
|
|
234
229
|
* There is no default value for this setting.
|
|
235
|
-
* This option is deprecated
|
|
236
230
|
|
|
237
231
|
Set the truststore password
|
|
238
232
|
|
|
239
|
-
Note: This option is deprecated and it will be removed in the next major version of Logstash.
|
|
240
|
-
Use `ssl_certificate` and `ssl_key` instead.
|
|
241
|
-
|
|
242
233
|
[id="plugins-{type}s-{plugin}-password"]
|
|
243
234
|
===== `password`
|
|
244
235
|
|
|
@@ -345,6 +336,17 @@ be read and added to the trust store. You need to configure the `ssl_verify_mode
|
|
|
345
336
|
to `peer` or `force_peer` to enable the verification.
|
|
346
337
|
|
|
347
338
|
|
|
339
|
+
[id="plugins-{type}s-{plugin}-ssl_cipher_suites"]
|
|
340
|
+
===== `ssl_cipher_suites`
|
|
341
|
+
|
|
342
|
+
* Value type is <<array,array>>
|
|
343
|
+
* 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']`
|
|
344
|
+
|
|
345
|
+
The list of cipher suites to use, listed by priorities.
|
|
346
|
+
This default list applies for OpenJDK 11.0.14 and higher.
|
|
347
|
+
For older JDK versions, the default list includes only suites supported by that version.
|
|
348
|
+
For example, the ChaCha20 family of ciphers is not supported in older versions.
|
|
349
|
+
|
|
348
350
|
[id="plugins-{type}s-{plugin}-ssl_handshake_timeout"]
|
|
349
351
|
===== `ssl_handshake_timeout`
|
|
350
352
|
|
|
@@ -371,6 +373,23 @@ for more information.
|
|
|
371
373
|
|
|
372
374
|
SSL key passphrase to use.
|
|
373
375
|
|
|
376
|
+
[id="plugins-{type}s-{plugin}-ssl_supported_protocols"]
|
|
377
|
+
===== `ssl_supported_protocols`
|
|
378
|
+
|
|
379
|
+
* Value type is <<array,array>>
|
|
380
|
+
* Allowed values are: `'TLSv1.1'`, `'TLSv1.2'`, `'TLSv1.3'`
|
|
381
|
+
* Default depends on the JDK being used. With up-to-date Logstash, the default is `['TLSv1.2', 'TLSv1.3']`.
|
|
382
|
+
`'TLSv1.1'` is not considered secure and is only provided for legacy applications.
|
|
383
|
+
|
|
384
|
+
List of allowed SSL/TLS versions to use when establishing a connection to the HTTP endpoint.
|
|
385
|
+
|
|
386
|
+
For Java 8 `'TLSv1.3'` is supported only since **8u262** (AdoptOpenJDK), but requires that you set the
|
|
387
|
+
`LS_JAVA_OPTS="-Djdk.tls.client.protocols=TLSv1.3"` system property in Logstash.
|
|
388
|
+
|
|
389
|
+
NOTE: If you configure the plugin to use `'TLSv1.1'` on any recent JVM, such as the one packaged with Logstash,
|
|
390
|
+
the protocol is disabled by default and needs to be enabled manually by changing `jdk.tls.disabledAlgorithms` in
|
|
391
|
+
the *$JDK_HOME/conf/security/java.security* configuration file. That is, `TLSv1.1` needs to be removed from the list.
|
|
392
|
+
|
|
374
393
|
[id="plugins-{type}s-{plugin}-ssl_verify_mode"]
|
|
375
394
|
===== `ssl_verify_mode`
|
|
376
395
|
|
|
@@ -397,18 +416,18 @@ Number of threads to use for both accepting connections and handling requests
|
|
|
397
416
|
|
|
398
417
|
[id="plugins-{type}s-{plugin}-tls_max_version"]
|
|
399
418
|
===== `tls_max_version`
|
|
419
|
+
deprecated[3.6.0]
|
|
400
420
|
|
|
401
421
|
* Value type is <<number,number>>
|
|
402
|
-
* Default value is `1.3`
|
|
403
422
|
|
|
404
423
|
The maximum TLS version allowed for the encrypted connections.
|
|
405
424
|
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
|
|
406
425
|
|
|
407
426
|
[id="plugins-{type}s-{plugin}-tls_min_version"]
|
|
408
427
|
===== `tls_min_version`
|
|
428
|
+
deprecated[3.6.0]
|
|
409
429
|
|
|
410
430
|
* Value type is <<number,number>>
|
|
411
|
-
* Default value is `1.2`
|
|
412
431
|
|
|
413
432
|
The minimum TLS version allowed for the encrypted connections.
|
|
414
433
|
The value must be one of the following: 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLSv1.3
|
|
@@ -423,16 +442,13 @@ Username for basic authorization
|
|
|
423
442
|
|
|
424
443
|
[id="plugins-{type}s-{plugin}-verify_mode"]
|
|
425
444
|
===== `verify_mode`
|
|
445
|
+
deprecated[3.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_verify_mode>>]
|
|
426
446
|
|
|
427
447
|
* Value can be any of: `none`, `peer`, `force_peer`
|
|
428
448
|
* Default value is `"none"`
|
|
429
|
-
* This option is deprecated
|
|
430
449
|
|
|
431
450
|
Set the client certificate verification method. Valid methods: none, peer, force_peer
|
|
432
451
|
|
|
433
|
-
Note: This option is deprecated and it will be removed in the next major version of Logstash.
|
|
434
|
-
Use `ssl_verify_mode` instead.
|
|
435
|
-
|
|
436
452
|
|
|
437
453
|
[id="plugins-{type}s-{plugin}-common-options"]
|
|
438
454
|
include::{include_path}/{type}.asciidoc[]
|
data/lib/logstash/inputs/http.rb
CHANGED
|
@@ -30,6 +30,7 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
30
30
|
require "logstash/inputs/http/tls"
|
|
31
31
|
|
|
32
32
|
java_import "io.netty.handler.codec.http.HttpUtil"
|
|
33
|
+
java_import 'org.logstash.plugins.inputs.http.util.SslSimpleBuilder'
|
|
33
34
|
|
|
34
35
|
config_name "http"
|
|
35
36
|
|
|
@@ -86,16 +87,11 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
86
87
|
# Time in milliseconds for an incomplete ssl handshake to timeout
|
|
87
88
|
config :ssl_handshake_timeout, :validate => :number, :default => 10000
|
|
88
89
|
|
|
89
|
-
# The minimum TLS version allowed for the encrypted connections. The value must be one of the following:
|
|
90
|
-
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
91
|
-
config :tls_min_version, :validate => :number, :default => TLS.min.version
|
|
92
|
-
|
|
93
|
-
# The maximum TLS version allowed for the encrypted connections. The value must be the one of the following:
|
|
94
|
-
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
95
|
-
config :tls_max_version, :validate => :number, :default => TLS.max.version
|
|
96
|
-
|
|
97
90
|
# The list of ciphers suite to use, listed by priorities.
|
|
98
|
-
config :
|
|
91
|
+
config :ssl_cipher_suites, :validate => SslSimpleBuilder::SUPPORTED_CIPHERS.to_a,
|
|
92
|
+
:default => SslSimpleBuilder.getDefaultCiphers, :list => true
|
|
93
|
+
|
|
94
|
+
config :ssl_supported_protocols, :validate => ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], :default => ['TLSv1.2', 'TLSv1.3'], :list => true
|
|
99
95
|
|
|
100
96
|
# Apply specific codecs for specific content types.
|
|
101
97
|
# The default codec will be applied only after this list is checked
|
|
@@ -118,14 +114,23 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
118
114
|
config :max_content_length, :validate => :number, :required => false, :default => 100 * 1024 * 1024
|
|
119
115
|
|
|
120
116
|
config :response_code, :validate => [200, 201, 202, 204], :default => 200
|
|
117
|
+
|
|
121
118
|
# Deprecated options
|
|
122
119
|
|
|
123
120
|
# The JKS keystore to validate the client's certificates
|
|
124
121
|
config :keystore, :validate => :path, :deprecated => "Set 'ssl_certificate' and 'ssl_key' instead."
|
|
125
122
|
config :keystore_password, :validate => :password, :deprecated => "Set 'ssl_key_passphrase' instead."
|
|
126
123
|
|
|
127
|
-
config :verify_mode, :validate => ['none', 'peer', 'force_peer'], :default => 'none',
|
|
128
|
-
|
|
124
|
+
config :verify_mode, :validate => ['none', 'peer', 'force_peer'], :default => 'none', :deprecated => "Set 'ssl_verify_mode' instead."
|
|
125
|
+
config :cipher_suites, :validate => :array, :default => [], :deprecated => "Set 'ssl_cipher_suites' instead."
|
|
126
|
+
|
|
127
|
+
# The minimum TLS version allowed for the encrypted connections. The value must be one of the following:
|
|
128
|
+
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
129
|
+
config :tls_min_version, :validate => :number, :default => TLS.min.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
|
130
|
+
|
|
131
|
+
# The maximum TLS version allowed for the encrypted connections. The value must be the one of the following:
|
|
132
|
+
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
133
|
+
config :tls_max_version, :validate => :number, :default => TLS.max.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
|
129
134
|
|
|
130
135
|
attr_reader :codecs
|
|
131
136
|
|
|
@@ -233,24 +238,45 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
233
238
|
@logger.warn("SSL Certificate will not be used") if @ssl_certificate
|
|
234
239
|
@logger.warn("SSL Key will not be used") if @ssl_key
|
|
235
240
|
@logger.warn("SSL Java Key Store will not be used") if @keystore
|
|
236
|
-
|
|
241
|
+
return # code bellow assumes `ssl => true`
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
if !(ssl_key_configured? || ssl_jks_configured?)
|
|
237
245
|
raise LogStash::ConfigurationError, "Certificate or JKS must be configured"
|
|
238
246
|
end
|
|
239
247
|
|
|
240
|
-
if
|
|
241
|
-
|
|
248
|
+
if original_params.key?("verify_mode") && original_params.key?("ssl_verify_mode")
|
|
249
|
+
raise LogStash::ConfigurationError, "Both `ssl_verify_mode` and (deprecated) `verify_mode` were set. Use only `ssl_verify_mode`."
|
|
242
250
|
elsif original_params.key?("verify_mode")
|
|
243
251
|
@ssl_verify_mode_final = @verify_mode
|
|
244
|
-
elsif original_params.key?("ssl_verify_mode")
|
|
245
|
-
@ssl_verify_mode_final = @ssl_verify_mode
|
|
246
252
|
else
|
|
247
253
|
@ssl_verify_mode_final = @ssl_verify_mode
|
|
248
254
|
end
|
|
249
255
|
|
|
250
|
-
if
|
|
251
|
-
raise LogStash::ConfigurationError, "
|
|
252
|
-
elsif
|
|
253
|
-
|
|
256
|
+
if original_params.key?('cipher_suites') && original_params.key?('ssl_cipher_suites')
|
|
257
|
+
raise LogStash::ConfigurationError, "Both `ssl_cipher_suites` and (deprecated) `cipher_suites` were set. Use only `ssl_cipher_suites`."
|
|
258
|
+
elsif original_params.key?('cipher_suites')
|
|
259
|
+
@ssl_cipher_suites_final = @cipher_suites
|
|
260
|
+
else
|
|
261
|
+
@ssl_cipher_suites_final = @ssl_cipher_suites
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
if original_params.key?('tls_min_version') && original_params.key?('ssl_supported_protocols')
|
|
265
|
+
raise LogStash::ConfigurationError, "Both `ssl_supported_protocols` and (deprecated) `tls_min_ciphers` were set. Use only `ssl_supported_protocols`."
|
|
266
|
+
elsif original_params.key?('tls_max_version') && original_params.key?('ssl_supported_protocols')
|
|
267
|
+
raise LogStash::ConfigurationError, "Both `ssl_supported_protocols` and (deprecated) `tls_max_ciphers` were set. Use only `ssl_supported_protocols`."
|
|
268
|
+
else
|
|
269
|
+
if original_params.key?('tls_min_version') || original_params.key?('tls_max_version')
|
|
270
|
+
@ssl_supported_protocols_final = TLS.get_supported(tls_min_version..tls_max_version).map(&:name)
|
|
271
|
+
else
|
|
272
|
+
@ssl_supported_protocols_final = @ssl_supported_protocols
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
if require_certificate_authorities? && !client_authentication?
|
|
277
|
+
raise LogStash::ConfigurationError, "Using `ssl_verify_mode` (or `verify_mode`) set to PEER or FORCE_PEER, requires the configuration of `ssl_certificate_authorities`"
|
|
278
|
+
elsif !require_certificate_authorities? && client_authentication?
|
|
279
|
+
raise LogStash::ConfigurationError, "The configuration of `ssl_certificate_authorities` requires setting `ssl_verify_mode` (or `verify_mode`) to PEER or FORCE_PEER"
|
|
254
280
|
end
|
|
255
281
|
end
|
|
256
282
|
|
|
@@ -268,7 +294,7 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
268
294
|
begin
|
|
269
295
|
ssl_builder = org.logstash.plugins.inputs.http.util.SslSimpleBuilder
|
|
270
296
|
.new(@ssl_certificate, @ssl_key, @ssl_key_passphrase.nil? ? nil : @ssl_key_passphrase.value)
|
|
271
|
-
.setCipherSuites(
|
|
297
|
+
.setCipherSuites(normalized_cipher_suites)
|
|
272
298
|
rescue java.lang.IllegalArgumentException => e
|
|
273
299
|
@logger.error("SSL configuration invalid", error_details(e))
|
|
274
300
|
raise LogStash::ConfigurationError, e
|
|
@@ -300,19 +326,15 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
300
326
|
|
|
301
327
|
private
|
|
302
328
|
|
|
303
|
-
def
|
|
304
|
-
@
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
def convert_protocols
|
|
308
|
-
TLS.get_supported(@tls_min_version..@tls_max_version).map(&:name)
|
|
329
|
+
def normalized_cipher_suites
|
|
330
|
+
@ssl_cipher_suites_final.map(&:upcase)
|
|
309
331
|
end
|
|
310
332
|
|
|
311
333
|
def new_ssl_handshake_provider(ssl_builder)
|
|
312
334
|
begin
|
|
313
335
|
ssl_handler_provider = org.logstash.plugins.inputs.http.util.SslHandlerProvider.new(ssl_builder.build())
|
|
314
336
|
ssl_handler_provider.setVerifyMode(@ssl_verify_mode_final.upcase)
|
|
315
|
-
ssl_handler_provider.setProtocols(
|
|
337
|
+
ssl_handler_provider.setProtocols(@ssl_supported_protocols_final)
|
|
316
338
|
ssl_handler_provider.setHandshakeTimeoutMilliseconds(@ssl_handshake_timeout)
|
|
317
339
|
ssl_handler_provider
|
|
318
340
|
rescue java.lang.IllegalArgumentException => e
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
require 'jar_dependencies'
|
|
4
|
-
require_jar('io.netty', 'netty-
|
|
5
|
-
require_jar('
|
|
4
|
+
require_jar('io.netty', 'netty-buffer', '4.1.87.Final')
|
|
5
|
+
require_jar('io.netty', 'netty-codec', '4.1.87.Final')
|
|
6
|
+
require_jar('io.netty', 'netty-codec-http', '4.1.87.Final')
|
|
7
|
+
require_jar('io.netty', 'netty-common', '4.1.87.Final')
|
|
8
|
+
require_jar('io.netty', 'netty-transport', '4.1.87.Final')
|
|
9
|
+
require_jar('io.netty', 'netty-handler', '4.1.87.Final')
|
|
10
|
+
require_jar('io.netty', 'netty-transport-native-unix-common', '4.1.87.Final')
|
|
11
|
+
require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.6.1')
|
data/spec/inputs/http_spec.rb
CHANGED
|
@@ -169,10 +169,10 @@ describe LogStash::Inputs::Http do
|
|
|
169
169
|
|
|
170
170
|
let(:config) do
|
|
171
171
|
super().merge 'ssl' => true,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
'ssl_certificate_authorities' => [ File.join(certs_dir, 'root.crt') ],
|
|
173
|
+
'ssl_certificate' => File.join(certs_dir, 'server_from_root.crt'),
|
|
174
|
+
'ssl_key' => File.join(certs_dir, 'server_from_root.key.pkcs8'),
|
|
175
|
+
'ssl_verify_mode' => 'peer'
|
|
176
176
|
end
|
|
177
177
|
|
|
178
178
|
let(:client_options) do
|
|
@@ -219,7 +219,21 @@ describe LogStash::Inputs::Http do
|
|
|
219
219
|
|
|
220
220
|
context 'enforced TLSv1.3 in plugin' do
|
|
221
221
|
|
|
222
|
-
let(:config) { super().merge '
|
|
222
|
+
let(:config) { super().merge 'ssl_supported_protocols' => ['TLSv1.3'],
|
|
223
|
+
'ssl_cipher_suites' => [ 'TLS_AES_128_GCM_SHA256' ] }
|
|
224
|
+
|
|
225
|
+
it "should parse the json body" do
|
|
226
|
+
expect(response.code).to eq(200)
|
|
227
|
+
event = logstash_queue.pop
|
|
228
|
+
expect(event.get("message")).to eq("Hello")
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
context 'enforced TLSv1.3 (deprecated options)' do
|
|
234
|
+
|
|
235
|
+
let(:config) { super().merge 'tls_min_version' => 1.3,
|
|
236
|
+
'cipher_suites' => [ 'TLS_AES_128_GCM_SHA256' ] }
|
|
223
237
|
|
|
224
238
|
it "should parse the json body" do
|
|
225
239
|
expect(response.code).to eq(200)
|
|
@@ -537,6 +551,12 @@ describe LogStash::Inputs::Http do
|
|
|
537
551
|
expect { subject.register }.to raise_exception(LogStash::ConfigurationError)
|
|
538
552
|
end
|
|
539
553
|
end
|
|
554
|
+
context "with invalid cipher suites" do
|
|
555
|
+
it "should raise a configuration error" do
|
|
556
|
+
invalid_config = config.merge("ssl_cipher_suites" => "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA38")
|
|
557
|
+
expect { LogStash::Inputs::Http.new(invalid_config) }.to raise_error(LogStash::ConfigurationError)
|
|
558
|
+
end
|
|
559
|
+
end
|
|
540
560
|
context "with :ssl_certificate" do
|
|
541
561
|
let(:ssc) { SelfSignedCertificate.new }
|
|
542
562
|
let(:ssl_certificate) { ssc.certificate }
|
|
@@ -595,18 +615,6 @@ describe LogStash::Inputs::Http do
|
|
|
595
615
|
end
|
|
596
616
|
end
|
|
597
617
|
|
|
598
|
-
context "with invalid cipher_suites" do
|
|
599
|
-
let(:config) { super().merge("cipher_suites" => "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA38") }
|
|
600
|
-
|
|
601
|
-
it "should raise a configuration error" do
|
|
602
|
-
expect( subject.logger ).to receive(:error) do |msg, opts|
|
|
603
|
-
expect( msg ).to match /.*?configuration invalid/
|
|
604
|
-
expect( opts[:message] ).to match /TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA38.*? not available/
|
|
605
|
-
end
|
|
606
|
-
expect { subject.register }.to raise_error(LogStash::ConfigurationError)
|
|
607
|
-
end
|
|
608
|
-
end
|
|
609
|
-
|
|
610
618
|
context "with invalid ssl certificate" do
|
|
611
619
|
before do
|
|
612
620
|
cert = File.readlines path = config["ssl_certificate"]
|
|
@@ -654,9 +662,50 @@ describe LogStash::Inputs::Http do
|
|
|
654
662
|
end
|
|
655
663
|
end
|
|
656
664
|
|
|
665
|
+
context "with both verify_mode options set" do
|
|
666
|
+
let(:config) do
|
|
667
|
+
super().merge('ssl_verify_mode' => 'peer', 'verify_mode' => 'none')
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
it "should raise a configuration error" do
|
|
671
|
+
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_verify_mode.?/i
|
|
672
|
+
end
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
context "with ssl_cipher_suites and cipher_suites set" do
|
|
676
|
+
let(:config) do
|
|
677
|
+
super().merge('ssl_cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'],
|
|
678
|
+
'cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'])
|
|
679
|
+
end
|
|
680
|
+
|
|
681
|
+
it "should raise a configuration error" do
|
|
682
|
+
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_cipher_suites.?/i
|
|
683
|
+
end
|
|
684
|
+
end
|
|
685
|
+
|
|
686
|
+
context "with ssl_supported_protocols and tls_min_version set" do
|
|
687
|
+
let(:config) do
|
|
688
|
+
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_min_version' => 1.0)
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
it "should raise a configuration error" do
|
|
692
|
+
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
|
693
|
+
end
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
context "with ssl_supported_protocols and tls_max_version set" do
|
|
697
|
+
let(:config) do
|
|
698
|
+
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_max_version' => 1.2)
|
|
699
|
+
end
|
|
700
|
+
|
|
701
|
+
it "should raise a configuration error" do
|
|
702
|
+
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
|
703
|
+
end
|
|
704
|
+
end
|
|
705
|
+
|
|
657
706
|
end
|
|
658
707
|
end
|
|
659
|
-
end
|
|
708
|
+
end
|
|
660
709
|
|
|
661
710
|
# If we have a setting called `pipeline.ecs_compatibility`, we need to
|
|
662
711
|
# ensure that our additional_codecs are instantiated with the proper
|
|
@@ -664,19 +713,11 @@ end if false
|
|
|
664
713
|
# respected.
|
|
665
714
|
if LogStash::SETTINGS.registered?('pipeline.ecs_compatibility')
|
|
666
715
|
|
|
667
|
-
def with_setting(name, value, &block)
|
|
668
|
-
setting = LogStash::SETTINGS.get_setting(name)
|
|
669
|
-
was_set, orignial_value = setting.set?, setting.value
|
|
670
|
-
setting.set(value)
|
|
671
|
-
|
|
672
|
-
yield(true)
|
|
673
|
-
|
|
674
|
-
ensure
|
|
675
|
-
was_set ? setting.set(orignial_value) : setting.reset
|
|
676
|
-
end
|
|
677
|
-
|
|
678
716
|
def setting_value_supported?(name, value)
|
|
679
|
-
|
|
717
|
+
setting = ::LogStash::SETTINGS.clone.get_setting(name)
|
|
718
|
+
setting.set(value)
|
|
719
|
+
setting.validate_value
|
|
720
|
+
true
|
|
680
721
|
rescue
|
|
681
722
|
false
|
|
682
723
|
end
|
|
@@ -688,12 +729,32 @@ if LogStash::SETTINGS.registered?('pipeline.ecs_compatibility')
|
|
|
688
729
|
%w(disabled v1 v8).each do |spec|
|
|
689
730
|
if setting_value_supported?('pipeline.ecs_compatibility', spec)
|
|
690
731
|
context "with `pipeline.ecs_compatibility: #{spec}`" do
|
|
691
|
-
|
|
732
|
+
# Override DevUtils's `new_pipeline` default to inject pipeline settings that
|
|
733
|
+
# are different than our global settings, so that we can validate the condition
|
|
734
|
+
# where pipeline settings override global settings.
|
|
735
|
+
def new_pipeline(config_parts, pipeline_id = :main, settings = pipeline_settings)
|
|
736
|
+
super(config_parts, pipeline_id, settings)
|
|
737
|
+
end
|
|
738
|
+
|
|
739
|
+
let(:pipeline_settings) do
|
|
740
|
+
::LogStash::SETTINGS.clone.tap do |s|
|
|
741
|
+
s.set('pipeline.ecs_compatibility', spec)
|
|
742
|
+
end
|
|
743
|
+
end
|
|
692
744
|
|
|
693
745
|
it 'propagates the ecs_compatibility pipeline setting to the additional_codecs' do
|
|
746
|
+
# Ensure plugins pick up pipeline-level setting over the global default.
|
|
747
|
+
aggregate_failures('precondition') do
|
|
748
|
+
expect(::LogStash::SETTINGS).to_not be_set('pipeline.ecs_compatibility')
|
|
749
|
+
expect(pipeline_settings).to be_set('pipeline.ecs_compatibility')
|
|
750
|
+
end
|
|
751
|
+
|
|
694
752
|
input("input { http { port => #{port} additional_codecs => { 'application/json' => 'json' 'text/plain' => 'plain' } } }") do |pipeline, queue|
|
|
695
753
|
http_input = pipeline.inputs.first
|
|
696
|
-
|
|
754
|
+
aggregate_failures('initialization precondition') do
|
|
755
|
+
expect(http_input).to be_a_kind_of(described_class)
|
|
756
|
+
expect(http_input.execution_context&.pipeline&.settings&.to_hash).to eq(pipeline_settings.to_hash)
|
|
757
|
+
end
|
|
697
758
|
|
|
698
759
|
http_input.codecs.each do |key, value|
|
|
699
760
|
aggregate_failures("Codec for `#{key}`") do
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/vendor/jar-dependencies/io/netty/netty-handler/4.1.87.Final/netty-handler-4.1.87.Final.jar
ADDED
|
Binary file
|
data/vendor/jar-dependencies/io/netty/netty-transport/4.1.87.Final/netty-transport-4.1.87.Final.jar
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-input-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.6.1
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -172,8 +172,14 @@ files:
|
|
|
172
172
|
- spec/fixtures/certs/generated/server_from_root.key.pkcs8
|
|
173
173
|
- spec/fixtures/certs/openssl.cnf
|
|
174
174
|
- spec/inputs/http_spec.rb
|
|
175
|
-
- vendor/jar-dependencies/io/netty/netty-
|
|
176
|
-
- vendor/jar-dependencies/
|
|
175
|
+
- vendor/jar-dependencies/io/netty/netty-buffer/4.1.87.Final/netty-buffer-4.1.87.Final.jar
|
|
176
|
+
- vendor/jar-dependencies/io/netty/netty-codec-http/4.1.87.Final/netty-codec-http-4.1.87.Final.jar
|
|
177
|
+
- vendor/jar-dependencies/io/netty/netty-codec/4.1.87.Final/netty-codec-4.1.87.Final.jar
|
|
178
|
+
- vendor/jar-dependencies/io/netty/netty-common/4.1.87.Final/netty-common-4.1.87.Final.jar
|
|
179
|
+
- vendor/jar-dependencies/io/netty/netty-handler/4.1.87.Final/netty-handler-4.1.87.Final.jar
|
|
180
|
+
- vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.87.Final/netty-transport-native-unix-common-4.1.87.Final.jar
|
|
181
|
+
- vendor/jar-dependencies/io/netty/netty-transport/4.1.87.Final/netty-transport-4.1.87.Final.jar
|
|
182
|
+
- vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.6.1/logstash-input-http-3.6.1.jar
|
|
177
183
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
|
178
184
|
licenses:
|
|
179
185
|
- Apache License (2.0)
|