logstash-input-http 3.10.0-java → 4.1.0-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 +17 -0
- data/VERSION +1 -1
- data/docs/index.asciidoc +20 -82
- data/lib/logstash/inputs/http.rb +9 -82
- data/lib/logstash-input-http_jars.rb +1 -1
- data/spec/inputs/http_spec.rb +19 -154
- data/vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/{3.10.0/logstash-input-http-3.10.0.jar → 4.1.0/logstash-input-http-4.1.0.jar} +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe102365f0992c7be2664c393bb5678e17980fe6f66d35d8027a3b2a90d572d9
|
|
4
|
+
data.tar.gz: 52408f65829a38c1737ed7bb06a7b01ec1f1b1038bf36cd1e610d8c490ac723c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eed5f4bde55202f473b37a0743dc4995c675980fdc365c0b0df230ae209477d6e108ecfb028387cc1c57f826cfd38f9c7e295d30f8ebb07a3d0d6c6819790fe2
|
|
7
|
+
data.tar.gz: 7d72588d9a877920e22d37d7870999ea22b81680f0834179bdef3ab0ebac355337285b2db2c58ee97aaa7f3722ecd8f866770cded3660fef5872921e81f0895a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 4.1.0
|
|
2
|
+
- add improved proactive rate-limiting, rejecting new requests when queue has been actively blocking for more than 10 seconds [#186](https://github.com/logstash-plugins/logstash-input-http/pull/186)
|
|
3
|
+
- This is a forward-port of functionality also introduced to the 3.x series in v3.10.0
|
|
4
|
+
|
|
5
|
+
## 4.0.0
|
|
6
|
+
- SSL settings that were marked deprecated in version `3.7.0` are now marked obsolete, and will prevent the plugin from starting.
|
|
7
|
+
- These settings are:
|
|
8
|
+
- `tls_min_version`, which should be replaced by `ssl_supported_protocols`
|
|
9
|
+
- `tls_max_version`, which should be replaced by `ssl_supported_protocols`
|
|
10
|
+
- `cipher_suites`, which should bre replaced by `ssl_cipher_suites`
|
|
11
|
+
- `ssl`, which should bre replaced by `ssl_enabled`
|
|
12
|
+
- `keystore`, which should bre replaced by `ssl_keystore_path`
|
|
13
|
+
- `keystore_password`, which should bre replaced by `ssl_keystore_password`
|
|
14
|
+
- `ssl_verify_mode`, which should bre replaced by `ssl_client_authentication`
|
|
15
|
+
- `verify_mode`, which should bre replaced by `ssl_client_authentication`
|
|
16
|
+
- [#182](https://github.com/logstash-plugins/logstash-input-http/pull/182)
|
|
17
|
+
|
|
1
18
|
## 3.10.0
|
|
2
19
|
- add improved proactive rate-limiting, rejecting new requests when queue has been actively blocking for more than 10 seconds [#179](https://github.com/logstash-plugins/logstash-input-http/pull/179)
|
|
3
20
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.1.0
|
data/docs/index.asciidoc
CHANGED
|
@@ -87,21 +87,21 @@ for the request's content-type is found in the `additional_codecs` setting.
|
|
|
87
87
|
|
|
88
88
|
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
|
89
89
|
|
|
90
|
+
NOTE: As of version `4.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed.
|
|
91
|
+
Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
|
|
92
|
+
|
|
93
|
+
|
|
90
94
|
[cols="<,<,<",options="header",]
|
|
91
95
|
|=======================================================================
|
|
92
96
|
|Setting |Input type|Required
|
|
93
97
|
| <<plugins-{type}s-{plugin}-additional_codecs>> |<<hash,hash>>|No
|
|
94
|
-
| <<plugins-{type}s-{plugin}-cipher_suites>> |<<array,array>>|__Deprecated__
|
|
95
98
|
| <<plugins-{type}s-{plugin}-ecs_compatibility>> | <<string,string>>|No
|
|
96
99
|
| <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
|
|
97
|
-
| <<plugins-{type}s-{plugin}-keystore>> |<<path,path>>|__Deprecated__
|
|
98
|
-
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|__Deprecated__
|
|
99
100
|
| <<plugins-{type}s-{plugin}-password>> |<<password,password>>|No
|
|
100
101
|
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
|
|
101
102
|
| <<plugins-{type}s-{plugin}-max_pending_requests>> |<<number,number>>|No
|
|
102
103
|
| <<plugins-{type}s-{plugin}-response_headers>> |<<hash,hash>>|No
|
|
103
104
|
| <<plugins-{type}s-{plugin}-response_code>> |<<number,number>>, one of `[200, 201, 202, 204]`|No
|
|
104
|
-
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|__Deprecated__
|
|
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
107
|
| <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |<<array,array>>|No
|
|
@@ -117,12 +117,8 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
|
117
117
|
| <<plugins-{type}s-{plugin}-ssl_truststore_password>> |<<password,password>>|No
|
|
118
118
|
| <<plugins-{type}s-{plugin}-ssl_truststore_path>> |<<path,path>>|No
|
|
119
119
|
| <<plugins-{type}s-{plugin}-ssl_truststore_type>> |<<string,string>>|No
|
|
120
|
-
| <<plugins-{type}s-{plugin}-ssl_verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|__Deprecated__
|
|
121
120
|
| <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
|
|
122
|
-
| <<plugins-{type}s-{plugin}-tls_max_version>> |<<number,number>>|__Deprecated__
|
|
123
|
-
| <<plugins-{type}s-{plugin}-tls_min_version>> |<<number,number>>|__Deprecated__
|
|
124
121
|
| <<plugins-{type}s-{plugin}-user>> |<<string,string>>|No
|
|
125
|
-
| <<plugins-{type}s-{plugin}-verify_mode>> |<<string,string>>, one of `["none", "peer", "force_peer"]`|__Deprecated__
|
|
126
122
|
|=======================================================================
|
|
127
123
|
|
|
128
124
|
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
|
@@ -140,13 +136,6 @@ Apply specific codecs for specific content types.
|
|
|
140
136
|
The default codec will be applied only after this list is checked
|
|
141
137
|
and no codec for the request's content-type is found
|
|
142
138
|
|
|
143
|
-
[id="plugins-{type}s-{plugin}-cipher_suites"]
|
|
144
|
-
===== `cipher_suites`
|
|
145
|
-
deprecated[3.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_cipher_suites>>]
|
|
146
|
-
|
|
147
|
-
* Value type is <<array,array>>
|
|
148
|
-
|
|
149
|
-
The list of cipher suites to use, listed by priorities.
|
|
150
139
|
|
|
151
140
|
[id="plugins-{type}s-{plugin}-ecs_compatibility"]
|
|
152
141
|
===== `ecs_compatibility`
|
|
@@ -220,23 +209,6 @@ See <<plugins-{type}s-{plugin}-ecs_metadata>> for detailed information.
|
|
|
220
209
|
|
|
221
210
|
The host or ip to bind
|
|
222
211
|
|
|
223
|
-
[id="plugins-{type}s-{plugin}-keystore"]
|
|
224
|
-
===== `keystore`
|
|
225
|
-
deprecated[3.7.0, Use <<plugins-{type}s-{plugin}-ssl_keystore_path>> instead]
|
|
226
|
-
|
|
227
|
-
* Value type is <<path,path>>
|
|
228
|
-
* There is no default value for this setting.
|
|
229
|
-
|
|
230
|
-
The JKS keystore to validate the client's certificates
|
|
231
|
-
|
|
232
|
-
[id="plugins-{type}s-{plugin}-keystore_password"]
|
|
233
|
-
===== `keystore_password`
|
|
234
|
-
deprecated[3.7.0, Use <<plugins-{type}s-{plugin}-ssl_keystore_password>> instead]
|
|
235
|
-
|
|
236
|
-
* Value type is <<password,password>>
|
|
237
|
-
* There is no default value for this setting.
|
|
238
|
-
|
|
239
|
-
Set the keystore password
|
|
240
212
|
|
|
241
213
|
[id="plugins-{type}s-{plugin}-password"]
|
|
242
214
|
===== `password`
|
|
@@ -314,16 +286,6 @@ specify a target field for the client host of the http request
|
|
|
314
286
|
|
|
315
287
|
specify target field for the client host of the http request
|
|
316
288
|
|
|
317
|
-
[id="plugins-{type}s-{plugin}-ssl"]
|
|
318
|
-
===== `ssl`
|
|
319
|
-
deprecated[3.7.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
|
|
320
|
-
|
|
321
|
-
* Value type is <<boolean,boolean>>
|
|
322
|
-
* Default value is `false`
|
|
323
|
-
|
|
324
|
-
Events are, by default, sent in plain text. You can
|
|
325
|
-
enable encryption by setting `ssl` to true and configuring
|
|
326
|
-
the `ssl_certificate` and `ssl_key` options.
|
|
327
289
|
|
|
328
290
|
[id="plugins-{type}s-{plugin}-ssl_certificate"]
|
|
329
291
|
===== `ssl_certificate`
|
|
@@ -473,22 +435,6 @@ NOTE: You cannot use this setting and <<plugins-{type}s-{plugin}-ssl_certificate
|
|
|
473
435
|
|
|
474
436
|
The format of the truststore file. It must be either `jks` or `pkcs12`.
|
|
475
437
|
|
|
476
|
-
[id="plugins-{type}s-{plugin}-ssl_verify_mode"]
|
|
477
|
-
===== `ssl_verify_mode`
|
|
478
|
-
deprecated[3.7.0, Replaced by <<plugins-{type}s-{plugin}-ssl_client_authentication>>]
|
|
479
|
-
|
|
480
|
-
* Value can be any of: `none`, `peer`, `force_peer`
|
|
481
|
-
* Default value is `"none"`
|
|
482
|
-
|
|
483
|
-
By default the server doesn't do any client verification.
|
|
484
|
-
|
|
485
|
-
`peer` will make the server ask the client to provide a certificate.
|
|
486
|
-
If the client provides a certificate, it will be validated.
|
|
487
|
-
|
|
488
|
-
`force_peer` will make the server ask the client to provide a certificate.
|
|
489
|
-
If the client doesn't provide a certificate, the connection will be closed.
|
|
490
|
-
|
|
491
|
-
This option needs to be used with <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> and a defined list of CAs.
|
|
492
438
|
|
|
493
439
|
[id="plugins-{type}s-{plugin}-threads"]
|
|
494
440
|
===== `threads`
|
|
@@ -498,23 +444,6 @@ This option needs to be used with <<plugins-{type}s-{plugin}-ssl_certificate_aut
|
|
|
498
444
|
|
|
499
445
|
Number of threads to use for both accepting connections and handling requests
|
|
500
446
|
|
|
501
|
-
[id="plugins-{type}s-{plugin}-tls_max_version"]
|
|
502
|
-
===== `tls_max_version`
|
|
503
|
-
deprecated[3.6.0]
|
|
504
|
-
|
|
505
|
-
* Value type is <<number,number>>
|
|
506
|
-
|
|
507
|
-
The maximum TLS version allowed for the encrypted connections.
|
|
508
|
-
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
|
|
509
|
-
|
|
510
|
-
[id="plugins-{type}s-{plugin}-tls_min_version"]
|
|
511
|
-
===== `tls_min_version`
|
|
512
|
-
deprecated[3.6.0]
|
|
513
|
-
|
|
514
|
-
* Value type is <<number,number>>
|
|
515
|
-
|
|
516
|
-
The minimum TLS version allowed for the encrypted connections.
|
|
517
|
-
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
|
|
518
447
|
|
|
519
448
|
[id="plugins-{type}s-{plugin}-user"]
|
|
520
449
|
===== `user`
|
|
@@ -524,15 +453,24 @@ The value must be one of the following: 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 fo
|
|
|
524
453
|
|
|
525
454
|
Username for basic authorization
|
|
526
455
|
|
|
527
|
-
[id="plugins-{type}s-{plugin}-
|
|
528
|
-
|
|
529
|
-
deprecated[3.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_verify_mode>>]
|
|
530
|
-
|
|
531
|
-
* Value can be any of: `none`, `peer`, `force_peer`
|
|
532
|
-
* Default value is `"none"`
|
|
456
|
+
[id="plugins-{type}s-{plugin}-obsolete-options"]
|
|
457
|
+
==== HTTP Input Obsolete Configuration Options
|
|
533
458
|
|
|
534
|
-
|
|
459
|
+
WARNING: As of version `4.0.0` of this plugin, some configuration options have been replaced.
|
|
460
|
+
The plugin will fail to start if it contains any of these obsolete options.
|
|
535
461
|
|
|
462
|
+
[cols="<,<",options="header",]
|
|
463
|
+
|=======================================================================
|
|
464
|
+
|Setting|Replaced by
|
|
465
|
+
| cipher_suites |<<plugins-{type}s-{plugin}-ssl_cipher_suites>>
|
|
466
|
+
| keystore |<<plugins-{type}s-{plugin}-ssl_keystore_path>>
|
|
467
|
+
| keystore_password |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
|
|
468
|
+
| ssl |<<plugins-{type}s-{plugin}-ssl_enabled>>
|
|
469
|
+
| ssl_verify_mode |<<plugins-{type}s-{plugin}-ssl_client_authentication>>
|
|
470
|
+
| tls_max_version |<<plugins-{type}s-{plugin}-ssl_supported_protocols>>
|
|
471
|
+
| tls_min_version |<<plugins-{type}s-{plugin}-ssl_supported_protocols>>
|
|
472
|
+
| verify_mode |<<plugins-{type}s-{plugin}-ssl_client_authentication>>
|
|
473
|
+
|=======================================================================
|
|
536
474
|
|
|
537
475
|
[id="plugins-{type}s-{plugin}-common-options"]
|
|
538
476
|
include::{include_path}/{type}.asciidoc[]
|
data/lib/logstash/inputs/http.rb
CHANGED
|
@@ -55,11 +55,6 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
55
55
|
# Password for basic authorization
|
|
56
56
|
config :password, :validate => :password, :required => false
|
|
57
57
|
|
|
58
|
-
# Events are by default sent in plain text. You can
|
|
59
|
-
# enable encryption by setting `ssl` to true and configuring
|
|
60
|
-
# the `ssl_certificate` and `ssl_key` options.
|
|
61
|
-
config :ssl, :validate => :boolean, :default => false, :deprecated => "Set 'ssl_enabled' instead."
|
|
62
|
-
|
|
63
58
|
# Events are by default sent in plain text. You can
|
|
64
59
|
# enable encryption by setting `ssl` to true and configuring
|
|
65
60
|
# the `ssl_certificate` and `ssl_key` options.
|
|
@@ -108,17 +103,6 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
108
103
|
# This option needs to be used with `ssl_certificate_authorities` and a defined list of CAs.
|
|
109
104
|
config :ssl_client_authentication, :validate => %w[none optional required], :default => 'none'
|
|
110
105
|
|
|
111
|
-
# By default the server doesn't do any client verification.
|
|
112
|
-
#
|
|
113
|
-
# `peer` will make the server ask the client to provide a certificate.
|
|
114
|
-
# If the client provides a certificate, it will be validated.
|
|
115
|
-
#
|
|
116
|
-
# `force_peer` will make the server ask the client to provide a certificate.
|
|
117
|
-
# If the client doesn't provide a certificate, the connection will be closed.
|
|
118
|
-
#
|
|
119
|
-
# This option needs to be used with `ssl_certificate_authorities` and a defined list of CAs.
|
|
120
|
-
config :ssl_verify_mode, :validate => ["none", "peer", "force_peer"], :default => "none", :deprecated => "Set 'ssl_client_authentication' instead."
|
|
121
|
-
|
|
122
106
|
# Time in milliseconds for an incomplete ssl handshake to timeout
|
|
123
107
|
config :ssl_handshake_timeout, :validate => :number, :default => 10000
|
|
124
108
|
|
|
@@ -150,25 +134,15 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
150
134
|
|
|
151
135
|
config :response_code, :validate => [200, 201, 202, 204], :default => 200
|
|
152
136
|
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
config :
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
config :
|
|
160
|
-
|
|
161
|
-
config :
|
|
162
|
-
|
|
163
|
-
config :cipher_suites, :validate => :array, :default => [], :deprecated => "Set 'ssl_cipher_suites' instead."
|
|
164
|
-
|
|
165
|
-
# The minimum TLS version allowed for the encrypted connections. The value must be one of the following:
|
|
166
|
-
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
167
|
-
config :tls_min_version, :validate => :number, :default => TLS.min.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
|
168
|
-
|
|
169
|
-
# The maximum TLS version allowed for the encrypted connections. The value must be the one of the following:
|
|
170
|
-
# 1.0 for TLS 1.0, 1.1 for TLS 1.1, 1.2 for TLS 1.2, 1.3 for TLS 1.3
|
|
171
|
-
config :tls_max_version, :validate => :number, :default => TLS.max.version, :deprecated => "Set 'ssl_supported_protocols' instead."
|
|
137
|
+
# Obsolete Settings
|
|
138
|
+
config :ssl, :obsolete => "Set 'ssl_enabled' instead."
|
|
139
|
+
config :keystore, :obsolete => "Set 'ssl_keystore_path' instead."
|
|
140
|
+
config :keystore_password, :validate => :password, :obsolete => "Set 'ssl_keystore_password' instead."
|
|
141
|
+
config :verify_mode, :obsolete => "Set 'ssl_client_authentication' instead."
|
|
142
|
+
config :cipher_suites, :obsolete => "Set 'ssl_cipher_suites' instead."
|
|
143
|
+
config :tls_min_version, :obsolete => "Set 'ssl_supported_protocols' instead."
|
|
144
|
+
config :tls_max_version, :obsolete => "Set 'ssl_supported_protocols' instead."
|
|
145
|
+
config :ssl_verify_mode, :obsolete => "Set 'ssl_client_authentication' instead."
|
|
172
146
|
|
|
173
147
|
attr_reader :codecs
|
|
174
148
|
|
|
@@ -200,8 +174,6 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
200
174
|
public
|
|
201
175
|
def register
|
|
202
176
|
|
|
203
|
-
setup_ssl_params!
|
|
204
|
-
|
|
205
177
|
validate_ssl_settings!
|
|
206
178
|
|
|
207
179
|
if @user && @password
|
|
@@ -342,34 +314,6 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
342
314
|
end
|
|
343
315
|
|
|
344
316
|
def setup_ssl_params!
|
|
345
|
-
@ssl_enabled = normalize_config(:ssl_enabled) do |normalizer|
|
|
346
|
-
normalizer.with_deprecated_alias(:ssl)
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
@ssl_cipher_suites = normalize_config(:ssl_cipher_suites) do |normalizer|
|
|
350
|
-
normalizer.with_deprecated_alias(:cipher_suites)
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
@ssl_supported_protocols = normalize_config(:ssl_supported_protocols) do |normalizer|
|
|
354
|
-
normalizer.with_deprecated_mapping(:tls_min_version, :tls_max_version) do |tls_min_version, tls_max_version|
|
|
355
|
-
TLS.get_supported(tls_min_version..tls_max_version).map(&:name)
|
|
356
|
-
end
|
|
357
|
-
end
|
|
358
|
-
|
|
359
|
-
@ssl_client_authentication = normalize_config(:ssl_client_authentication) do |normalizer|
|
|
360
|
-
normalizer.with_deprecated_mapping(:verify_mode, :ssl_verify_mode) do |verify_mode, ssl_verify_mode|
|
|
361
|
-
normalize_ssl_client_authentication_value!(verify_mode, ssl_verify_mode)
|
|
362
|
-
end
|
|
363
|
-
end
|
|
364
|
-
|
|
365
|
-
@ssl_keystore_path = normalize_config(:ssl_keystore_path) do |normalizer|
|
|
366
|
-
normalizer.with_deprecated_alias(:keystore)
|
|
367
|
-
end
|
|
368
|
-
|
|
369
|
-
@ssl_keystore_password = normalize_config(:ssl_keystore_password) do |normalizer|
|
|
370
|
-
normalizer.with_deprecated_alias(:keystore_password)
|
|
371
|
-
end
|
|
372
|
-
|
|
373
317
|
params['ssl_enabled'] = @ssl_enabled unless @ssl_enabled.nil?
|
|
374
318
|
params['ssl_cipher_suites'] = @ssl_cipher_suites unless @ssl_cipher_suites.nil?
|
|
375
319
|
params['ssl_supported_protocols'] = @ssl_supported_protocols unless @ssl_supported_protocols.nil?
|
|
@@ -378,17 +322,6 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
378
322
|
params['ssl_keystore_password'] = @ssl_keystore_password unless @ssl_keystore_password.nil?
|
|
379
323
|
end
|
|
380
324
|
|
|
381
|
-
def normalize_ssl_client_authentication_value!(verify_mode, ssl_verify_mode)
|
|
382
|
-
verify_mode_explicitly_set = original_params.key?("verify_mode")
|
|
383
|
-
|
|
384
|
-
if verify_mode_explicitly_set && original_params.key?("ssl_verify_mode")
|
|
385
|
-
raise LogStash::ConfigurationError, "Both (deprecated) `ssl_verify_mode` and `verify_mode` were set. Use only `ssl_verify_mode`"
|
|
386
|
-
end
|
|
387
|
-
|
|
388
|
-
deprecated_value = (verify_mode_explicitly_set ? verify_mode : ssl_verify_mode).downcase
|
|
389
|
-
SSL_VERIFY_MODE_TO_CLIENT_AUTHENTICATION_MAP[deprecated_value]
|
|
390
|
-
end
|
|
391
|
-
|
|
392
325
|
def create_http_server(message_handler)
|
|
393
326
|
org.logstash.plugins.inputs.http.NettyHttpServer.new(
|
|
394
327
|
@host, @port, message_handler, build_ssl_params, @threads, @max_pending_requests, @max_content_length, @response_code)
|
|
@@ -467,13 +400,7 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
467
400
|
end
|
|
468
401
|
|
|
469
402
|
def provided_ssl_client_authentication_config(values = [@ssl_client_authentication])
|
|
470
|
-
if original_params.include?('ssl_verify_mode')
|
|
471
|
-
['ssl_verify_mode', *values.map { |v| SSL_VERIFY_MODE_TO_CLIENT_AUTHENTICATION_MAP.key(v) }]
|
|
472
|
-
elsif original_params.include?('verify_mode')
|
|
473
|
-
['verify_mode', *values.map { |v| SSL_VERIFY_MODE_TO_CLIENT_AUTHENTICATION_MAP.key(v) }]
|
|
474
|
-
else
|
|
475
403
|
['ssl_client_authentication', *values]
|
|
476
|
-
end
|
|
477
404
|
end
|
|
478
405
|
|
|
479
406
|
private
|
|
@@ -8,4 +8,4 @@ require_jar('io.netty', 'netty-common', '4.1.115.Final')
|
|
|
8
8
|
require_jar('io.netty', 'netty-transport', '4.1.115.Final')
|
|
9
9
|
require_jar('io.netty', 'netty-handler', '4.1.115.Final')
|
|
10
10
|
require_jar('io.netty', 'netty-transport-native-unix-common', '4.1.115.Final')
|
|
11
|
-
require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '
|
|
11
|
+
require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '4.1.0')
|
data/spec/inputs/http_spec.rb
CHANGED
|
@@ -288,22 +288,7 @@ describe LogStash::Inputs::Http do
|
|
|
288
288
|
event = logstash_queue.pop
|
|
289
289
|
expect(event.get("message")).to eq("Hello")
|
|
290
290
|
end
|
|
291
|
-
|
|
292
|
-
end
|
|
293
|
-
|
|
294
|
-
context 'enforced TLSv1.3 (deprecated options)' do
|
|
295
|
-
|
|
296
|
-
let(:config) { super().merge 'tls_min_version' => 1.3,
|
|
297
|
-
'cipher_suites' => [ 'TLS_AES_128_GCM_SHA256' ] }
|
|
298
|
-
|
|
299
|
-
it "should parse the json body" do
|
|
300
|
-
expect(response.code).to eq(200)
|
|
301
|
-
event = logstash_queue.pop
|
|
302
|
-
expect(event.get("message")).to eq("Hello")
|
|
303
|
-
end
|
|
304
|
-
|
|
305
291
|
end
|
|
306
|
-
|
|
307
292
|
end if TLS13_ENABLED_BY_DEFAULT
|
|
308
293
|
|
|
309
294
|
end
|
|
@@ -623,16 +608,6 @@ describe LogStash::Inputs::Http do
|
|
|
623
608
|
subject.run(nil)
|
|
624
609
|
end
|
|
625
610
|
end
|
|
626
|
-
|
|
627
|
-
context "and `ssl_` settings provided" do
|
|
628
|
-
let(:ssc) { SelfSignedCertificate.new }
|
|
629
|
-
let(:config) { { "port" => 0, "ssl_enabled" => false, "ssl_certificate" => ssc.certificate.path, "ssl_client_authentication" => "none", "cipher_suites" => ["TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"] } }
|
|
630
|
-
|
|
631
|
-
it "should warn about not using the configs" do
|
|
632
|
-
expect(subject.logger).to receive(:warn).with(/^Configured SSL settings are not used when `ssl_enabled` is set to `false`: \[("ssl_certificate"(,\s)?|"ssl_client_authentication"(,\s)?|"cipher_suites"(,\s)?)*\]$/)
|
|
633
|
-
subject.register
|
|
634
|
-
end
|
|
635
|
-
end
|
|
636
611
|
end
|
|
637
612
|
|
|
638
613
|
context "with :ssl_enabled => true" do
|
|
@@ -690,31 +665,7 @@ describe LogStash::Inputs::Http do
|
|
|
690
665
|
expect { subject.register }.to_not raise_exception
|
|
691
666
|
end
|
|
692
667
|
end
|
|
693
|
-
["ssl_verify_mode", "verify_mode"].each do |config_name|
|
|
694
|
-
["peer", "force_peer"].each do |verify_mode|
|
|
695
|
-
context "with deprecated #{config_name} = #{verify_mode}" do
|
|
696
|
-
subject { LogStash::Inputs::Http.new("port" => port,
|
|
697
|
-
"ssl_enabled" => true,
|
|
698
|
-
"ssl_certificate" => ssl_certificate.path,
|
|
699
|
-
"ssl_certificate_authorities" => ssl_certificate.path,
|
|
700
|
-
"ssl_key" => ssl_key.path,
|
|
701
|
-
config_name => verify_mode
|
|
702
|
-
) }
|
|
703
|
-
it "should not raise exception" do
|
|
704
|
-
expect { subject.register }.to_not raise_exception
|
|
705
|
-
end
|
|
706
|
-
end
|
|
707
|
-
end
|
|
708
|
-
end
|
|
709
|
-
["ssl_verify_mode", "verify_mode"].each do |config_name|
|
|
710
|
-
context "with deprecated #{config_name} = none" do
|
|
711
|
-
subject { LogStash::Inputs::Http.new(config.merge(config_name => "none")) }
|
|
712
668
|
|
|
713
|
-
it "should not raise exception" do
|
|
714
|
-
expect { subject.register }.to_not raise_exception
|
|
715
|
-
end
|
|
716
|
-
end
|
|
717
|
-
end
|
|
718
669
|
context "with invalid ssl certificate" do
|
|
719
670
|
before do
|
|
720
671
|
cert = File.readlines path = config["ssl_certificate"]
|
|
@@ -762,76 +713,6 @@ describe LogStash::Inputs::Http do
|
|
|
762
713
|
end
|
|
763
714
|
end
|
|
764
715
|
|
|
765
|
-
context "with both verify_mode and ssl_verify_mode options set" do
|
|
766
|
-
let(:config) do
|
|
767
|
-
super().merge('verify_mode' => 'none', 'ssl_verify_mode' => 'none')
|
|
768
|
-
end
|
|
769
|
-
|
|
770
|
-
it "should raise a configuration error" do
|
|
771
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_verify_mode`.?/i
|
|
772
|
-
end
|
|
773
|
-
end
|
|
774
|
-
|
|
775
|
-
context "with both ssl_client_authentication and ssl_verify_mode options set" do
|
|
776
|
-
let(:config) do
|
|
777
|
-
super().merge('ssl_client_authentication' => 'optional', 'ssl_verify_mode' => 'none')
|
|
778
|
-
end
|
|
779
|
-
|
|
780
|
-
it "should raise a configuration error" do
|
|
781
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_client_authentication.?/i
|
|
782
|
-
end
|
|
783
|
-
end
|
|
784
|
-
|
|
785
|
-
context "with both ssl_client_authentication and verify_mode options set" do
|
|
786
|
-
let(:config) do
|
|
787
|
-
super().merge('ssl_client_authentication' => 'optional', 'verify_mode' => 'none')
|
|
788
|
-
end
|
|
789
|
-
|
|
790
|
-
it "should raise a configuration error" do
|
|
791
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_client_authentication.?/i
|
|
792
|
-
end
|
|
793
|
-
end
|
|
794
|
-
|
|
795
|
-
context "with ssl_cipher_suites and cipher_suites set" do
|
|
796
|
-
let(:config) do
|
|
797
|
-
super().merge('ssl_cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'],
|
|
798
|
-
'cipher_suites' => ['TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384'])
|
|
799
|
-
end
|
|
800
|
-
|
|
801
|
-
it "should raise a configuration error" do
|
|
802
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_cipher_suites.?/i
|
|
803
|
-
end
|
|
804
|
-
end
|
|
805
|
-
|
|
806
|
-
context "with ssl_supported_protocols and tls_min_version set" do
|
|
807
|
-
let(:config) do
|
|
808
|
-
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_min_version' => 1.0)
|
|
809
|
-
end
|
|
810
|
-
|
|
811
|
-
it "should raise a configuration error" do
|
|
812
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
|
813
|
-
end
|
|
814
|
-
end
|
|
815
|
-
|
|
816
|
-
context "with ssl_supported_protocols and tls_max_version set" do
|
|
817
|
-
let(:config) do
|
|
818
|
-
super().merge('ssl_supported_protocols' => ['TLSv1.2'], 'tls_max_version' => 1.2)
|
|
819
|
-
end
|
|
820
|
-
|
|
821
|
-
it "should raise a configuration error" do
|
|
822
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_supported_protocols.?/i
|
|
823
|
-
end
|
|
824
|
-
end
|
|
825
|
-
|
|
826
|
-
context "with both ssl and ssl_enabled set" do
|
|
827
|
-
let(:config) do
|
|
828
|
-
super().merge('ssl' => true, 'ssl_enabled' => true )
|
|
829
|
-
end
|
|
830
|
-
|
|
831
|
-
it "should raise a configuration error" do
|
|
832
|
-
expect { subject.register }.to raise_error LogStash::ConfigurationError, /Use only .?ssl_enabled.?/i
|
|
833
|
-
end
|
|
834
|
-
end
|
|
835
716
|
|
|
836
717
|
context "and with :ssl_keystore_path" do
|
|
837
718
|
let(:config) do
|
|
@@ -844,41 +725,6 @@ describe LogStash::Inputs::Http do
|
|
|
844
725
|
end
|
|
845
726
|
|
|
846
727
|
context "with ssl_client_authentication" do
|
|
847
|
-
context "normalized from ssl_verify_mode 'none'" do
|
|
848
|
-
let(:config) { super().merge("ssl_verify_mode" => "none") }
|
|
849
|
-
|
|
850
|
-
it "should transform the value to 'none'" do
|
|
851
|
-
subject.register
|
|
852
|
-
expect(subject.params).to match hash_including("ssl_client_authentication" => "none")
|
|
853
|
-
expect(subject.instance_variable_get(:@ssl_client_authentication)).to eql("none")
|
|
854
|
-
end
|
|
855
|
-
|
|
856
|
-
context "and ssl_certificate_authorities is set" do
|
|
857
|
-
let(:config) { super().merge("ssl_certificate_authorities" => [certificate_path( 'root.crt')]) }
|
|
858
|
-
it "raise a configuration error" do
|
|
859
|
-
expect { subject.register }.to raise_error(LogStash::ConfigurationError, "The configuration of `ssl_certificate_authorities` requires setting `ssl_verify_mode` to `peer` or 'force_peer'")
|
|
860
|
-
end
|
|
861
|
-
end
|
|
862
|
-
end
|
|
863
|
-
|
|
864
|
-
[%w[peer optional], %w[force_peer required]].each do |ssl_verify_mode, ssl_client_authentication|
|
|
865
|
-
context "normalized from ssl_verify_mode '#{ssl_verify_mode}'" do
|
|
866
|
-
let(:config) { super().merge("ssl_verify_mode" => ssl_verify_mode, "ssl_certificate_authorities" => [certificate_path( 'root.crt')]) }
|
|
867
|
-
|
|
868
|
-
it "should transform the value to '#{ssl_client_authentication}'" do
|
|
869
|
-
subject.register
|
|
870
|
-
expect(subject.params).to match hash_including("ssl_client_authentication" => ssl_client_authentication)
|
|
871
|
-
expect(subject.instance_variable_get(:@ssl_client_authentication)).to eql(ssl_client_authentication)
|
|
872
|
-
end
|
|
873
|
-
|
|
874
|
-
context "with no ssl_certificate_authorities set " do
|
|
875
|
-
let(:config) { super().reject { |key| "ssl_certificate_authorities".eql?(key) } }
|
|
876
|
-
it "raise a configuration error" do
|
|
877
|
-
expect {subject.register}.to raise_error(LogStash::ConfigurationError, "Using `ssl_verify_mode` set to `peer` or `force_peer`, requires the configuration of `ssl_certificate_authorities` or `ssl_truststore_path`")
|
|
878
|
-
end
|
|
879
|
-
end
|
|
880
|
-
end
|
|
881
|
-
end
|
|
882
728
|
|
|
883
729
|
context "configured to 'none'" do
|
|
884
730
|
let(:config) { super().merge("ssl_client_authentication" => "none") }
|
|
@@ -1015,7 +861,26 @@ describe LogStash::Inputs::Http do
|
|
|
1015
861
|
end
|
|
1016
862
|
end
|
|
1017
863
|
end
|
|
864
|
+
end
|
|
1018
865
|
|
|
866
|
+
describe 'handling obsolete settings' do
|
|
867
|
+
[{:name => 'tls_min_version', :replacement => 'ssl_supported_protocols', :sample_value => 1.3},
|
|
868
|
+
{:name => 'tls_max_version', :replacement => 'ssl_supported_protocols', :sample_value => 1.3},
|
|
869
|
+
{:name => 'cipher_suites', :replacement => 'ssl_cipher_suites', :sample_value => ['TLS_AES_128_GCM_SHA256']},
|
|
870
|
+
{:name => 'ssl', :replacement => 'ssl_enabled', :sample_value => true},
|
|
871
|
+
{:name => 'keystore', :replacement => 'ssl_keystore_path', :sample_value => certificate_path( 'server_from_root.p12')},
|
|
872
|
+
{:name => 'keystore_password', :replacement => 'ssl_keystore_password', :sample_value => 'none'},
|
|
873
|
+
{:name => 'ssl_verify_mode', :replacement => 'ssl_client_authentication', :sample_value => 'peer'},
|
|
874
|
+
{:name => 'verify_mode', :replacement => 'ssl_client_authentication', :sample_value => 'peer'}].each do | obsolete_setting|
|
|
875
|
+
context "with obsolete #{obsolete_setting[:name]}" do
|
|
876
|
+
let (:deprecated_config) do
|
|
877
|
+
config.merge({obsolete_setting[:name] => obsolete_setting[:sample_value]})
|
|
878
|
+
end
|
|
879
|
+
it "should raise a config error with the appropriate message" do
|
|
880
|
+
expect { LogStash::Inputs::Http.new(deprecated_config).register }.to raise_error LogStash::ConfigurationError, /The setting `#{obsolete_setting[:name]}` in plugin `http` is obsolete and is no longer available. Set '#{obsolete_setting[:replacement]}' instead/i
|
|
881
|
+
end
|
|
882
|
+
end
|
|
883
|
+
end
|
|
1019
884
|
end
|
|
1020
885
|
end
|
|
1021
886
|
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-input-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.1.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
@@ -176,7 +176,7 @@ files:
|
|
|
176
176
|
- vendor/jar-dependencies/io/netty/netty-handler/4.1.115.Final/netty-handler-4.1.115.Final.jar
|
|
177
177
|
- vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.115.Final/netty-transport-native-unix-common-4.1.115.Final.jar
|
|
178
178
|
- vendor/jar-dependencies/io/netty/netty-transport/4.1.115.Final/netty-transport-4.1.115.Final.jar
|
|
179
|
-
- vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/
|
|
179
|
+
- vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/4.1.0/logstash-input-http-4.1.0.jar
|
|
180
180
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
|
181
181
|
licenses:
|
|
182
182
|
- Apache License (2.0)
|