logstash-output-tcp 5.0.4 → 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: c1daa767cf92bff4f20058bc66c08898e89fefba31dc99ae3eb0171101a5e143
4
- data.tar.gz: 1518bd235d036c6cfb538773dee084399e8f9a664c31df2667b1e8725f412e3c
3
+ metadata.gz: f565b112e5a38f65bebf7c13061e0b7de65a460952afdc93bcf145998bd6ae30
4
+ data.tar.gz: 97b30dfceff9b0d2187c408e3ac5fe4abc8def98e9fdd4e59580fa2f0d112ef9
5
5
  SHA512:
6
- metadata.gz: d0caa01c562e8a919569a9a7545f481eb6af8ef8fc80c8198613d3abde6ff3b3fee84006949a816218cd92255235cf17d5e5e3ffe5d770a06001ea751716fcd6
7
- data.tar.gz: e28019c283857fb53553dec35e1a434caf19ccaaabd276e71e40321cc333ead2580d1fd2c02eabece191f2010b7edc98910800b5b40d6268df7d78d3dc43944a
6
+ metadata.gz: ffec33897e55cd02b237b385dc4e6ffe1d90f2bb87b2fc4b1dbd4bb050f1db9787038885b7fbd77539b9e60fab1a44e1f9567925f7dc8a36eaab4be0d158b2a3
7
+ data.tar.gz: cb2c4871d74fd661ee2d947a94535483fd54854fee574d4615a05634df74b97fedb6e01d73f645e8cc70e41de80fbf1eeceaa466855ff757cc320f19130f8362
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
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
+
4
+ ## 6.0.1
5
+ - Fixed logging fail retry to stdout [#43](https://github.com/logstash-plugins/logstash-output-tcp/pull/43)
6
+ - Fixed to use `reconnect_interval` when establish a connection
7
+
8
+ ## 6.0.0
9
+ - Removed obsolete field `message_format`
10
+
1
11
  ## 5.0.4
2
12
  - Removed requirement to have a certificate/key pair when enabling ssl
3
13
 
data/LICENSE CHANGED
@@ -1,13 +1,202 @@
1
- Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
2
1
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
6
5
 
7
- http://www.apache.org/licenses/LICENSE-2.0
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2020 Elastic and contributors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-output-tcp.svg)](https://travis-ci.org/logstash-plugins/logstash-output-tcp)
3
+ [![Travis Build Status](https://travis-ci.com/logstash-plugins/logstash-output-tcp.svg)](https://travis-ci.com/logstash-plugins/logstash-output-tcp)
4
4
 
5
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
6
6
 
@@ -51,8 +51,6 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
51
51
  # SSL key passphrase
52
52
  config :ssl_key_passphrase, :validate => :password, :default => nil
53
53
 
54
- config :message_format, :validate => :string, :obsolete => "This setting is obsolete. The event will be formatted according to the codec used"
55
-
56
54
  class Client
57
55
  public
58
56
  def initialize(socket, logger)
@@ -88,7 +86,10 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
88
86
  if @ssl_cert
89
87
  @ssl_context.cert = OpenSSL::X509::Certificate.new(File.read(@ssl_cert))
90
88
  if @ssl_key
91
- @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 || '')
92
93
  end
93
94
  end
94
95
  if @ssl_verify
@@ -175,15 +176,14 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
175
176
 
176
177
  private
177
178
  def connect
178
- Stud::try do
179
+ begin
179
180
  client_socket = TCPSocket.new(@host, @port)
180
181
  if @ssl_enable
181
182
  client_socket = OpenSSL::SSL::SSLSocket.new(client_socket, @ssl_context)
182
183
  begin
183
184
  client_socket.connect
184
185
  rescue OpenSSL::SSL::SSLError => ssle
185
- @logger.error("SSL Error", :exception => ssle,
186
- :backtrace => ssle.backtrace)
186
+ @logger.error("SSL Error", :exception => ssle, :backtrace => ssle.backtrace)
187
187
  # NOTE(mrichar1): Hack to prevent hammering peer
188
188
  sleep(5)
189
189
  raise
@@ -192,6 +192,10 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
192
192
  client_socket.instance_eval { class << self; include ::LogStash::Util::SocketPeer end }
193
193
  @logger.debug("Opened connection", :client => "#{client_socket.peer}")
194
194
  return client_socket
195
+ rescue StandardError => e
196
+ @logger.error("Failed to connect: #{e.message}", :exception => e.class, :backtrace => e.backtrace)
197
+ sleep @reconnect_interval
198
+ retry
195
199
  end
196
200
  end # def connect
197
201
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-tcp'
4
- s.version = '5.0.4'
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
+ BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW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4MHjqW8LtLOIlyGSHwI7
19
+ /Xl6ode7RdqmmJNcVgZDMyevpQH2TQP4UMaLS3bRFY4BB27iPt2+3bXuzWHI43OX
20
+ rnx8JbcqkljdxamnxWiDDp42TSIUj9p+m3S/V3Suku3h4qyKcO4A97tvo28Jr69M
21
+ 1mpMGMi10FlBP25irKWL8QKBgQCZqKlnjrWwA24QROJnpoupeiMkIRH0m9rS/Kwb
22
+ YqHZEQoALTyEwTnpaxxLxXlecYiWCZGNCLFCEG2rcQBJhZv8xxLQC8yzNDtzKQJu
23
+ saRxYQG75ytXky94lebzLoIMmIcPVz13g9TblKZHKSHT9OUCdvewdhqXN8klLrh8
24
+ J3gafwKBgQDcn/8lzfmbsKO/V9fzEbqUQJOJkwyf2adLFD+KlHM3+VAghnj70j05
25
+ 1XDkQ3LOgKrqPdC/HIGjjlkTn6vaieXltHguMg99nPpzj+LXrtN22ru2eTjjUNsD
26
+ +uB9N4kgUAR00xu60xkkOSK1TcudeL5uwejO2ul0tkDu1YGDvhXymA==
27
+ -----END RSA PRIVATE KEY-----
@@ -10,12 +10,13 @@ describe LogStash::Outputs::Tcp do
10
10
  } }
11
11
 
12
12
  context "when enabling SSL" do
13
- let(:config) { super.merge("ssl_enable" => true) }
13
+ let(:config) { super().merge("ssl_enable" => true) }
14
14
  context "and not providing a certificate/key pair" do
15
15
  it "registers without error" 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: 5.0.4
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: 2019-01-02 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:
@@ -125,10 +129,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
129
  - !ruby/object:Gem::Version
126
130
  version: '0'
127
131
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.6.13
132
+ rubygems_version: 3.1.6
130
133
  signing_key:
131
134
  specification_version: 4
132
135
  summary: Writes events over a TCP socket
133
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
134
141
  - spec/outputs/tcp_spec.rb