logstash-input-elastic_serverless_forwarder 0.1.2-java → 0.1.4-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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de05ac4680e3274f57b3a934e616127d9efe8702f16c63bdf2e9f5afd08bdab4
|
4
|
+
data.tar.gz: 13e09a76c888dcb3db065cb50e678738a5561c339eecfc79318119c321e7437a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1580d128d385d1523dce54fc23dcd8161536ddb2339eaac43f187cf44cc318e3e17e8ab1a3d2532221798c1b13da324cd7d8121487a9b36f7fb4b7d9fb84a507
|
7
|
+
data.tar.gz: 88bb2ebf1aed3c24ad21e4af63320bc7809e85686bbe1b34cfdeb3c6f076c6798284e3eda83d6e87d2b6e2c47ec783023605c099d1be0fba9552e22abf211398
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 0.1.4
|
2
|
+
- [DOC] Adds tips for using the logstash-input-elastic_serverless_forwarder plugin with the Elasticsearch output plugin [#7](https://github.com/logstash-plugins/logstash-input-elastic_serverless_forwarder/pull/7)
|
3
|
+
|
4
|
+
## 0.1.3
|
5
|
+
- Deprecates the `ssl` option in favor of `ssl_enabled` [#6](https://github.com/logstash-plugins/logstash-input-elastic_serverless_forwarder/pull/6)
|
6
|
+
- Bumps `logstash-input-http` gem version to `>= 3.7.2` (SSL-normalized)
|
7
|
+
|
1
8
|
## 0.1.2
|
2
9
|
- [DOC] Adds "Technical Preview" call-out to documentation [#4](https://github.com/logstash-plugins/logstash-input-elastic_serverless_forwarder/pull/4)
|
3
10
|
|
data/docs/index.asciidoc
CHANGED
@@ -51,7 +51,7 @@ input {
|
|
51
51
|
input {
|
52
52
|
elastic_serverless_forwarder {
|
53
53
|
port => 8080
|
54
|
-
|
54
|
+
ssl_enabled => false
|
55
55
|
}
|
56
56
|
}
|
57
57
|
----
|
@@ -132,6 +132,36 @@ You can configure this plugin to authenticate requests using HTTP Basic authenti
|
|
132
132
|
NOTE: Basic Authentication is not a substitute for SSL, as it provides neither secrecy nor security on its own.
|
133
133
|
When used with SSL disabled, HTTP Basic credentials are transmitted in effectively clear-text and can be easily recovered by an adversary.
|
134
134
|
|
135
|
+
[id="plugins-{type}s-{plugin}-es-output-notes"]
|
136
|
+
==== Using {esf-name} with the Elasticsearch output
|
137
|
+
Here are some tips for configuring the {esf} input to work with the elasticsearch output:
|
138
|
+
|
139
|
+
* Set the `document_id` in the output configuration when you use the {esf} input with an {logstash-ref}/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch[Elasticsearch output plugin].
|
140
|
+
+
|
141
|
+
[source,ruby]
|
142
|
+
----
|
143
|
+
output {
|
144
|
+
elasticsearch {
|
145
|
+
...
|
146
|
+
document_id => "%{[@metadata][_id]}"
|
147
|
+
...
|
148
|
+
}
|
149
|
+
}
|
150
|
+
----
|
151
|
+
* Starting from version 1.10.0 of {esf-name}, configuring `document_id` as shown in the example above is sufficient (the `_id` field is no longer available, and instead, Logstash now receives the `@metadata._id` field).
|
152
|
+
|
153
|
+
* For {esf-name} v1.9.0 and earlier, rename the field `_id` to `@metadata._id` with a filter:
|
154
|
+
+
|
155
|
+
[source,ruby]
|
156
|
+
----
|
157
|
+
filter {
|
158
|
+
# support ESF < 1.10
|
159
|
+
if [_id] and ![@metadata][_id] {
|
160
|
+
mutate { rename => { "_id" => "[@metadata][_id]" } }
|
161
|
+
}
|
162
|
+
}
|
163
|
+
----
|
164
|
+
|
135
165
|
[id="plugins-{type}s-{plugin}-options"]
|
136
166
|
==== {esf-name} Input Configuration Options
|
137
167
|
|
@@ -144,11 +174,12 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
144
174
|
| <<plugins-{type}s-{plugin}-auth_basic_password>> |<<password,password>>|No
|
145
175
|
| <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
|
146
176
|
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
|
147
|
-
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|
|
177
|
+
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|__Deprecated__
|
148
178
|
| <<plugins-{type}s-{plugin}-ssl_certificate>> |a valid filesystem path|No
|
149
179
|
| <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> |<<array,array>>|No
|
150
180
|
| <<plugins-{type}s-{plugin}-ssl_client_authentication>> |<<string,string>>, one of `["none", "optional", "required"]`|No
|
151
181
|
| <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |<<array,array>>|No
|
182
|
+
| <<plugins-{type}s-{plugin}-ssl_enabled>> |<<boolean,boolean>>|No
|
152
183
|
| <<plugins-{type}s-{plugin}-ssl_handshake_timeout>> |<<number,number>>|No
|
153
184
|
| <<plugins-{type}s-{plugin}-ssl_key>> |a valid filesystem path|No
|
154
185
|
| <<plugins-{type}s-{plugin}-ssl_key_passphrase>> |<<password,password>>|No
|
@@ -197,6 +228,7 @@ The TCP port to bind to
|
|
197
228
|
|
198
229
|
[id="plugins-{type}s-{plugin}-ssl"]
|
199
230
|
===== `ssl`
|
231
|
+
deprecated[0.1.3, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
|
200
232
|
|
201
233
|
* Value type is <<boolean,boolean>>
|
202
234
|
* Default value is `true`
|
@@ -255,6 +287,17 @@ By default the server doesn't do any client authentication.
|
|
255
287
|
This means that connections from clients are _private_ when SSL is enabled, but that this input will allow SSL connections from _any_ client.
|
256
288
|
If you wish to configure this plugin to reject connections from untrusted hosts, you will need to configure this plugin to authenticate clients, and may also need to configure it with a list of `ssl_certificate_authorities`.
|
257
289
|
|
290
|
+
|
291
|
+
[id="plugins-{type}s-{plugin}-ssl_enabled"]
|
292
|
+
===== `ssl_enabled`
|
293
|
+
|
294
|
+
* Value type is <<boolean,boolean>>
|
295
|
+
* Default value is `true`
|
296
|
+
|
297
|
+
Events are, by default, sent over SSL, which requires configuring this plugin to present an identity certificate using <<plugins-{type}s-{plugin}-ssl_certificate>> and key using <<plugins-{type}s-{plugin}-ssl_key>>.
|
298
|
+
|
299
|
+
You can disable SSL with `+ssl_enabled => false+`.
|
300
|
+
|
258
301
|
[id="plugins-{type}s-{plugin}-ssl_handshake_timeout"]
|
259
302
|
===== `ssl_handshake_timeout`
|
260
303
|
|
@@ -3,12 +3,14 @@ require "logstash/inputs/base"
|
|
3
3
|
require "logstash/namespace"
|
4
4
|
|
5
5
|
require "logstash/plugin_mixins/plugin_factory_support"
|
6
|
+
require "logstash/plugin_mixins/normalize_config_support"
|
6
7
|
|
7
8
|
require 'logstash/inputs/http'
|
8
9
|
require 'logstash/codecs/json_lines'
|
9
10
|
|
10
11
|
class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
11
12
|
include LogStash::PluginMixins::PluginFactorySupport
|
13
|
+
include LogStash::PluginMixins::NormalizeConfigSupport
|
12
14
|
|
13
15
|
config_name "elastic_serverless_forwarder"
|
14
16
|
|
@@ -21,7 +23,8 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
21
23
|
config :auth_basic_password, :validate => :password
|
22
24
|
|
23
25
|
# ssl-config
|
24
|
-
config :ssl, :validate => :boolean, :default => true
|
26
|
+
config :ssl, :validate => :boolean, :default => true, :deprecated => "Use 'ssl_enabled' instead."
|
27
|
+
config :ssl_enabled, :validate => :boolean, :default => true
|
25
28
|
|
26
29
|
# ssl-identity
|
27
30
|
config :ssl_certificate, :validate => :path
|
@@ -38,20 +41,11 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
38
41
|
config :ssl_supported_protocols, :validate => :string, :list => true
|
39
42
|
config :ssl_handshake_timeout, :validate => :number, :default => 10_000
|
40
43
|
|
41
|
-
# we present the ES-like ssl_certificate_authorities, but our
|
42
|
-
# internal http input plugin uses ssl_verify_mode to describe
|
43
|
-
# the same behaviour.
|
44
|
-
SSL_CLIENT_AUTHENTICATION_TO_VERIFY_MODE_MAP = {
|
45
|
-
'none' => 'none',
|
46
|
-
'optional' => 'peer',
|
47
|
-
'required' => 'force_peer',
|
48
|
-
}.each_value(&:freeze).freeze # deep freeze
|
49
|
-
private_constant :SSL_CLIENT_AUTHENTICATION_TO_VERIFY_MODE_MAP
|
50
|
-
|
51
|
-
|
52
44
|
def initialize(*a)
|
53
45
|
super
|
54
46
|
|
47
|
+
normalize_ssl_configs!
|
48
|
+
|
55
49
|
if original_params.include?('codec')
|
56
50
|
fail LogStash::ConfigurationError, 'The `elastic_serverless_forwarder` input does not have an externally-configurable `codec`'
|
57
51
|
end
|
@@ -109,14 +103,14 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
109
103
|
if @auth_basic_username
|
110
104
|
http_options['user'] = @auth_basic_username
|
111
105
|
http_options['password'] = @auth_basic_password || fail(LogStash::ConfigurationError, '`auth_basic_password` is REQUIRED when `auth_basic_username` is provided')
|
112
|
-
logger.warn("HTTP Basic Auth over non-secured connection") if @
|
106
|
+
logger.warn("HTTP Basic Auth over non-secured connection") if @ssl_enabled == false
|
113
107
|
end
|
114
108
|
|
115
|
-
if @
|
109
|
+
if @ssl_enabled == false
|
116
110
|
ignored_ssl_settings = @original_params.keys.grep('ssl_')
|
117
|
-
logger.warn("Explicit SSL-related settings are ignored because `
|
111
|
+
logger.warn("Explicit SSL-related settings are ignored because `ssl_enabled => false`: #{ignored_ssl_settings.keys}") if ignored_ssl_settings.any?
|
118
112
|
else
|
119
|
-
http_options['
|
113
|
+
http_options['ssl_enabled'] = true
|
120
114
|
|
121
115
|
http_options['ssl_cipher_suites'] = @ssl_cipher_suites if @original_params.include?('ssl_cipher_suites')
|
122
116
|
http_options['ssl_supported_protocols'] = @ssl_supported_protocols if @original_params.include?('ssl_supported_protocols')
|
@@ -131,9 +125,10 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
131
125
|
end
|
132
126
|
|
133
127
|
def ssl_identity_options
|
128
|
+
ssl_enabled_config = @original_params.include?('ssl') ? 'ssl' : 'ssl_enabled'
|
134
129
|
identity_options = {
|
135
|
-
'ssl_certificate' => @ssl_certificate || fail(LogStash::ConfigurationError,
|
136
|
-
'ssl_key' => @ssl_key || fail(LogStash::ConfigurationError,
|
130
|
+
'ssl_certificate' => @ssl_certificate || fail(LogStash::ConfigurationError, "`ssl_certificate` is REQUIRED when `#{ssl_enabled_config} => true`"),
|
131
|
+
'ssl_key' => @ssl_key || fail(LogStash::ConfigurationError, "`ssl_key` is REQUIRED when `#{ssl_enabled_config} => true`")
|
137
132
|
}
|
138
133
|
identity_options['ssl_key_passphrase'] = @ssl_key_passphrase if @original_params.include?('ssl_key_passphrase')
|
139
134
|
|
@@ -142,7 +137,7 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
142
137
|
|
143
138
|
def ssl_trust_options
|
144
139
|
trust_options = {
|
145
|
-
'
|
140
|
+
'ssl_client_authentication' => @ssl_client_authentication
|
146
141
|
}
|
147
142
|
if @ssl_client_authentication == 'none'
|
148
143
|
logger.warn("Explicit `ssl_certificate_authorities` is ignored because `ssl_client_authentication => #{@ssl_client_authentication}`")
|
@@ -160,6 +155,12 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
|
|
160
155
|
}
|
161
156
|
end
|
162
157
|
|
158
|
+
def normalize_ssl_configs!
|
159
|
+
@ssl_enabled = normalize_config(:ssl_enabled) do |normalizer|
|
160
|
+
normalizer.with_deprecated_alias(:ssl)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
163
164
|
class QueueWrapper
|
164
165
|
def initialize(wrapped_queue)
|
165
166
|
@wrapped_queue = wrapped_queue
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'logstash-input-elastic_serverless_forwarder'
|
5
|
-
s.version = '0.1.
|
5
|
+
s.version = '0.1.4'
|
6
6
|
s.licenses = ['Apache License (2.0)']
|
7
7
|
s.summary = "Receives events from Elastic Serverless Forwarder over HTTP or HTTPS"
|
8
8
|
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"
|
@@ -23,8 +23,9 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
24
24
|
s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.2'
|
25
25
|
s.add_runtime_dependency 'logstash-mixin-plugin_factory_support'
|
26
|
-
s.add_runtime_dependency 'logstash-input-http'
|
26
|
+
s.add_runtime_dependency 'logstash-input-http', '>= 3.7.2'
|
27
27
|
s.add_runtime_dependency 'logstash-codec-json_lines'
|
28
|
+
s.add_runtime_dependency 'logstash-mixin-normalize_config_support', '~>1.0'
|
28
29
|
|
29
30
|
s.add_development_dependency 'logstash-devutils'
|
30
31
|
|
@@ -28,7 +28,7 @@ describe LogStash::Inputs::ElasticServerlessForwarder do
|
|
28
28
|
let!(:queue) { Queue.new }
|
29
29
|
|
30
30
|
context 'baseline' do
|
31
|
-
let(:config) { super().merge('
|
31
|
+
let(:config) { super().merge('ssl_enabled' => false) }
|
32
32
|
let(:scheme) { 'http' }
|
33
33
|
|
34
34
|
it_behaves_like "an interruptible input plugin" do
|
@@ -45,7 +45,7 @@ describe LogStash::Inputs::ElasticServerlessForwarder do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'no user-defined codec' do
|
48
|
-
let(:config) { super().merge('
|
48
|
+
let(:config) { super().merge('ssl_enabled' => false) } # minimal config
|
49
49
|
|
50
50
|
##
|
51
51
|
# @codec ivar is required PENDING https://github.com/elastic/logstash/issues/14828
|
@@ -185,7 +185,7 @@ describe LogStash::Inputs::ElasticServerlessForwarder do
|
|
185
185
|
end
|
186
186
|
|
187
187
|
describe 'unsecured HTTP' do
|
188
|
-
let(:config) { super().merge('
|
188
|
+
let(:config) { super().merge('ssl_enabled' => false) }
|
189
189
|
let(:scheme) { 'http' }
|
190
190
|
|
191
191
|
include_examples 'successful request handling'
|
@@ -321,4 +321,23 @@ describe LogStash::Inputs::ElasticServerlessForwarder do
|
|
321
321
|
end
|
322
322
|
end
|
323
323
|
end
|
324
|
+
|
325
|
+
describe 'deprecated SSL options' do
|
326
|
+
let(:config) do
|
327
|
+
super().merge({
|
328
|
+
'ssl_certificate' => generated_certs_directory.join('server_from_root.crt').to_path,
|
329
|
+
'ssl_key' => generated_certs_directory.join('server_from_root.key.pkcs8').to_path,
|
330
|
+
})
|
331
|
+
end
|
332
|
+
|
333
|
+
[true, false].each do |enabled|
|
334
|
+
context "when `ssl => #{enabled}`" do
|
335
|
+
let(:config) { super().merge('ssl' => enabled) }
|
336
|
+
|
337
|
+
it "sets @ssl_enabled to `#{enabled}`" do
|
338
|
+
expect(esf_input.instance_variable_get(:@ssl_enabled)).to be enabled
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
324
343
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-elastic_serverless_forwarder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,7 +63,7 @@ dependencies:
|
|
63
63
|
requirements:
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
66
|
+
version: 3.7.2
|
67
67
|
name: logstash-input-http
|
68
68
|
prerelease: false
|
69
69
|
type: :runtime
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 3.7.2
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.0'
|
95
|
+
name: logstash-mixin-normalize_config_support
|
96
|
+
prerelease: false
|
97
|
+
type: :runtime
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '1.0'
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
requirement: !ruby/object:Gem::Requirement
|
91
105
|
requirements:
|
@@ -160,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
174
|
- !ruby/object:Gem::Version
|
161
175
|
version: '0'
|
162
176
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
177
|
+
rubygems_version: 3.2.33
|
164
178
|
signing_key:
|
165
179
|
specification_version: 4
|
166
180
|
summary: Receives events from Elastic Serverless Forwarder over HTTP or HTTPS
|