logstash-input-tcp 5.2.7-java → 6.0.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 357b2eb1811b7c42881aca1042e3869de674c51e2c5f758b5e3b3e0e434c3703
4
- data.tar.gz: ea8a68cd70d5107ed10e88aed1fd2ebfa465ee04eb6b8c764e7227e066e860a1
3
+ metadata.gz: 8f95c4b965fd69c58c8ea30cebdfbd74838e07051b3491e9c88da3a6029b7bdf
4
+ data.tar.gz: a21e7f3a68395d29f40d083f77933191d702e553f14903d3062a163c0f550aa6
5
5
  SHA512:
6
- metadata.gz: 9e47e28a0a676a122b09c81f5483b6f536e1419361b30c775754024c58b7ad151106bc76f973b605225df72686f1c9a2bcab3680be4a7ea28a7c1fe3c52d222b
7
- data.tar.gz: 716530a44f2cc82bc1b3a5a9040df29e6e4e92c27e5b2dd775533664c9734f0d53b732396656ee8d6a7ea3faea8f4372c162a98372ad6aea29e22a75298d8a0f
6
+ metadata.gz: a928baf3ca1703fb850d09bc587299809b78b387b41c2a920f525d28d7ae335224b9d1f2dfa9f74ea91a88d1c45e4005c001bfe90fa5f6fa46ca476fe83ebc63
7
+ data.tar.gz: dd835f99eefdcdb04602beb68bb3c2f03a9fea58468f3c90dfb4461710740e9d0e56b992b9528ffc608872af4fc3d032286d4af7abd99d11b847483d4be657eb
data/CHANGELOG.md CHANGED
@@ -1,28 +1,5 @@
1
- ## 5.2.7
2
- - Update Log4j dependency to 2.17.1
3
-
4
- ## 5.2.6
5
- - Ensure correct jar paths when building plugin from a non-standard directory
6
-
7
- ## 5.2.5
8
- - Update Log4j dependency to 2.17
9
-
10
- ## 5.2.4
11
- - Update Log4j dependency to 2.16, ensuring this plugin's runtime relies only on log4j-api instead
12
- of providing its own log4j-core [#189](https://github.com/logstash-plugins/logstash-input-tcp/pull/189)
13
-
14
- ## 5.2.3
15
- - Skip empty lines while reading certificate files [#144](https://github.com/logstash-plugins/logstash-input-tcp/issues/144)
16
-
17
- ## 5.2.2
18
- - Fixed race condition where data would be accepted before queue was configured [#142](https://github.com/logstash-plugins/logstash-input-tcp/pull/142)
19
-
20
- ## 5.2.1
21
- - Support multiple certificates per file [#140](https://github.com/logstash-plugins/logstash-input-tcp/pull/140)
22
- - Fixed support for encrypted pkcs8 private keys [#133](https://github.com/logstash-plugins/logstash-input-tcp/pull/133)
23
- - Added support for encrypted pem pkcs1 private keys [#131](https://github.com/logstash-plugins/logstash-input-tcp/pull/131)
24
- - Changed testing to docker [#128](https://github.com/logstash-plugins/logstash-input-tcp/pull/128)
25
- - Fixed heading for `ssl_certificate_authorities` docs [#130](https://github.com/logstash-plugins/logstash-input-tcp/pull/130)
1
+ ## 6.0.0
2
+ - Removed obsolete `data_timeout` and `ssl_cacert` options
26
3
 
27
4
  ## 5.2.0
28
5
  - Added support for pkcs1 and pkcs8 key formats [#122](https://github.com/logstash-plugins/logstash-input-tcp/issues/122)
@@ -76,9 +76,7 @@ class SslOptions
76
76
  # create certificate object
77
77
  cf = CertificateFactory.getInstance("X.509")
78
78
  cert_chain = []
79
- fetch_certificates_from_file(@ssl_cert_path, cf) do |cert|
80
- cert_chain << cert
81
- end
79
+ cert_chain << cf.generateCertificate(FileInputStream.new(@ssl_cert_path))
82
80
 
83
81
  # convert key from pkcs1 to pkcs8 and get PrivateKey object
84
82
  pem_parser = PEMParser.new(FileReader.new(@ssl_key_path))
@@ -102,19 +100,13 @@ class SslOptions
102
100
  raise "Could not recognize 'ssl_key' format. Class: #{obj.class}"
103
101
  end
104
102
 
105
- @ssl_extra_chain_certs.each do |file|
106
- fetch_certificates_from_file(file, cf) do |cert|
107
- cert_chain << cert
108
- end
103
+ @ssl_extra_chain_certs.each do |cert|
104
+ cert_chain << cf.generateCertificate(FileInputStream.new(cert))
109
105
  end
110
106
  sslContextBuilder = SslContextBuilder.forServer(private_key, @ssl_key_passphrase, cert_chain.to_java(X509Certificate))
111
107
 
112
- trust_certs = []
113
-
114
- @ssl_certificate_authorities.each do |file|
115
- fetch_certificates_from_file(file, cf) do |cert|
116
- trust_certs << cert
117
- end
108
+ trust_certs = @ssl_certificate_authorities.map do |cert|
109
+ cf.generateCertificate(FileInputStream.new(cert))
118
110
  end
119
111
 
120
112
  if trust_certs.any?
@@ -124,22 +116,4 @@ class SslOptions
124
116
  sslContextBuilder.clientAuth(@ssl_verify ? ClientAuth::REQUIRE : ClientAuth::NONE)
125
117
  sslContextBuilder.build()
126
118
  end
127
-
128
- private
129
- def fetch_certificates_from_file(file, cf)
130
- fis = java.io.FileInputStream.new(file)
131
-
132
- while (fis.available > 0) do
133
- cert = generate_certificate(cf, fis)
134
- yield cert if cert
135
- end
136
- ensure
137
- fis.close if fis
138
- end
139
-
140
- def generate_certificate(cf, fis)
141
- cf.generateCertificate(fis)
142
- rescue Java::JavaSecurityCert::CertificateException => e
143
- raise e unless e.cause.message == "Empty input"
144
- end
145
119
  end
@@ -74,8 +74,6 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
74
74
  # When mode is `client`, the port to connect to.
75
75
  config :port, :validate => :number, :required => true
76
76
 
77
- config :data_timeout, :validate => :number, :obsolete => "This setting is not used any more."
78
-
79
77
  # Mode to operate in. `server` listens for client connections,
80
78
  # `client` connects to a server.
81
79
  config :mode, :validate => ["server", "client"], :default => "server"
@@ -91,8 +89,6 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
91
89
  # For input, sets the field `sslsubject` to that of the client certificate.
92
90
  config :ssl_verify, :validate => :boolean, :default => true
93
91
 
94
- config :ssl_cacert, :validate => :path, :obsolete => "This setting is obsolete. Use ssl_extra_chain_certs instead"
95
-
96
92
  # SSL certificate path
97
93
  config :ssl_cert, :validate => :path
98
94
 
@@ -141,6 +137,11 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
141
137
  def register
142
138
  fix_streaming_codecs
143
139
 
140
+ # note that since we are opening a socket in register, we must also make sure we close it
141
+ # in the close method even if we also close it in the stop method since we could have
142
+ # a situation where register is called but not run & stop.
143
+
144
+ @logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}", :ssl_enable => "#{@ssl_enable}")
144
145
  if server?
145
146
  ssl_context = get_ssl_context(SslOptions)
146
147
 
@@ -152,7 +153,6 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
152
153
  def run(output_queue)
153
154
  @output_queue = output_queue
154
155
  if server?
155
- @logger.info("Starting tcp input listener", :address => "#{@host}:#{@port}", :ssl_enable => "#{@ssl_enable}")
156
156
  @loop.run
157
157
  else
158
158
  run_client()
@@ -31,11 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.add_runtime_dependency 'logstash-codec-json_lines'
32
32
  s.add_runtime_dependency 'logstash-codec-multiline'
33
33
 
34
- # 5.x branch of this plugin provides support for LS5&6.
35
- # To use LS7+, you must use v6+ of this plugin.
36
- s.add_runtime_dependency 'logstash-core', '< 7.0.0'
37
-
38
- s.add_development_dependency 'logstash-devutils', '~> 1.0'
34
+ s.add_development_dependency 'logstash-devutils'
39
35
  s.add_development_dependency 'flores', '~> 0.0.6'
40
36
  s.add_development_dependency 'stud', '~> 0.0.22'
41
37
  end
@@ -382,35 +382,6 @@ describe LogStash::Inputs::Tcp do
382
382
  ssc.delete
383
383
  end
384
384
  end
385
-
386
- context "with multiple certificates with empty spaces in them" do
387
- let(:ssc) { SelfSignedCertificate.new }
388
- let(:certificate_file) { ssc.certificate }
389
- let(:key_file) { ssc.private_key}
390
- let(:ssc_2) { SelfSignedCertificate.new }
391
- let(:certificate_file_2) { ssc.certificate }
392
- let(:config) do
393
- {
394
- "host" => "127.0.0.1",
395
- "port" => port,
396
- "ssl_enable" => true,
397
- "ssl_cert" => certificate_file.path,
398
- "ssl_key" => key_file.path
399
- }
400
- end
401
- before(:each) do
402
- File.open(certificate_file.path, "a") do |file|
403
- path = ssc_2.certificate.path
404
- file.puts("\n")
405
- file.puts(IO.read(path))
406
- file.puts("\n")
407
- end
408
- end
409
-
410
- it "should register without errors" do
411
- expect { subject.register }.to_not raise_error
412
- end
413
- end
414
385
  end
415
386
  end
416
387
 
@@ -428,7 +399,12 @@ describe LogStash::Inputs::Tcp do
428
399
  chain_of_certificates = TcpHelpers.new.chain_of_certificates
429
400
 
430
401
  let(:tcp) do
431
- Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
402
+ begin
403
+ socket = TCPSocket.new("127.0.0.1", port)
404
+ rescue Errno::ECONNREFUSED
405
+ sleep 1
406
+ socket = TCPSocket.new("127.0.0.1", port)
407
+ end
432
408
  end
433
409
  let(:sslcontext) do
434
410
  sslcontext = OpenSSL::SSL::SSLContext.new
@@ -526,8 +502,14 @@ describe LogStash::Inputs::Tcp do
526
502
 
527
503
  context "that disconnects before doing TLS handshake" do
528
504
  before do
529
- client = Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
530
- client.close
505
+ begin
506
+ client = TCPSocket.new("127.0.0.1", port)
507
+ client.close
508
+ rescue Errno::ECONNREFUSED
509
+ sleep 1
510
+ client = TCPSocket.new("127.0.0.1", port)
511
+ client.close
512
+ end
531
513
  end
532
514
 
533
515
  it "should not negatively impact the plugin" do
@@ -558,7 +540,7 @@ describe LogStash::Inputs::Tcp do
558
540
  # Assertion to verify this test is actually sending something.
559
541
  expect(garbage.length).to be > 0
560
542
 
561
- client = Stud::try(5.times) { TCPSocket.new("127.0.0.1", port) }
543
+ client = TCPSocket.new("127.0.0.1", port)
562
544
  client.write(garbage)
563
545
  client.flush
564
546
  Thread.new { sleep(1); client.close }
data/version CHANGED
@@ -1 +1 @@
1
- 5.2.7
1
+ 6.0.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.7
4
+ version: 6.0.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2019-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -20,8 +20,8 @@ dependencies:
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.99'
22
22
  name: logstash-core-plugin-api
23
- type: :runtime
24
23
  prerelease: false
24
+ type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -37,8 +37,8 @@ dependencies:
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  name: logstash-codec-plain
40
- type: :runtime
41
40
  prerelease: false
41
+ type: :runtime
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
@@ -51,8 +51,8 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  name: logstash-codec-line
54
- type: :runtime
55
54
  prerelease: false
55
+ type: :runtime
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -65,8 +65,8 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  name: logstash-codec-json
68
- type: :runtime
69
68
  prerelease: false
69
+ type: :runtime
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
@@ -79,8 +79,8 @@ dependencies:
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  name: logstash-codec-json_lines
82
- type: :runtime
83
82
  prerelease: false
83
+ type: :runtime
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
@@ -93,8 +93,8 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  name: logstash-codec-multiline
96
- type: :runtime
97
96
  prerelease: false
97
+ type: :runtime
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -103,31 +103,17 @@ dependencies:
103
103
  - !ruby/object:Gem::Dependency
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - "<"
107
- - !ruby/object:Gem::Version
108
- version: 7.0.0
109
- name: logstash-core
110
- type: :runtime
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "<"
115
- - !ruby/object:Gem::Version
116
- version: 7.0.0
117
- - !ruby/object:Gem::Dependency
118
- requirement: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
106
+ - - ">="
121
107
  - !ruby/object:Gem::Version
122
- version: '1.0'
108
+ version: '0'
123
109
  name: logstash-devutils
124
- type: :development
125
110
  prerelease: false
111
+ type: :development
126
112
  version_requirements: !ruby/object:Gem::Requirement
127
113
  requirements:
128
- - - "~>"
114
+ - - ">="
129
115
  - !ruby/object:Gem::Version
130
- version: '1.0'
116
+ version: '0'
131
117
  - !ruby/object:Gem::Dependency
132
118
  requirement: !ruby/object:Gem::Requirement
133
119
  requirements:
@@ -135,8 +121,8 @@ dependencies:
135
121
  - !ruby/object:Gem::Version
136
122
  version: 0.0.6
137
123
  name: flores
138
- type: :development
139
124
  prerelease: false
125
+ type: :development
140
126
  version_requirements: !ruby/object:Gem::Requirement
141
127
  requirements:
142
128
  - - "~>"
@@ -149,8 +135,8 @@ dependencies:
149
135
  - !ruby/object:Gem::Version
150
136
  version: 0.0.22
151
137
  name: stud
152
- type: :development
153
138
  prerelease: false
139
+ type: :development
154
140
  version_requirements: !ruby/object:Gem::Requirement
155
141
  requirements:
156
142
  - - "~>"
@@ -178,7 +164,7 @@ files:
178
164
  - logstash-input-tcp.gemspec
179
165
  - spec/inputs/tcp_spec.rb
180
166
  - spec/spec_helper.rb
181
- - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/5.2.7/logstash-input-tcp-5.2.7.jar
167
+ - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/6.0.0/logstash-input-tcp-6.0.0.jar
182
168
  - version
183
169
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
184
170
  licenses:
@@ -202,7 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
188
  - !ruby/object:Gem::Version
203
189
  version: '0'
204
190
  requirements: []
205
- rubygems_version: 3.0.6
191
+ rubyforge_project:
192
+ rubygems_version: 2.6.13
206
193
  signing_key:
207
194
  specification_version: 4
208
195
  summary: Reads events from a TCP socket