logstash-input-tcp 4.2.4-java → 5.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
  SHA1:
3
- metadata.gz: fd8137c0bc8676f700dd52d89cc2ecf49391d125
4
- data.tar.gz: ef85b4d90048f471d83fef39f126a81fc1529890
3
+ metadata.gz: 3a4539f2697990b50311f3566e906b0db7bf15b1
4
+ data.tar.gz: b9ce9daff9dae0c227c75ab146a1ab2f689212d8
5
5
  SHA512:
6
- metadata.gz: 17c0e1922f32905b1513175e452ab377e46671b0ac1b7d2b089829f07fb1fdc0e9210c9f43fd80cf324e6b0a2eb3e89d1e91789e77b4ba1baf9d306eee3525da
7
- data.tar.gz: 9248b2d5c5f4c209e22d432d306e55ee3ca374d7f2c439f1067c338814e13073be9328ed95c08b834064e229125b18ebd0a465c02098036b0395f7ff8aa11f1a
6
+ metadata.gz: 9048f5921f48a47c1dbd6194e5fa047a007d92d29cc9c8332ce4cb5ab9ae777cff0ec2e4aa34afa5a9e3ff1075efa05e27b3f50a465c6c9104cc99dcba7cbd23
7
+ data.tar.gz: e8465ea9a17e4fbd96c524fc5cb60992a834f57f1a30a9a242815baed2c1aad9ba89f74d085134d5346fb5a68a4c206d32db39c166d640ff67e4cc47f9bd5a72
data/CHANGELOG.md CHANGED
@@ -1,8 +1,7 @@
1
- ## 4.2.4
2
- - Fix bug where this input would crash logstash during some socket reads when acting as an SSL server
3
-
4
- ## 4.2.3
5
- - Documentation changes
1
+ ## 5.0.0
2
+ - Changed the behaviour of the `host` field to contain the resolved peer hostname for a connection instead of its peer IP
3
+ - Mark deprecated :data_timeout and :ssl_cacert options as obsolete
4
+ and moved the peer's IP to the new field `ip_address`
6
5
 
7
6
  ## 4.2.2
8
7
  - Fixed regression causing incoming connection host ips being accidentally resolved to hostnames
data/docs/index.asciidoc CHANGED
@@ -94,15 +94,6 @@ input plugins.
94
94
 
95
95
   
96
96
 
97
- [id="plugins-{type}s-{plugin}-data_timeout"]
98
- ===== `data_timeout` (DEPRECATED)
99
-
100
- * DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
101
- * Value type is <<number,number>>
102
- * Default value is `-1`
103
-
104
-
105
-
106
97
  [id="plugins-{type}s-{plugin}-host"]
107
98
  ===== `host`
108
99
 
@@ -140,15 +131,6 @@ When mode is `client`, the port to connect to.
140
131
  Proxy protocol support, only v1 is supported at this time
141
132
  http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
142
133
 
143
- [id="plugins-{type}s-{plugin}-ssl_cacert"]
144
- ===== `ssl_cacert` (DEPRECATED)
145
-
146
- * DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
147
- * Value type is <<path,path>>
148
- * There is no default value for this setting.
149
-
150
- The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.
151
-
152
134
  [id="plugins-{type}s-{plugin}-ssl_cert"]
153
135
  ===== `ssl_cert`
154
136
 
@@ -73,7 +73,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
73
73
  # When mode is `client`, the port to connect to.
74
74
  config :port, :validate => :number, :required => true
75
75
 
76
- config :data_timeout, :validate => :number, :default => -1, :deprecated => "This setting is not used by this plugin. It will be removed soon."
76
+ config :data_timeout, :validate => :number, :obsolete => "This setting is not used any more."
77
77
 
78
78
  # Mode to operate in. `server` listens for client connections,
79
79
  # `client` connects to a server.
@@ -90,8 +90,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
90
90
  # For input, sets the field `sslsubject` to that of the client certificate.
91
91
  config :ssl_verify, :validate => :boolean, :default => true
92
92
 
93
- # The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.
94
- config :ssl_cacert, :validate => :path, :deprecated => "This setting is deprecated in favor of ssl_extra_chain_certs as it sets a more clear expectation to add more X509 certificates to the store"
93
+ config :ssl_cacert, :validate => :path, :obsolete => "This setting is obsolete. Use ssl_extra_chain_certs instead"
95
94
 
96
95
  # SSL certificate path
97
96
  config :ssl_cert, :validate => :path
@@ -107,6 +106,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
107
106
  config :ssl_extra_chain_certs, :validate => :array, :default => []
108
107
 
109
108
  HOST_FIELD = "host".freeze
109
+ HOST_IP_FIELD = "[@metdata][ip_address]".freeze
110
110
  PORT_FIELD = "port".freeze
111
111
  PROXY_HOST_FIELD = "proxy_host".freeze
112
112
  PROXY_PORT_FIELD = "proxy_port".freeze
@@ -176,13 +176,14 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
176
176
  @loop.close rescue nil
177
177
  end
178
178
 
179
- def decode_buffer(client_address, client_port, codec, proxy_address, proxy_port, tbuf)
179
+ def decode_buffer(client_ip_address, client_address, client_port, codec, proxy_address,
180
+ proxy_port, tbuf)
180
181
  codec.decode(tbuf) do |event|
181
182
  if @proxy_protocol
182
183
  event.set(PROXY_HOST_FIELD, proxy_address) unless event.get(PROXY_HOST_FIELD)
183
184
  event.set(PROXY_PORT_FIELD, proxy_port) unless event.get(PROXY_PORT_FIELD)
184
185
  end
185
- enqueue_decorated(event, client_address, client_port)
186
+ enqueue_decorated(event, client_ip_address, client_address, client_port)
186
187
  end
187
188
  end
188
189
 
@@ -231,6 +232,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
231
232
 
232
233
  def handle_socket(socket)
233
234
  client_address = socket.peeraddr[3]
235
+ client_ip_address = socket.peeraddr[2]
234
236
  client_port = socket.peeraddr[1]
235
237
  peer = "#{client_address}:#{client_port}"
236
238
  first_read = true
@@ -251,9 +253,11 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
251
253
  proxy_port = pp_info[5]
252
254
  client_address = pp_info[2]
253
255
  client_port = pp_info[4]
256
+ client_ip_address = ''
254
257
  end
255
258
  end
256
- decode_buffer(client_address, client_port, codec, proxy_address, proxy_port, tbuf)
259
+ decode_buffer(client_ip_address, client_address, client_port, codec, proxy_address,
260
+ proxy_port, tbuf)
257
261
  end
258
262
  rescue EOFError
259
263
  @logger.debug? && @logger.debug("Connection closed", :client => peer)
@@ -271,12 +275,13 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
271
275
  socket.close rescue nil
272
276
 
273
277
  codec.respond_to?(:flush) && codec.flush do |event|
274
- enqueue_decorated(event, client_address, client_port)
278
+ enqueue_decorated(event, client_ip_address, client_address, client_port)
275
279
  end
276
280
  end
277
281
 
278
- def enqueue_decorated(event, client_address, client_port)
282
+ def enqueue_decorated(event, client_ip_address, client_address, client_port)
279
283
  event.set(HOST_FIELD, client_address) unless event.get(HOST_FIELD)
284
+ event.set(HOST_IP_FIELD, client_ip_address) unless event.get(HOST_IP_FIELD)
280
285
  event.set(PORT_FIELD, client_port) unless event.get(PORT_FIELD)
281
286
  decorate(event)
282
287
  @output_queue << event
@@ -308,11 +313,6 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
308
313
  def load_cert_store
309
314
  cert_store = OpenSSL::X509::Store.new
310
315
  cert_store.set_default_paths
311
- if File.directory?(@ssl_cacert)
312
- cert_store.add_path(@ssl_cacert)
313
- else
314
- cert_store.add_file(@ssl_cacert)
315
- end if @ssl_cacert
316
316
  @ssl_extra_chain_certs.each do |cert|
317
317
  cert_store.add_file(cert)
318
318
  end
@@ -21,7 +21,7 @@ class DecoderImpl
21
21
  if @first_read
22
22
  tbuf = init_first_read(channel_addr, tbuf)
23
23
  end
24
- @tcp.decode_buffer(@address, @port, @codec,
24
+ @tcp.decode_buffer(@ip_address, @address, @port, @codec,
25
25
  @proxy_address, @proxy_port, tbuf)
26
26
  end
27
27
 
@@ -46,7 +46,8 @@ class DecoderImpl
46
46
  end
47
47
  else
48
48
  filtered = received
49
- @address = channel_addr.get_address.get_host_address
49
+ @ip_address = channel_addr.get_address.get_host_address
50
+ @address = channel_addr.get_host_name
50
51
  @port = channel_addr.get_port
51
52
  end
52
53
  @first_read = false
@@ -45,7 +45,7 @@ describe LogStash::Inputs::Tcp do
45
45
  }
46
46
  CONFIG
47
47
 
48
- host = '127.0.0.1'
48
+ host = 'localhost'
49
49
  events = input(conf) do |pipeline, queue|
50
50
  socket = Stud::try(5.times) { TCPSocket.new(host, port) }
51
51
  event_count.times do |i|
@@ -63,6 +63,7 @@ describe LogStash::Inputs::Tcp do
63
63
  event = events[i]
64
64
  insist { event.get("message") } == "#{i} ☹"
65
65
  insist { event.get("host") } == host
66
+ insist { event.get("[@metdata][ip_address]") } == '127.0.0.1'
66
67
  end
67
68
  end
68
69
 
data/version CHANGED
@@ -1 +1 @@
1
- 4.2.4
1
+ 5.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: 4.2.4
4
+ version: 5.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: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ files:
147
147
  - logstash-input-tcp.gemspec
148
148
  - spec/inputs/tcp_spec.rb
149
149
  - spec/spec_helper.rb
150
- - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/4.2.4/logstash-input-tcp-4.2.4.jar
150
+ - vendor/jar-dependencies/org/logstash/inputs/logstash-input-tcp/5.0.0/logstash-input-tcp-5.0.0.jar
151
151
  - version
152
152
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
153
153
  licenses: