logstash-output-tcp 6.0.1 → 6.0.2

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: 1412e1fa9376c990f9983c62c84d5b40c7169df77ab387c4637851fdaf43deaf
4
- data.tar.gz: b7827ef1dc46b3bbeef55ad259250f868460685f7a2b16a0842e3309eda4f844
3
+ metadata.gz: f565b112e5a38f65bebf7c13061e0b7de65a460952afdc93bcf145998bd6ae30
4
+ data.tar.gz: 97b30dfceff9b0d2187c408e3ac5fe4abc8def98e9fdd4e59580fa2f0d112ef9
5
5
  SHA512:
6
- metadata.gz: d34636d36f87a3c5d632263f603bf6816f88d3033d0394aba9f84438819b008bfc6cd66cf16baf2a1a2cff55e72e5f52b382c00422f2fcaaf5f5b883f7404ee8
7
- data.tar.gz: 50f4c2ef7feba191fd0d6cc815353ec1cafb09a7acfa74a328d9a3594c74bff96b8a61f61df11b1b44022fd6e3ce32f975d54c532cc70e6e1594dd8534a531b3
6
+ metadata.gz: ffec33897e55cd02b237b385dc4e6ffe1d90f2bb87b2fc4b1dbd4bb050f1db9787038885b7fbd77539b9e60fab1a44e1f9567925f7dc8a36eaab4be0d158b2a3
7
+ data.tar.gz: cb2c4871d74fd661ee2d947a94535483fd54854fee574d4615a05634df74b97fedb6e01d73f645e8cc70e41de80fbf1eeceaa466855ff757cc320f19130f8362
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.0.2
2
+ - Fix: unable to start with password protected key [#45](https://github.com/logstash-plugins/logstash-output-tcp/pull/45)
3
+
1
4
  ## 6.0.1
2
5
  - Fixed logging fail retry to stdout [#43](https://github.com/logstash-plugins/logstash-output-tcp/pull/43)
3
6
  - Fixed to use `reconnect_interval` when establish a connection
@@ -86,7 +86,10 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
86
86
  if @ssl_cert
87
87
  @ssl_context.cert = OpenSSL::X509::Certificate.new(File.read(@ssl_cert))
88
88
  if @ssl_key
89
- @ssl_context.key = OpenSSL::PKey::RSA.new(File.read(@ssl_key),@ssl_key_passphrase)
89
+ # if we have an encrypted key and a password is not provided (nil) than OpenSSL::PKey::RSA
90
+ # prompts the user to enter a password interactively - we do not want to do that,
91
+ # for plain-text keys the default '' password argument gets simply ignored
92
+ @ssl_context.key = OpenSSL::PKey::RSA.new(File.read(@ssl_key), @ssl_key_passphrase.value || '')
90
93
  end
91
94
  end
92
95
  if @ssl_verify
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-tcp'
4
- s.version = '6.0.1'
4
+ s.version = '6.0.2'
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"
@@ -0,0 +1,19 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDIjCCAgqgAwIBAgIUTCjyocBgCYSWU/GYI58F0IBXLHswDQYJKoZIhvcNAQEL
3
+ BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l
4
+ cmF0ZWQgQ0EwHhcNMjIwMzIxMDc1NTU2WhcNMjUwMzIwMDc1NTU2WjATMREwDwYD
5
+ VQQDEwhpbnN0YW5jZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJKT
6
+ f0FF/R9WBC7lwN0IJdOn+jPJJ+4M3LY/sfFuTaAUgPSaiRLLzCjox1p1Xy9z+xyk
7
+ C2Dkhb4FdOZBNqS/w0Z7lkrha8VZg2UKW4+i1lq4ANPl9sP9YCbh1R+SRdpHnZX7
8
+ APG798+0+NC4GmEeOIFfWsEE4MiFXAPunhAlAbxMl6e5htX4cgYWMbH67Ur1/uQB
9
+ 26Y6PBahKP7dbxaL/ugPE6MDmmA+cNRWMa21Ay2h94Ies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LFD+KlHM3+VAghnj70j05
25
+ 1XDkQ3LOgKrqPdC/HIGjjlkTn6vaieXltHguMg99nPpzj+LXrtN22ru2eTjjUNsD
26
+ +uB9N4kgUAR00xu60xkkOSK1TcudeL5uwejO2ul0tkDu1YGDvhXymA==
27
+ -----END RSA PRIVATE KEY-----
@@ -16,6 +16,7 @@ describe LogStash::Outputs::Tcp do
16
16
  expect { subject.register }.to_not raise_error
17
17
  end
18
18
  end
19
+
19
20
  context "and providing a certificate/key pair" do
20
21
  let(:cert_key_pair) { Flores::PKI.generate }
21
22
  let(:certificate) { cert_key_pair.first }
@@ -24,10 +25,52 @@ describe LogStash::Outputs::Tcp do
24
25
  IO.write(path, certificate.to_s)
25
26
  path
26
27
  end
27
- let(:config) { super().merge("ssl_cert" => true, "ssl_cert" => cert_file) }
28
+ let(:config) { super().merge("ssl_cert" => cert_file) }
28
29
  it "registers without error" do
29
30
  expect { subject.register }.to_not raise_error
30
31
  end
31
32
  end
33
+
34
+ FIXTURES_PATH = File.expand_path('../fixtures', File.dirname(__FILE__))
35
+
36
+ context "ES generated plain-text certificate/key" do
37
+ let(:key_file) { File.join(FIXTURES_PATH, 'plaintext/instance.key') }
38
+ let(:crt_file) { File.join(FIXTURES_PATH, 'plaintext/instance.crt') }
39
+ let(:config) { super().merge("ssl_cert" => crt_file, "ssl_key" => key_file) }
40
+
41
+ it "registers without error" do
42
+ expect { subject.register }.to_not raise_error
43
+ end
44
+
45
+ context 'with password set' do
46
+
47
+ let(:config) { super().merge("ssl_key_passphrase" => 'ignored') }
48
+
49
+ it "registers without error" do # password simply ignored
50
+ expect { subject.register }.to_not raise_error
51
+ end
52
+
53
+ end
54
+ end
55
+
56
+ context "encrypted key using PKCS#1" do
57
+ let(:key_file) { File.join(FIXTURES_PATH, 'encrypted/instance.key') }
58
+ let(:crt_file) { File.join(FIXTURES_PATH, 'encrypted/instance.crt') }
59
+ let(:config) { super().merge("ssl_cert" => crt_file, "ssl_key" => key_file) }
60
+
61
+ it "registers with error (due missing password)" do
62
+ expect { subject.register }.to raise_error(OpenSSL::PKey::RSAError) # TODO need a better error
63
+ end
64
+
65
+ context 'with valid password' do
66
+
67
+ let(:config) { super().merge("ssl_key_passphrase" => '1234567890') }
68
+
69
+ it "registers without error" do
70
+ expect { subject.register }.to_not raise_error
71
+ end
72
+
73
+ end
74
+ end
32
75
  end
33
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +103,10 @@ files:
103
103
  - docs/index.asciidoc
104
104
  - lib/logstash/outputs/tcp.rb
105
105
  - logstash-output-tcp.gemspec
106
+ - spec/fixtures/encrypted/instance.crt
107
+ - spec/fixtures/encrypted/instance.key
108
+ - spec/fixtures/plaintext/instance.crt
109
+ - spec/fixtures/plaintext/instance.key
106
110
  - spec/outputs/tcp_spec.rb
107
111
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
108
112
  licenses:
@@ -130,4 +134,8 @@ signing_key:
130
134
  specification_version: 4
131
135
  summary: Writes events over a TCP socket
132
136
  test_files:
137
+ - spec/fixtures/encrypted/instance.crt
138
+ - spec/fixtures/encrypted/instance.key
139
+ - spec/fixtures/plaintext/instance.crt
140
+ - spec/fixtures/plaintext/instance.key
133
141
  - spec/outputs/tcp_spec.rb