logstash-input-elasticsearch 4.15.0 → 4.16.0

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: 9379a31460bf649615c038b1b35d207f6a6db869bb1a27e963da70e278ae6bcd
4
- data.tar.gz: f62823b8ddfb587ce9614a1d131be1bce2186dbd859287b1107757917a754c7e
3
+ metadata.gz: 1c5466b50a56ec047ac20dc019d9e24862756b518613b63edf44583900a090e2
4
+ data.tar.gz: 6b3915bd640318ebd6fa4b87f676d7e43d4fba7fe54893efdb6eb39f70481da8
5
5
  SHA512:
6
- metadata.gz: c675ed6a5d1a4a104313611e4895171c6461149d0415c5ad4c276e42b5b99672584ae38ddc37f3e32521074727051c68f0d10a37b77064d0cea6ea03f041a3b9
7
- data.tar.gz: beba1b98be77880e6e3712cebdd0474d68c33556a86236e828a3332d2e812b187e920e78f6fb006b27b82269faa0e0654568d050f7057ae7db48da7fd9a20e31
6
+ metadata.gz: 930202045f30125060cce1f3d45b22c0336976a6cdcbf5931f4b98410785bd425cf665224edfe4994953ad2d53cdaa994b31be9db86fd05f538a722ff788ba97
7
+ data.tar.gz: 8cf1f45481575f653867831ab38fb7efd286c12432b2afc2c6940c32d4eb91f913dd7b89c284ed4e11e9205536cc75b318f399b92136777f84ac6dec75d2de2d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.16.0
2
+ - Added `ssl_certificate_verification` option to control SSL certificate verification [#180](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/180)
3
+
1
4
  ## 4.15.0
2
5
  - Feat: add `retries` option. allow retry for failing query [#179](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/179)
3
6
 
data/docs/index.asciidoc CHANGED
@@ -122,6 +122,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
122
122
  | <<plugins-{type}s-{plugin}-size>> |<<number,number>>|No
123
123
  | <<plugins-{type}s-{plugin}-slices>> |<<number,number>>|No
124
124
  | <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|No
125
+ | <<plugins-{type}s-{plugin}-ssl_certificate_verification>> |<<boolean,boolean>>|No
125
126
  | <<plugins-{type}s-{plugin}-socket_timeout_seconds>> | <<number,number>>|No
126
127
  | <<plugins-{type}s-{plugin}-target>> | {logstash-ref}/field-references-deepdive.html[field reference] | No
127
128
  | <<plugins-{type}s-{plugin}-retries>> | <<number,number>>|No
@@ -414,6 +415,20 @@ instructions into the query.
414
415
  If enabled, SSL will be used when communicating with the Elasticsearch
415
416
  server (i.e. HTTPS will be used instead of plain HTTP).
416
417
 
418
+ [id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
419
+ ===== `ssl_certificate_verification`
420
+
421
+ * Value type is <<boolean,boolean>>
422
+ * Default value is `true`
423
+
424
+ Option to validate the server's certificate. Disabling this severely compromises security.
425
+ When certificate validation is disabled, this plugin implicitly trusts the machine
426
+ resolved at the given address without validating its proof-of-identity.
427
+ In this scenario, the plugin can transmit credentials to or process data from an untrustworthy
428
+ man-in-the-middle or other compromised infrastructure.
429
+ More information on the importance of certificate verification:
430
+ **https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf**.
431
+
417
432
  [id="plugins-{type}s-{plugin}-socket_timeout_seconds"]
418
433
  ===== `socket_timeout_seconds`
419
434
 
@@ -190,6 +190,11 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
190
190
  # SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary
191
191
  config :ca_file, :validate => :path
192
192
 
193
+ # Option to validate the server's certificate. Disabling this severely compromises security.
194
+ # For more information on the importance of certificate verification please read
195
+ # https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
196
+ config :ssl_certificate_verification, :validate => :boolean, :default => true
197
+
193
198
  # Schedule of when to periodically run statement, in Cron format
194
199
  # for example: "* * * * *" (execute query every minute, on the minute)
195
200
  #
@@ -432,6 +437,11 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
432
437
  ssl_options[:ssl] = true if @ssl
433
438
  ssl_options[:ca_file] = @ca_file if @ssl && @ca_file
434
439
  ssl_options[:trust_strategy] = trust_strategy_for_ca_trusted_fingerprint
440
+ if @ssl && !@ssl_certificate_verification
441
+ logger.warn "You have enabled encryption but DISABLED certificate verification, " +
442
+ "to make sure your data is secure remove `ssl_certificate_verification => false`"
443
+ ssl_options[:verify] = :disable
444
+ end
435
445
 
436
446
  ssl_options
437
447
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-elasticsearch'
4
- s.version = '4.15.0'
4
+ s.version = '4.16.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Reads query results from an Elasticsearch cluster"
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"
@@ -698,6 +698,14 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
698
698
  expect { plugin.register }.to raise_error LogStash::ConfigurationError, /Multiple authentication options are specified/
699
699
  end
700
700
  end
701
+
702
+ context 'ssl verification disabled' do
703
+ let(:config) { super().merge({ 'ssl_certificate_verification' => false }) }
704
+ it 'should warn data security risk' do
705
+ expect(plugin.logger).to receive(:warn).once.with("You have enabled encryption but DISABLED certificate verification, to make sure your data is secure remove `ssl_certificate_verification => false`")
706
+ plugin.register
707
+ end
708
+ end
701
709
  end
702
710
  end if LOGSTASH_VERSION > '6.0'
703
711
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.15.0
4
+ version: 4.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement