logstash-output-tcp 6.2.2 → 7.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12e6eaa4720dc56a6588aae77dd029643860e9ee7bfd92e5afe8893c32773f39
4
- data.tar.gz: dd6cc7805773a7a5151aeb43c72a2d5f6122aee654c14cf206a41bdb870ca0be
3
+ metadata.gz: 4f3d55b1be71f4defe4a2d4825b00ea1b1e8c6cc5d97dbe3385129a743cfc0c1
4
+ data.tar.gz: 69875ac2174ededc584c88b8f842385cf7d57cefc0b0c8ffbf1c20e60daf0984
5
5
  SHA512:
6
- metadata.gz: e1a94857cb7891d1c95b30f14e19967e1a46a56c1b3380d479d064b5094318ec598914b268e13bd8c101e5234241ba0534410808152bfe1fd02d03bb63efdf0a
7
- data.tar.gz: e16e659b6b97859000185d15321a2dd6c805da96628464b0989db7a6cf1879c7270309ce2eb5ba49266ea4582182f8d04183f2c7ea62094ff38b5a5053c5a168
6
+ metadata.gz: a173f7ea4f9cc7f2b5876e2a774d649fe5a9cf5c2f6294496f3df0e53103238aa272953444d8ef0e5ddc0a5776528ea277aaa85927cbd01e8de36bf5a19f3ae3
7
+ data.tar.gz: 73d262224113489d7ac273fc2b9469d64eb39aeb3106a42b2e711ee1a2bda7dfb5eebeac9d7dd07586ae939d83a172c529391686b3a192ea730e908890fe6a0b
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
- ## 6.2.2
1
+ ## 7.0.1
2
2
  - Invoke post_connection_check on connect [#61](https://github.com/logstash-plugins/logstash-output-tcp/pull/61)
3
3
 
4
+ ## 7.0.0
5
+ - SSL settings that were marked deprecated in version `6.2.0` are now marked obsolete, and will prevent the plugin from starting.
6
+ [#58](https://github.com/logstash-plugins/logstash-output-tcp/pull/58)
7
+ - These settings are:
8
+ - `ssl_cert`, which should be replaced by `ssl_certificate`
9
+ - `ssl_cacert`, which should be replaced by `ssl_certificate_authorities`
10
+ - `ssl_enable`, which should be replaced by `ssl_enabled`
11
+ - `ssl_verify`, which should be replaced by `ssl_client_authentication` when `mode` is `server` or `ssl_verification_mode`when mode is `client`
12
+
4
13
  ## 6.2.1
5
14
  - Document correct default plugin codec [#54](https://github.com/logstash-plugins/logstash-output-tcp/pull/54)
6
15
 
data/docs/index.asciidoc CHANGED
@@ -33,6 +33,10 @@ depending on `mode`.
33
33
 
34
34
  This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
35
35
 
36
+ NOTE: As of version `7.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed. Please see the
37
+ <<plugins-{type}s-{plugin}-obsolete-options>> for more details.
38
+
39
+
36
40
  [cols="<,<,<",options="header",]
37
41
  |=======================================================================
38
42
  |Setting |Input type|Required
@@ -40,19 +44,15 @@ This plugin supports the following configuration options plus the <<plugins-{typ
40
44
  | <<plugins-{type}s-{plugin}-mode>> |<<string,string>>, one of `["server", "client"]`|No
41
45
  | <<plugins-{type}s-{plugin}-port>> |<<number,number>>|Yes
42
46
  | <<plugins-{type}s-{plugin}-reconnect_interval>> |<<number,number>>|No
43
- | <<plugins-{type}s-{plugin}-ssl_cacert>> |a valid filesystem path|__Deprecated__
44
- | <<plugins-{type}s-{plugin}-ssl_cert>> |a valid filesystem path|__Deprecated__
45
47
  | <<plugins-{type}s-{plugin}-ssl_certificate>> |a valid filesystem path|No
46
48
  | <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> |<<array,array>>|No
47
49
  | <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |<<string,string>>|No
48
50
  | <<plugins-{type}s-{plugin}-ssl_client_authentication>> |<<string,string>>, one of `["none", "optional", "required"]`|No
49
- | <<plugins-{type}s-{plugin}-ssl_enable>> |<<boolean,boolean>>|__Deprecated__
50
51
  | <<plugins-{type}s-{plugin}-ssl_enabled>> |<<boolean,boolean>>|No
51
52
  | <<plugins-{type}s-{plugin}-ssl_key>> |a valid filesystem path|No
52
53
  | <<plugins-{type}s-{plugin}-ssl_key_passphrase>> |<<password,password>>|No
53
54
  | <<plugins-{type}s-{plugin}-ssl_supported_protocols>> |<<string,string>>|No
54
55
  | <<plugins-{type}s-{plugin}-ssl_verification_mode>> |<<string,string>>, one of `["full", "none"]`|No
55
- | <<plugins-{type}s-{plugin}-ssl_verify>> |<<boolean,boolean>>|No
56
56
  |=======================================================================
57
57
 
58
58
  Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
@@ -97,24 +97,6 @@ When mode is `client`, the port to connect to.
97
97
 
98
98
  When connect failed,retry interval in sec.
99
99
 
100
- [id="plugins-{type}s-{plugin}-ssl_cacert"]
101
- ===== `ssl_cacert`
102
- deprecated[6.2.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
103
-
104
- * Value type is <<path,path>>
105
- * There is no default value for this setting.
106
-
107
- The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.
108
-
109
- [id="plugins-{type}s-{plugin}-ssl_cert"]
110
- ===== `ssl_cert`
111
- deprecated[6.2.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate>>]
112
-
113
- * Value type is <<path,path>>
114
- * There is no default value for this setting.
115
-
116
- SSL certificate path
117
-
118
100
  [id="plugins-{type}s-{plugin}-ssl_certificate"]
119
101
  ===== `ssl_certificate`
120
102
 
@@ -160,15 +142,6 @@ Please note that the server does not validate the client certificate CN (Common
160
142
  NOTE: This setting can be used only if <<plugins-{type}s-{plugin}-mode>> is `server` and <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> is set.
161
143
 
162
144
 
163
- [id="plugins-{type}s-{plugin}-ssl_enable"]
164
- ===== `ssl_enable`
165
- deprecated[6.2.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
166
-
167
- * Value type is <<boolean,boolean>>
168
- * Default value is `false`
169
-
170
- Enable SSL (must be set for other `ssl_` options to take effect).
171
-
172
145
  [id="plugins-{type}s-{plugin}-ssl_enabled"]
173
146
  ===== `ssl_enabled`
174
147
 
@@ -223,15 +196,21 @@ has a hostname or IP address that matches the names within the certificate.
223
196
 
224
197
  NOTE: This setting can be used only if <<plugins-{type}s-{plugin}-mode>> is `client`.
225
198
 
226
- [id="plugins-{type}s-{plugin}-ssl_verify"]
227
- ===== `ssl_verify`
228
- deprecated[6.2.0, Replaced by <<plugins-{type}s-{plugin}-ssl_client_authentication>> and <<plugins-{type}s-{plugin}-ssl_verification_mode>>]
199
+ [id="plugins-{type}s-{plugin}-obsolete-options"]
200
+ ==== TCP Output Obsolete Configuration Options
201
+
202
+ WARNING: As of version `6.0.0` of this plugin, some configuration options have been replaced.
203
+ The plugin will fail to start if it contains any of these obsolete options.
229
204
 
230
- * Value type is <<boolean,boolean>>
231
- * Default value is `false`
232
205
 
233
- Verify the identity of the other end of the SSL connection against the CA.
234
- For input, sets the field `sslsubject` to that of the client certificate.
206
+ [cols="<,<",options="header",]
207
+ |=======================================================================
208
+ |Setting|Replaced by
209
+ | ssl_cacert |<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
210
+ | ssl_cert |<<plugins-{type}s-{plugin}-ssl_certificate>>
211
+ | ssl_enable |<<plugins-{type}s-{plugin}-ssl_enabled>>
212
+ | ssl_verify |<<plugins-{type}s-{plugin}-ssl_client_authentication>> in `server` mode and <<plugins-{type}s-{plugin}-ssl_verification_mode>> in `client` mode
213
+ |=======================================================================
235
214
 
236
215
  [id="plugins-{type}s-{plugin}-common-options"]
237
216
  include::{include_path}/{type}.asciidoc[]
@@ -3,7 +3,6 @@ require "logstash/outputs/base"
3
3
  require "logstash/namespace"
4
4
  require "thread"
5
5
  require "logstash/util/socket_peer"
6
- require "logstash/plugin_mixins/normalize_config_support"
7
6
 
8
7
  # Write events over a TCP socket.
9
8
  #
@@ -13,8 +12,6 @@ require "logstash/plugin_mixins/normalize_config_support"
13
12
  # depending on `mode`.
14
13
  class LogStash::Outputs::Tcp < LogStash::Outputs::Base
15
14
 
16
- include LogStash::PluginMixins::NormalizeConfigSupport
17
-
18
15
  config_name "tcp"
19
16
  concurrency :single
20
17
 
@@ -35,9 +32,6 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
35
32
  # `client` connects to a server.
36
33
  config :mode, :validate => ["server", "client"], :default => "client"
37
34
 
38
- # Enable SSL (must be set for other `ssl_` options to take effect).
39
- config :ssl_enable, :validate => :boolean, :default => false, :deprecated => "Use 'ssl_enabled' instead."
40
-
41
35
  # Enable SSL (must be set for other `ssl_` options to take effect).
42
36
  config :ssl_enabled, :validate => :boolean, :default => false
43
37
 
@@ -48,10 +42,6 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
48
42
  # This option needs to be used with `ssl_certificate_authorities` and a defined list of CAs.
49
43
  config :ssl_client_authentication, :validate => %w[none optional required], :default => 'none'
50
44
 
51
- # Verify the identity of the other end of the SSL connection against the CA.
52
- # For input, sets the field `sslsubject` to that of the client certificate.
53
- config :ssl_verify, :validate => :boolean, :default => false, :deprecated => "Use 'ssl_client_authentication' when `mode` is 'server' or 'ssl_verification_mode' when mode is `client`"
54
-
55
45
  # Options to verify the server's certificate.
56
46
  # "full": validates that the provided certificate has an issue date that’s within the not_before and not_after dates;
57
47
  # chains to a trusted Certificate Authority (CA); has a hostname or IP address that matches the names within the certificate.
@@ -59,16 +49,11 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
59
49
  # "none": performs no certificate validation. Disabling this severely compromises security (https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf)
60
50
  config :ssl_verification_mode, :validate => %w[full none], :default => 'full'
61
51
 
62
- # The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.
63
- config :ssl_cacert, :validate => :path, :deprecated => "Use 'ssl_certificate_authorities' instead."
64
52
 
65
53
  # Validate client certificate or certificate chain against these authorities. You can define multiple files.
66
54
  # All the certificates will be read and added to the trust store.
67
55
  config :ssl_certificate_authorities, :validate => :path, :list => true
68
56
 
69
- # SSL certificate path
70
- config :ssl_cert, :validate => :path, :deprecated => "Use 'ssl_certificate' instead."
71
-
72
57
  # SSL certificate path
73
58
  config :ssl_certificate, :validate => :path
74
59
 
@@ -84,6 +69,11 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
84
69
  # The list of ciphers suite to use
85
70
  config :ssl_cipher_suites, :validate => :string, :list => true
86
71
 
72
+ config :ssl_enable, :obsolete => "Use 'ssl_enabled' instead."
73
+ config :ssl_verify, :obsolete => "Use 'ssl_client_authentication' when `mode` is 'server' or 'ssl_verification_mode' when mode is `client`"
74
+ config :ssl_cacert, :obsolete => "Use 'ssl_certificate_authorities' instead."
75
+ config :ssl_cert, :obsolete => "Use 'ssl_certificate' instead."
76
+
87
77
  class Client
88
78
 
89
79
  ##
@@ -189,11 +179,6 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
189
179
  end
190
180
  private :load_cert_store
191
181
 
192
- def initialize(*args)
193
- super(*args)
194
- setup_ssl_params!
195
- end
196
-
197
182
  # @overload Base#register
198
183
  def register
199
184
  require "socket"
@@ -407,47 +392,6 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
407
392
  original_params.include?('ssl_enable') ? 'ssl_enable' : 'ssl_enabled'
408
393
  end
409
394
 
410
- def setup_ssl_params!
411
- @ssl_enabled = normalize_config(:ssl_enabled) do |normalizer|
412
- normalizer.with_deprecated_alias(:ssl_enable)
413
- end
414
-
415
- @ssl_certificate = normalize_config(:ssl_certificate) do |normalizer|
416
- normalizer.with_deprecated_alias(:ssl_cert)
417
- end
418
-
419
- if server?
420
- @ssl_client_authentication = normalize_config(:ssl_client_authentication) do |normalizer|
421
- normalizer.with_deprecated_mapping(:ssl_verify) do |ssl_verify|
422
- ssl_verify == true ? 'required' : 'none'
423
- end
424
- end
425
- else
426
- @ssl_verification_mode = normalize_config(:ssl_verification_mode) do |normalize|
427
- normalize.with_deprecated_mapping(:ssl_verify) do |ssl_verify|
428
- ssl_verify == true ? 'full' : 'none'
429
- end
430
- end
431
-
432
- # Keep backwards compatibility with the default :ssl_verify value (false)
433
- if !original_params.include?('ssl_verify') && !original_params.include?('ssl_verification_mode')
434
- @ssl_verification_mode = 'none'
435
- end
436
- end
437
-
438
- @ssl_certificate_authorities = normalize_config(:ssl_certificate_authorities) do |normalize|
439
- normalize.with_deprecated_mapping(:ssl_cacert) do |ssl_cacert|
440
- if File.directory?(ssl_cacert)
441
- Dir.children(ssl_cacert)
442
- .map{ |f| File.join(ssl_cacert, f) }
443
- .reject{ |f| File.directory?(f) || File.basename(f).start_with?('.') }
444
- else
445
- [ssl_cacert]
446
- end
447
- end
448
- end
449
- end
450
-
451
395
  def server?
452
396
  @mode == "server"
453
397
  end # def server?
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-tcp'
4
- s.version = '6.2.2'
4
+ s.version = '7.0.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Writes events over a TCP socket"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency 'logstash-core', '>= 8.1.0'
25
25
  s.add_runtime_dependency 'logstash-codec-json'
26
26
  s.add_runtime_dependency 'stud'
27
- s.add_runtime_dependency 'logstash-mixin-normalize_config_support', '~>1.0'
28
27
 
29
28
  s.add_runtime_dependency 'jruby-openssl', '>= 0.12.2' # 0.12 supports TLSv1.3
30
29
 
@@ -24,6 +24,25 @@ describe LogStash::Outputs::Tcp do
24
24
 
25
25
  let(:event) { LogStash::Event.new('message' => 'foo bar') }
26
26
 
27
+ ['server', 'client'].each do |mode|
28
+ describe "handling obsolete settings for #{mode} mode" do
29
+ [{:name => 'ssl_cert', :replacement => 'ssl_certificate', :sample_value => "certificate_path"},
30
+ {:name => 'ssl_cacert', :replacement => 'ssl_certificate_authorities', :sample_value => "certificate_path"},
31
+ {:name => 'ssl_enable', :replacement => 'ssl_enabled', :sample_value => true},
32
+ {:name => 'ssl_verify', :replacement => 'ssl_client_authentication', :sample_value => 'peer'}].each do | obsolete_setting |
33
+ context "with obsolete #{obsolete_setting[:name]}" do
34
+ let (:deprecated_config) do
35
+ config.merge({'mode' => mode, obsolete_setting[:name] => obsolete_setting[:sample_value]})
36
+ end
37
+
38
+ it "should raise a config error with the appropriate message" do
39
+ expect { LogStash::Outputs::Tcp.new(deprecated_config).register }.to raise_error LogStash::ConfigurationError, /The setting `#{obsolete_setting[:name]}` in plugin `tcp` is obsolete and is no longer available. Use '#{obsolete_setting[:replacement]}'/i
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
27
46
  context 'failing to connect' do
28
47
 
29
48
  before { subject.register }
@@ -214,7 +233,7 @@ describe LogStash::Outputs::Tcp do
214
233
 
215
234
  context 'with supported protocol' do
216
235
 
217
- let(:config) { super().merge("ssl_supported_protocols" => ['TLSv1.2']) }
236
+ let(:config) { super().merge("ssl_supported_protocols" => ['TLSv1.2'], "ssl_verification_mode" => "none") }
218
237
 
219
238
  let(:server_min_version) { 'TLS1_2' }
220
239
 
@@ -314,7 +333,7 @@ describe LogStash::Outputs::Tcp do
314
333
  context "and protocol is TLSv1.3" do
315
334
  let(:key_file) { File.join(FIXTURES_PATH, 'plaintext/instance.key') }
316
335
  let(:crt_file) { File.join(FIXTURES_PATH, 'plaintext/instance.crt') }
317
- let(:config) { super().merge("ssl_certificate" => crt_file, "ssl_key" => key_file) }
336
+ let(:config) { super().merge("ssl_certificate" => crt_file, "ssl_key" => key_file, "ssl_verification_mode" => "none") }
318
337
 
319
338
  let(:secure_server) do
320
339
  ssl_context = OpenSSL::SSL::SSLContext.new
@@ -411,16 +430,6 @@ describe LogStash::Outputs::Tcp do
411
430
  end
412
431
  end
413
432
 
414
- context "with deprecated ssl_verify = true and no ssl_certificate_authorities" do
415
- let(:config) { super().merge(
416
- 'ssl_verify' => true,
417
- 'ssl_certificate_authorities' => []
418
- ) }
419
-
420
- it "should register without errors" do
421
- expect { subject.register }.to_not raise_error
422
- end
423
- end
424
433
 
425
434
  %w[required optional].each do |ssl_client_authentication|
426
435
  context "with ssl_client_authentication = `#{ssl_client_authentication}` and no ssl_certificate_authorities" do
@@ -446,53 +455,6 @@ describe LogStash::Outputs::Tcp do
446
455
  end
447
456
  end
448
457
 
449
- context "with deprecated settings" do
450
- let(:ssl_verify) { true }
451
- let(:certificate_path) { File.join(FIXTURES_PATH, 'plaintext/instance.crt') }
452
- let(:config) do
453
- {
454
- "host" => "127.0.0.1",
455
- "port" => port,
456
- "ssl_enable" => true,
457
- "ssl_cert" => certificate_path,
458
- "ssl_key" => File.join(FIXTURES_PATH, 'plaintext/instance.key'),
459
- "ssl_verify" => ssl_verify
460
- }
461
- end
462
-
463
- context "and mode is server" do
464
- let(:config) { super().merge("mode" => 'server') }
465
- [true, false].each do |verify|
466
- context "and ssl_verify is #{verify}" do
467
- let(:ssl_verify) { verify }
468
-
469
- it "should set new configs variables" do
470
- subject.register
471
- expect(subject.instance_variable_get(:@ssl_enabled)).to eql(true)
472
- expect(subject.instance_variable_get(:@ssl_client_authentication)).to eql(verify ? 'required' : 'none')
473
- expect(subject.instance_variable_get(:@ssl_certificate)).to eql(certificate_path)
474
- end
475
- end
476
- end
477
- end
478
-
479
- context "and mode is client" do
480
- let(:config) { super().merge("mode" => 'client') }
481
- [true, false].each do |verify|
482
- context "and ssl_verify is #{verify}" do
483
- let(:ssl_verify) { verify }
484
-
485
- it "should set new configs variables" do
486
- subject.register
487
- expect(subject.instance_variable_get(:@ssl_enabled)).to eql(true)
488
- expect(subject.instance_variable_get(:@ssl_verification_mode)).to eql(verify ? 'full' : 'none')
489
- expect(subject.instance_variable_get(:@ssl_certificate)).to eql(certificate_path)
490
- end
491
- end
492
- end
493
- end
494
- end
495
-
496
458
  context "with ssl_client_authentication" do
497
459
  let(:config) do
498
460
  super().merge 'ssl_client_authentication' => 'required'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.2
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -72,20 +72,6 @@ dependencies:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '1.0'
81
- name: logstash-mixin-normalize_config_support
82
- type: :runtime
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.0'
89
75
  - !ruby/object:Gem::Dependency
90
76
  requirement: !ruby/object:Gem::Requirement
91
77
  requirements: