logstash-filter-elasticsearch 3.16.2 → 4.0.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: 77f05a757154f2f9e412dc4226296322180f27b0906a3a28a5b87a164531421c
4
- data.tar.gz: 3262154d23afdec46fb84a583d88f2a7fa12b6c5282d36c9af4bc16d95aca1e2
3
+ metadata.gz: 015a98dbd36122dd3fc4c74da5744a31f6182f67023f802189cc73e837d5ba7a
4
+ data.tar.gz: 8f1c3a79c0af3fc4154501d16bf775e01b6aa7575627852cb18954a0dd952d91
5
5
  SHA512:
6
- metadata.gz: a85fc86abdf1546f600fd6878ce9775e437561eeaa3c5ad2da5963cd991c9b15383dfbab249b5d755d709ed404f6fc88c637f6df4348425318eb08ea091fc92c
7
- data.tar.gz: 5398c04fe9c7aff2cc74e61f67aaab22da5280160c44fae8fdf7cc86cdb8fb62735eade95dca41bc53c7a7bb745af30e82fe2bfd715c8a959728e9a1d29e9e72
6
+ metadata.gz: fc3971541568e34c0ef644c250243fefcb48c778b2471f81f5e87a1b59535a6f5ccc2a2c13d57f5123e0577efb80962b85f8096d3d6f70e0721df4f716d705e1
7
+ data.tar.gz: 5fe74aa6d8179e6dd3d9c69a6d0c81f284035bd82343543132f129be7bfb3355e01678eddbd051d9d4c360e9704f8a234737096e757f710b395b5d366f57936f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 4.0.0
2
+ - SSL settings that were marked deprecated in version `3.15.0` are now marked obsolete, and will prevent the plugin from starting.
3
+ - These settings are:
4
+ - `ca_file`, which should be replaced by `ssl_certificate_authorities`
5
+ - `keystore`, which should be replaced by `ssl_keystore_path`
6
+ - `keystore_password`, which should be replaced by `ssl_keystore_password`
7
+ - `keystore_type`, which should be replaced by `ssl_keystore_password`
8
+ - `ssl`, which should be replaced by `ssl_enabled`
9
+ - [#183](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/183)
10
+
1
11
  ## 3.16.2
2
12
  - Add `x-elastic-product-origin` header to Elasticsearch requests [#185](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/185)
3
13
 
data/docs/index.asciidoc CHANGED
@@ -110,7 +110,7 @@ Authentication to a secure Elasticsearch cluster is possible using _one_ of the
110
110
  * <<plugins-{type}s-{plugin}-user>> AND <<plugins-{type}s-{plugin}-password>>
111
111
  * <<plugins-{type}s-{plugin}-cloud_auth>>
112
112
  * <<plugins-{type}s-{plugin}-api_key>>
113
- * <<plugins-{type}s-{plugin}-keystore>> and/or <<plugins-{type}s-{plugin}-keystore_password>>
113
+ * <<plugins-{type}s-{plugin}-ssl_keystore_path>> and/or <<plugins-{type}s-{plugin}-ssl_keystore_password>>
114
114
 
115
115
  [id="plugins-{type}s-{plugin}-autz"]
116
116
  ==== Authorization
@@ -121,7 +121,10 @@ The `monitoring` permission at cluster level is necessary to perform periodic co
121
121
  [id="plugins-{type}s-{plugin}-options"]
122
122
  ==== Elasticsearch Filter Configuration Options
123
123
 
124
- This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> and the <<plugins-{type}s-{plugin}-deprecated-options>> described later.
124
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
125
+
126
+ NOTE: As of version `4.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed. Please see the
127
+ <<plugins-{type}s-{plugin}-obsolete-options>> for more details.
125
128
 
126
129
  [cols="<,<,<",options="header",]
127
130
  |=======================================================================
@@ -144,7 +147,6 @@ This plugin supports the following configuration options plus the <<plugins-{typ
144
147
  | <<plugins-{type}s-{plugin}-retry_on_failure>> |<<number,number>>|No
145
148
  | <<plugins-{type}s-{plugin}-retry_on_status>> |<<array,array>>|No
146
149
  | <<plugins-{type}s-{plugin}-sort>> |<<string,string>>|No
147
- | <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|__Deprecated__
148
150
  | <<plugins-{type}s-{plugin}-ssl_certificate>> |<<path,path>>|No
149
151
  | <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> |list of <<path,path>>|No
150
152
  | <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |list of <<string,string>>|No
@@ -519,57 +521,21 @@ Tags the event on failure to look up previous log event information. This can be
519
521
  Basic Auth - username
520
522
 
521
523
 
522
- [id="plugins-{type}s-{plugin}-deprecated-options"]
523
- ==== Elasticsearch Filter Deprecated Configuration Options
524
-
525
- This plugin supports the following deprecated configurations.
524
+ [id="plugins-{type}s-{plugin}-obsolete-options"]
525
+ ==== Elasticsearch Filter Obsolete Configuration Options
526
526
 
527
- WARNING: Deprecated options are subject to removal in future releases.
527
+ WARNING: As of version `4.0.0` of this plugin, some configuration options have been replaced.
528
+ The plugin will fail to start if it contains any of these obsolete options.
528
529
 
529
530
  [cols="<,<,<",options="header",]
530
531
  |=======================================================================
531
- |Setting|Input type|Replaced by
532
- | <<plugins-{type}s-{plugin}-ca_file>> |a valid filesystem path|<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
533
- | <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|<<plugins-{type}s-{plugin}-ssl_keystore_path>>
534
- | <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|<<plugins-{type}s-{plugin}-ssl_keystore_password>>
532
+ |Setting|Replaced by
533
+ | ca_file |<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
534
+ | keystore |<<plugins-{type}s-{plugin}-ssl_keystore_path>>
535
+ | keystore_password |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
536
+ | ssl |<<plugins-{type}s-{plugin}-ssl_enabled>>
535
537
  |=======================================================================
536
538
 
537
- [id="plugins-{type}s-{plugin}-ca_file"]
538
- ===== `ca_file`
539
- deprecated[3.15.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
540
-
541
- * Value type is <<path,path>>
542
- * There is no default value for this setting.
543
-
544
- SSL Certificate Authority file
545
-
546
- [id="plugins-{type}s-{plugin}-ssl"]
547
- ===== `ssl`
548
- deprecated[3.15.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
549
-
550
- * Value type is <<boolean,boolean>>
551
- * Default value is `false`
552
-
553
- SSL
554
-
555
- [id="plugins-{type}s-{plugin}-keystore"]
556
- ===== `keystore`
557
- deprecated[3.15.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_path>>]
558
-
559
- * Value type is <<path,path>>
560
- * There is no default value for this setting.
561
-
562
- The keystore used to present a certificate to the server. It can be either .jks or .p12
563
-
564
- [id="plugins-{type}s-{plugin}-keystore_password"]
565
- ===== `keystore_password`
566
- deprecated[3.15.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_password>>]
567
-
568
- * Value type is <<password,password>>
569
- * There is no default value for this setting.
570
-
571
- Set the keystore password
572
-
573
539
 
574
540
  [id="plugins-{type}s-{plugin}-common-options"]
575
541
  include::{include_path}/{type}.asciidoc[]
@@ -3,7 +3,6 @@ require "logstash/filters/base"
3
3
  require "logstash/namespace"
4
4
  require "logstash/json"
5
5
  require 'logstash/plugin_mixins/ca_trusted_fingerprint_support'
6
- require "logstash/plugin_mixins/normalize_config_support"
7
6
  require "monitor"
8
7
 
9
8
  require_relative "elasticsearch/client"
@@ -62,18 +61,6 @@ class LogStash::Filters::Elasticsearch < LogStash::Filters::Base
62
61
  # Set the address of a forward HTTP proxy.
63
62
  config :proxy, :validate => :uri_or_empty
64
63
 
65
- # SSL
66
- config :ssl, :validate => :boolean, :default => false, :deprecated => "Set 'ssl_enabled' instead."
67
-
68
- # SSL Certificate Authority file
69
- config :ca_file, :validate => :path, :deprecated => "Set 'ssl_certificate_authorities' instead."
70
-
71
- # The keystore used to present a certificate to the server.
72
- # It can be either .jks or .p12
73
- config :keystore, :validate => :path, :deprecated => "Use 'ssl_keystore_path' instead."
74
-
75
- # Set the keystore password
76
- config :keystore_password, :validate => :password, :deprecated => "Use 'ssl_keystore_password' instead."
77
64
 
78
65
  # OpenSSL-style X.509 certificate certificate to authenticate the client
79
66
  config :ssl_certificate, :validate => :path
@@ -135,11 +122,15 @@ class LogStash::Filters::Elasticsearch < LogStash::Filters::Base
135
122
  # What status codes to retry on?
136
123
  config :retry_on_status, :validate => :number, :list => true, :default => [500, 502, 503, 504]
137
124
 
125
+
126
+ config :ssl, :obsolete => "Set 'ssl_enabled' instead."
127
+ config :ca_file, :obsolete => "Set 'ssl_certificate_authorities' instead."
128
+ config :keystore, :obsolete => "Set 'ssl_keystore_path' instead."
129
+ config :keystore_password, :validate => :password, :obsolete => "Set 'ssl_keystore_password' instead."
130
+
138
131
  # config :ca_trusted_fingerprint, :validate => :sha_256_hex
139
132
  include LogStash::PluginMixins::CATrustedFingerprintSupport
140
133
 
141
- include LogStash::PluginMixins::NormalizeConfigSupport
142
-
143
134
  include MonitorMixin
144
135
  attr_reader :shared_client
145
136
 
@@ -488,46 +479,9 @@ class LogStash::Filters::Elasticsearch < LogStash::Filters::Base
488
479
  end
489
480
 
490
481
  def setup_ssl_params!
491
- @ssl_enabled = normalize_config(:ssl_enabled) do |normalize|
492
- normalize.with_deprecated_alias(:ssl)
493
- end
494
-
495
- # Infer the value if neither the deprecate `ssl` and `ssl_enabled` were set
496
- infer_ssl_enabled_from_hosts
497
-
498
- @ssl_keystore_path = normalize_config(:ssl_keystore_path) do |normalize|
499
- normalize.with_deprecated_alias(:keystore)
500
- end
501
-
502
- @ssl_keystore_password = normalize_config(:ssl_keystore_password) do |normalize|
503
- normalize.with_deprecated_alias(:keystore_password)
504
- end
505
-
506
- @ssl_certificate_authorities = normalize_config(:ssl_certificate_authorities) do |normalize|
507
- normalize.with_deprecated_mapping(:ca_file) do |ca_file|
508
- [ca_file]
509
- end
510
- end
511
-
512
- params['ssl_enabled'] = @ssl_enabled
513
- params['ssl_keystore_path'] = @ssl_keystore_path unless @ssl_keystore_path.nil?
514
- params['ssl_keystore_password'] = @ssl_keystore_password unless @ssl_keystore_password.nil?
515
- params['ssl_certificate_authorities'] = @ssl_certificate_authorities unless @ssl_certificate_authorities.nil?
516
- end
517
-
518
- def infer_ssl_enabled_from_hosts
519
- return if original_params.include?('ssl') || original_params.include?('ssl_enabled')
520
-
521
- @ssl_enabled = params['ssl_enabled'] = effectively_ssl?
522
- end
523
-
524
- def effectively_ssl?
525
- return true if @ssl_enabled
526
-
527
- hosts = Array(@hosts)
528
- return false if hosts.nil? || hosts.empty?
529
-
530
- hosts.all? { |host| host && host.to_s.start_with?("https") }
482
+ # Infer the value if neither `ssl_enabled` was not set
483
+ return if original_params.include?('ssl_enabled')
484
+ params['ssl_enabled'] = @ssl_enabled ||= Array(@hosts).all? { |host| host && host.to_s.start_with?("https") }
531
485
  end
532
486
 
533
487
  end #class LogStash::Filters::Elasticsearch
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-elasticsearch'
4
- s.version = '3.16.2'
4
+ s.version = '4.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Copies fields from previous log events in Elasticsearch to current events "
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"
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency 'elasticsearch', ">= 7.14.9" # LS >= 6.7 and < 7.14 all used version 5.0.5
25
25
  s.add_runtime_dependency 'manticore', ">= 0.7.1"
26
26
  s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~> 1.0'
27
- s.add_runtime_dependency 'logstash-mixin-normalize_config_support', '~>1.0'
28
27
  s.add_development_dependency 'cabin', ['~> 0.6']
29
28
  s.add_development_dependency 'webrick'
30
29
  s.add_development_dependency 'logstash-devutils'
@@ -24,6 +24,23 @@ describe "SSL options" do
24
24
  subject.close
25
25
  end
26
26
 
27
+ describe "obsolete settings" do
28
+ [{:name => 'ca_file', :canonical_name => 'ssl_certificate_authorities'},
29
+ {:name => "keystore", :canonical_name => 'ssl_keystore_path'},
30
+ {:name => "keystore_password", :canonical_name => "ssl_keystore_password"},
31
+ {:name => "ssl", :canonical_name => "ssl_enabled"}
32
+ ].each do |config_settings|
33
+ context "with option #{config_settings[:name]}" do
34
+ let(:obsolete_config) { settings.merge(config_settings[:name] => 'test_value') }
35
+ it "emits an error about the setting `#{config_settings[:name]}` now being obsolete and provides guidance to use `#{config_settings[:canonical_name]}`" do
36
+ error_text = /The setting `#{config_settings[:name]}` in plugin `elasticsearch` is obsolete and is no longer available. Set '#{config_settings[:canonical_name]}' instead/i
37
+ expect { LogStash::Filters::Elasticsearch.new(obsolete_config) }.to raise_error LogStash::ConfigurationError, error_text
38
+ end
39
+
40
+ end
41
+ end
42
+ end
43
+
27
44
  context "when ssl_enabled is" do
28
45
  context "true and there is no https hosts" do
29
46
  let(:hosts) { %w[http://es01 http://es01] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.16.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2025-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -72,20 +72,6 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.0'
75
- - !ruby/object:Gem::Dependency
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '1.0'
81
- name: logstash-mixin-normalize_config_support
82
- type: :runtime
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.0'
89
75
  - !ruby/object:Gem::Dependency
90
76
  requirement: !ruby/object:Gem::Requirement
91
77
  requirements: