logstash-input-elastic_serverless_forwarder 0.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +2 -0
  3. data/DEVELOPER.md +1 -0
  4. data/Gemfile +11 -0
  5. data/LICENSE +202 -0
  6. data/NOTICE.TXT +1 -0
  7. data/README.md +98 -0
  8. data/docs/index.asciidoc +307 -0
  9. data/lib/logstash/inputs/elastic_serverless_forwarder.rb +172 -0
  10. data/logstash-input-elastic_serverless_forwarder.gemspec +32 -0
  11. data/spec/fixtures/certs/generate.sh +58 -0
  12. data/spec/fixtures/certs/generated/README.txt +2 -0
  13. data/spec/fixtures/certs/generated/client_from_root.crt +35 -0
  14. data/spec/fixtures/certs/generated/client_from_root.jks +0 -0
  15. data/spec/fixtures/certs/generated/client_from_root.key +51 -0
  16. data/spec/fixtures/certs/generated/client_from_root.key.pkcs8 +52 -0
  17. data/spec/fixtures/certs/generated/client_from_root.p12 +0 -0
  18. data/spec/fixtures/certs/generated/client_no_matching_subject.crt +35 -0
  19. data/spec/fixtures/certs/generated/client_no_matching_subject.key +51 -0
  20. data/spec/fixtures/certs/generated/client_no_matching_subject.p12 +0 -0
  21. data/spec/fixtures/certs/generated/client_self_signed.crt +30 -0
  22. data/spec/fixtures/certs/generated/client_self_signed.key +52 -0
  23. data/spec/fixtures/certs/generated/client_self_signed.p12 +0 -0
  24. data/spec/fixtures/certs/generated/root.crt +32 -0
  25. data/spec/fixtures/certs/generated/root.key +51 -0
  26. data/spec/fixtures/certs/generated/server_from_root.crt +36 -0
  27. data/spec/fixtures/certs/generated/server_from_root.key +51 -0
  28. data/spec/fixtures/certs/generated/server_from_root.key.pkcs8 +52 -0
  29. data/spec/fixtures/certs/generated/server_from_root.pkcs8.key +52 -0
  30. data/spec/fixtures/certs/openssl.cnf +57 -0
  31. data/spec/inputs/elastic_serverless_forwarder_spec.rb +292 -0
  32. metadata +188 -0
@@ -0,0 +1,51 @@
1
+ -----BEGIN RSA PRI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HKTTanRPnicLG
49
+ 0+mqU4EZUsASZsiqyj8P/Dy2AgM7yfM9HF4YJvzuWIdHyMKstCfTeW7UZEhSTOoe
50
+ YGxOrYKR/tXeV9vCZ4W5zeBHvM0q/JGxxFJrPMrnlV/hJrxjcFqVxs/Oy95sDmPP
51
+ BvFNJDUcR4oK4zo/O1idLaHDNrdFq1o=
52
+ -----END PRIVATE KEY-----
@@ -0,0 +1,57 @@
1
+ [ req ]
2
+ distinguished_name= req_distinguished_name
3
+ attributes= req_attributes
4
+
5
+ [ req_distinguished_name ]
6
+ countryName= Country Name (2 letter code)
7
+ countryName_min= 2
8
+ countryName_max= 2
9
+ stateOrProvinceName= State or Province Name (full name)
10
+ localityName= Locality Name (eg, city)
11
+ 0.organizationName= Organization Name (eg, company)
12
+ organizationalUnitName= Organizational Unit Name (eg, section)
13
+ commonName= Common Name (eg, fully qualified host name)
14
+ commonName_max= 64
15
+ emailAddress= Email Address
16
+ emailAddress_max= 64
17
+
18
+ [ req_attributes ]
19
+ challengePassword= A challenge password
20
+ challengePassword_min= 4
21
+ challengePassword_max= 20
22
+
23
+ [ ca ]
24
+ subjectKeyIdentifier = hash
25
+ authorityKeyIdentifier = keyid:always,issuer
26
+ basicConstraints = critical, CA:true
27
+ keyUsage = critical, digitalSignature, cRLSign, keyCertSign
28
+
29
+ [ client_cert ]
30
+ basicConstraints = CA:FALSE
31
+ nsCertType = client, email
32
+ nsComment = "OpenSSL Generated Client Certificate"
33
+ subjectKeyIdentifier = hash
34
+ authorityKeyIdentifier = keyid,issuer
35
+ keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
36
+ extendedKeyUsage = clientAuth, emailProtection
37
+ subjectAltName = "DNS:localhost, IP:127.0.0.1"
38
+
39
+ [ client_cert_no_matching_subject ]
40
+ basicConstraints = CA:FALSE
41
+ nsCertType = client, email
42
+ nsComment = "OpenSSL Generated Client Certificate"
43
+ subjectKeyIdentifier = hash
44
+ authorityKeyIdentifier = keyid,issuer
45
+ keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment
46
+ extendedKeyUsage = clientAuth, emailProtection
47
+ subjectAltName = "DNS:nowhere, IP:123.45.67.89"
48
+
49
+ [ server_cert ]
50
+ basicConstraints = CA:FALSE
51
+ nsCertType = server
52
+ nsComment = "OpenSSL Generated Server Certificate"
53
+ subjectKeyIdentifier = hash
54
+ authorityKeyIdentifier = keyid,issuer:always
55
+ keyUsage = critical, digitalSignature, keyEncipherment
56
+ extendedKeyUsage = serverAuth
57
+ subjectAltName = "DNS:localhost, IP:127.0.0.1"
@@ -0,0 +1,292 @@
1
+ require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/devutils/rspec/shared_examples"
3
+
4
+ require "logstash/inputs/elastic_serverless_forwarder"
5
+
6
+ require "json"
7
+ require "manticore"
8
+
9
+ describe LogStash::Inputs::ElasticServerlessForwarder do
10
+
11
+ let(:generated_certs_directory) { Pathname.new('../fixtures/certs/generated').expand_path(__dir__).realpath }
12
+
13
+ let(:client) { Manticore::Client.new(client_options) }
14
+ let(:client_options) { { } }
15
+ let(:request_options) do
16
+ { headers: {"Content-Type" => "application/x-ndjson"} }
17
+ end
18
+
19
+ let(:port) { rand(1025...5000) }
20
+ let(:host) { "127.0.0.1" }
21
+ let(:scheme) { 'https' }
22
+ let(:url) { "#{scheme}://#{host}:#{port}" }
23
+
24
+ let(:config) { { "host" => host, "port" => port } }
25
+
26
+ subject(:esf_input) { described_class.new(config) }
27
+
28
+ let!(:queue) { Queue.new }
29
+
30
+ context 'baseline' do
31
+ let(:config) { super().merge('ssl' => false) }
32
+ let(:scheme) { 'http' }
33
+
34
+ it_behaves_like "an interruptible input plugin" do
35
+ let(:config) { { "port" => port, "ssl" => false } }
36
+ end
37
+
38
+ after :each do
39
+ client.clear_pending
40
+ client.close
41
+ esf_input.stop
42
+ end
43
+
44
+ end
45
+
46
+ shared_context "basic request handling" do
47
+ let!(:registered_esf_input) { esf_input.tap(&:register) }
48
+ let!(:running_input_thread) { Thread.new { registered_esf_input.run(queue) } }
49
+ before(:each) { wait_until_listening(host, port) }
50
+
51
+ after(:each) do
52
+ client.clear_pending
53
+ client.close
54
+ esf_input.stop
55
+ running_input_thread.join(10) || fail('o no')
56
+ end
57
+
58
+ let(:ndjson_encoded_body) do
59
+ <<~EONDJSONBODY
60
+ {"hello":"world"}
61
+ {"this":"works"}
62
+ {"message":"and doesn't destroy event.original that was included in payload", "event":{"original":"yes"}}
63
+ EONDJSONBODY
64
+ end
65
+
66
+ def wait_until_listening(host, port, timeout=10)
67
+ deadline = Time.now + timeout
68
+ begin
69
+ TCPSocket.new(host, port).close
70
+ rescue Errno::ECONNREFUSED
71
+ raise if Time.now > deadline
72
+ sleep 1
73
+ retry
74
+ end
75
+ end
76
+
77
+ def pop_with_timeout(queue, timeout)
78
+ t = Thread.new { queue.pop }
79
+ t.join(timeout) || t.kill
80
+ t.value
81
+ end
82
+ end
83
+
84
+ shared_examples 'successful request handling' do
85
+ include_context 'basic request handling'
86
+ describe 'basic receipt of events' do
87
+ it 'puts decoded, unenriched events into the queue' do
88
+ client.post("#{scheme}://#{host}:#{port}/events", request_options.merge(body: ndjson_encoded_body)).call
89
+
90
+ event = pop_with_timeout(queue, 30) || fail('nothing written to queue')
91
+ expect(event.get("hello")).to eq('world')
92
+
93
+ # ensure enrichment is avoided
94
+ expect(event).to_not include('[event][original]')
95
+ expect(event).to_not include('[@metadata][void]')
96
+ expect(event).to_not include('[host]')
97
+
98
+ # ensure additional events are added
99
+ event2 = pop_with_timeout(queue, 1) || fail('only single event written to queue')
100
+ expect(event2.get("this")).to eq('works')
101
+
102
+ # ensure an event that _has_ an event.original in the payload is not lost
103
+ event3 = pop_with_timeout(queue, 1) || fail('no third element in the queue')
104
+ expect(event3).to include('[event][original]')
105
+ expect(event3.get('[event][original]')).to eq('yes')
106
+ end
107
+ end
108
+ end
109
+
110
+ shared_examples 'bad certificate request handling' do
111
+ include_context 'basic request handling'
112
+ describe 'connection' do
113
+ it 'rejects the connection with a bad_certificate error' do
114
+ expect do
115
+ client.post("#{scheme}://#{host}:#{port}/events", request_options.merge(body: ndjson_encoded_body)).call
116
+ end.to raise_exception(Manticore::ClientProtocolException, a_string_including('bad_certificate'))
117
+ end
118
+ end
119
+ end
120
+
121
+ shared_examples 'bad basic auth request handling' do
122
+ include_context 'basic request handling'
123
+ describe 'request' do
124
+ it 'rejects the request with an HTTP 401 Unauthorized' do
125
+ response = client.post("#{scheme}://#{host}:#{port}/events", request_options.merge(body: ndjson_encoded_body)).call
126
+ expect(response).to have_attributes(code: 401, message: 'Unauthorized')
127
+ end
128
+ end
129
+ end
130
+
131
+ shared_examples 'basic auth support' do
132
+ context 'when http basic auth is enabled' do
133
+ let(:username) { 'john.doe' }
134
+ let(:password) { 'sUp3r$ecr3t' }
135
+ let(:config) do
136
+ super().merge('auth_basic_username' => username, 'auth_basic_password' => password)
137
+ end
138
+
139
+ context 'with valid credentials' do
140
+ let(:request_options) { super().merge(auth: {user: username, password: password}) }
141
+
142
+ include_examples 'successful request handling'
143
+ end
144
+ context 'with invalid credentials' do
145
+ let(:request_options) { super().merge(auth: {user: username, password: "incorrect"}) }
146
+
147
+ include_examples 'bad basic auth request handling'
148
+ end
149
+ context 'without credentials' do
150
+ include_examples 'bad basic auth request handling'
151
+ end
152
+ end
153
+ end
154
+
155
+ describe 'unsecured HTTP' do
156
+ let(:config) { super().merge('ssl' => false) }
157
+ let(:scheme) { 'http' }
158
+
159
+ include_examples 'successful request handling'
160
+ include_examples 'basic auth support'
161
+ end
162
+
163
+ describe 'SSL enabled' do
164
+ let(:config) do
165
+ super().merge({
166
+ 'ssl_certificate' => generated_certs_directory.join('server_from_root.crt').to_path,
167
+ 'ssl_key' => generated_certs_directory.join('server_from_root.key.pkcs8').to_path,
168
+ })
169
+ end
170
+ let(:client_ssl_options) do
171
+ { ca_file: generated_certs_directory.join('root.crt').to_path }
172
+ end
173
+ let(:client_options) do
174
+ super().merge(
175
+ ssl: client_ssl_options
176
+ )
177
+ end
178
+
179
+ include_examples 'successful request handling'
180
+ include_examples 'basic auth support'
181
+
182
+ context 'ssl_client_authentication => optional' do
183
+ let(:config) do
184
+ super().merge({
185
+ "ssl_client_authentication" => "optional",
186
+ "ssl_certificate_authorities" => generated_certs_directory.join('root.crt').to_path,
187
+ })
188
+ end
189
+
190
+ context 'when client provides trusted cert' do
191
+ let(:client_ssl_options) do
192
+ super().merge({
193
+ keystore: generated_certs_directory.join('client_from_root.p12').to_path,
194
+ keystore_password: '12345678',
195
+ })
196
+ end
197
+ include_examples 'successful request handling'
198
+ include_examples 'basic auth support'
199
+ end
200
+
201
+ context 'when client does not provide cert' do
202
+ include_examples 'successful request handling'
203
+ include_examples 'basic auth support'
204
+ end
205
+
206
+ context 'when client provides CA-signed cert without matching subjectAltName entry' do
207
+ let(:client_ssl_options) do
208
+ super().merge({
209
+ keystore: generated_certs_directory.join('client_no_matching_subject.p12').to_path,
210
+ keystore_password: '12345678',
211
+ })
212
+ end
213
+
214
+ include_examples 'successful request handling'
215
+
216
+ context 'and `ssl_verification_mode => full`', skip: "pending implementation of `ssl_verification_mode => full`" do
217
+ let(:config) do
218
+ super().merge('ssl_verification_mode' => 'full')
219
+ end
220
+
221
+ include_examples 'bad certificate request handling'
222
+ end
223
+ end
224
+
225
+ context 'when client provides self-signed cert' do
226
+ let(:client_ssl_options) do
227
+ super().merge({
228
+ keystore: generated_certs_directory.join('client_self_signed.p12').to_path,
229
+ keystore_password: '12345678',
230
+ })
231
+ end
232
+
233
+ include_examples 'successful request handling'
234
+ include_examples 'basic auth support'
235
+ end
236
+ end
237
+
238
+ context 'ssl_client_authentication => required' do
239
+ let(:config) do
240
+ super().merge({
241
+ "ssl_client_authentication" => "required",
242
+ "ssl_certificate_authorities" => generated_certs_directory.join('root.crt').to_path,
243
+ })
244
+ end
245
+
246
+ context 'when client provides trusted cert' do
247
+ let(:client_ssl_options) do
248
+ super().merge({
249
+ keystore: generated_certs_directory.join('client_from_root.p12').to_path,
250
+ keystore_password: '12345678',
251
+ })
252
+ end
253
+ include_examples 'successful request handling'
254
+ include_examples 'basic auth support'
255
+ end
256
+
257
+ context 'when client does not provide cert' do
258
+ include_examples 'bad certificate request handling'
259
+ end
260
+
261
+ context 'when client provides CA-signed cert without matching subjectAltName entry' do
262
+ let(:client_ssl_options) do
263
+ super().merge({
264
+ keystore: generated_certs_directory.join('client_no_matching_subject.p12').to_path,
265
+ keystore_password: '12345678',
266
+ })
267
+ end
268
+
269
+ include_examples 'successful request handling'
270
+
271
+ context 'and `ssl_verification_mode => full`', skip: "pending implementation of `ssl_verification_mode => full`" do
272
+ let(:config) do
273
+ super().merge('ssl_verification_mode' => 'full')
274
+ end
275
+
276
+ include_examples 'bad certificate request handling'
277
+ end
278
+ end
279
+
280
+ context 'when client provides self-signed cert' do
281
+ let(:client_ssl_options) do
282
+ super().merge({
283
+ keystore: generated_certs_directory.join('client_self_signed.p12').to_path,
284
+ keystore_password: '12345678',
285
+ })
286
+ end
287
+
288
+ include_examples 'bad certificate request handling'
289
+ end
290
+ end
291
+ end
292
+ end