Skip to content

Commit 2fae93e

Browse files
authored
Mark deprecated SSL settings as obsolete (#147)
* Mark deprecated SSL settings as obsolete This commit marks the following SSL settings as obsolete: 'cacert', 'client_cert', 'client_key', 'keystore', 'truststore', 'keystore_password', 'truststore_password', 'keystore_type' and 'truststore_type'.
1 parent 7f4d9dd commit 2fae93e

File tree

5 files changed

+67
-94
lines changed

5 files changed

+67
-94
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 6.0.0
2+
- SSL settings that were marked deprecated in version `5.6.0` are now marked obsolete, and will prevent the plugin from starting.
3+
- These settings are:
4+
- `cacert`, which should be replaced by `ssl_certificate_authorities`
5+
- `client_cert`, which should be replaced by `ssl_certificate`
6+
- `client_key`, which should be replaced by `ssl_key`
7+
- `keystore`, which should be replaced by `ssl_keystore_path`
8+
- `keystore_password`, which should be replaced by `ssl_keystore_password`
9+
- `keystore_type`, which should be replaced by `ssl_keystore_password`
10+
- `truststore`, which should be replaced by `ssl_truststore_path>`
11+
- `truststore_password`, which should be replaced by `ssl_truststore_password`
12+
- `truststore_type`, which should be replaced by `ssl_truststore_type`
13+
- [#147](https://github.com/logstash-plugins/logstash-output-http/pull/147)
14+
115
## 5.7.1
216
- Added new development `rackup` dependency to fix tests
317

docs/index.asciidoc

Lines changed: 24 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ NOTE: The `retry_failed` option does not control the library level retry.
7070

7171
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
7272

73+
NOTE: As of version `6.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed.
74+
Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
75+
7376
[cols="<,<,<",options="header",]
7477
|=======================================================================
7578
|Setting |Input type|Required
7679
| <<plugins-{type}s-{plugin}-automatic_retries>> |<<number,number>>|No
77-
| <<plugins-{type}s-{plugin}-cacert>> |a valid filesystem path|__Deprecated__
78-
| <<plugins-{type}s-{plugin}-client_cert>> |a valid filesystem path|__Deprecated__
79-
| <<plugins-{type}s-{plugin}-client_key>> |a valid filesystem path|__Deprecated__
8080
| <<plugins-{type}s-{plugin}-connect_timeout>> |<<number,number>>|No
8181
| <<plugins-{type}s-{plugin}-content_type>> |<<string,string>>|No
8282
| <<plugins-{type}s-{plugin}-cookies>> |<<boolean,boolean>>|No
@@ -87,9 +87,6 @@ This plugin supports the following configuration options plus the <<plugins-{typ
8787
| <<plugins-{type}s-{plugin}-http_method>> |<<string,string>>, one of `["put", "post", "patch", "delete", "get", "head"]`|Yes
8888
| <<plugins-{type}s-{plugin}-ignorable_codes>> |<<number,number>>|No
8989
| <<plugins-{type}s-{plugin}-keepalive>> |<<boolean,boolean>>|No
90-
| <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|__Deprecated__
91-
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|__Deprecated__
92-
| <<plugins-{type}s-{plugin}-keystore_type>> |<<string,string>>|__Deprecated__
9390
| <<plugins-{type}s-{plugin}-mapping>> |<<hash,hash>>|No
9491
| <<plugins-{type}s-{plugin}-message>> |<<string,string>>|No
9592
| <<plugins-{type}s-{plugin}-pool_max>> |<<number,number>>|No
@@ -112,9 +109,6 @@ This plugin supports the following configuration options plus the <<plugins-{typ
112109
| <<plugins-{type}s-{plugin}-ssl_truststore_path>> |<<path,path>>|No
113110
| <<plugins-{type}s-{plugin}-ssl_truststore_type>> |<<string,string>>|No
114111
| <<plugins-{type}s-{plugin}-ssl_verification_mode>> |<<string,string>>, one of `["full", "none"]`|No
115-
| <<plugins-{type}s-{plugin}-truststore>> |a valid filesystem path|__Deprecated__
116-
| <<plugins-{type}s-{plugin}-truststore_password>> |<<password,password>>|__Deprecated__
117-
| <<plugins-{type}s-{plugin}-truststore_type>> |<<string,string>>|__Deprecated__
118112
| <<plugins-{type}s-{plugin}-url>> |<<string,string>>|Yes
119113
| <<plugins-{type}s-{plugin}-validate_after_inactivity>> |<<number,number>>|No
120114
|=======================================================================
@@ -135,32 +129,6 @@ to a value other than zero if the <<plugins-{type}s-{plugin}-keepalive,`keepaliv
135129
Some servers incorrectly end keepalives early, requiring a retry.
136130
See <<plugins-{type}s-{plugin}-retry_policy,Retry Policy>> for more information.
137131

138-
[id="plugins-{type}s-{plugin}-cacert"]
139-
===== `cacert`
140-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
141-
142-
* Value type is <<path,path>>
143-
* There is no default value for this setting.
144-
145-
If you need to use a custom X.509 CA (.pem certs) specify the path to that here
146-
147-
[id="plugins-{type}s-{plugin}-client_cert"]
148-
===== `client_cert`
149-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate>>]
150-
151-
* Value type is <<path,path>>
152-
* There is no default value for this setting.
153-
154-
If you'd like to use a client certificate (note, most people don't want this) set the path to the x509 cert here
155-
156-
[id="plugins-{type}s-{plugin}-client_key"]
157-
===== `client_key`
158-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_key>>]
159-
160-
* Value type is <<path,path>>
161-
* There is no default value for this setting.
162-
163-
If you're using a client certificate specify the path to the encryption key here
164132

165133
[id="plugins-{type}s-{plugin}-connect_timeout"]
166134
===== `connect_timeout`
@@ -265,34 +233,6 @@ enumerate them here. Responses returning these codes will be considered successe
265233
Turn this on to enable HTTP keepalive support. We highly recommend setting `automatic_retries` to at least
266234
one with this to fix interactions with broken keepalive implementations.
267235

268-
[id="plugins-{type}s-{plugin}-keystore"]
269-
===== `keystore`
270-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_path>>]
271-
272-
* Value type is <<path,path>>
273-
* There is no default value for this setting.
274-
275-
If you need to use a custom keystore (`.jks`) specify that here. This does not work with .pem keys!
276-
277-
[id="plugins-{type}s-{plugin}-keystore_password"]
278-
===== `keystore_password`
279-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_password>>]
280-
281-
* Value type is <<password,password>>
282-
* There is no default value for this setting.
283-
284-
Specify the keystore password here.
285-
Note, most .jks files created with keytool require a password!
286-
287-
[id="plugins-{type}s-{plugin}-keystore_type"]
288-
===== `keystore_type`
289-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_type>>]
290-
291-
* Value type is <<string,string>>
292-
* Default value is `"JKS"`
293-
294-
Specify the keystore type here. One of `JKS` or `PKCS12`. Default is `JKS`
295-
296236
[id="plugins-{type}s-{plugin}-mapping"]
297237
===== `mapping`
298238

@@ -523,34 +463,6 @@ This mode disables many of the security benefits of SSL/TLS and should only be u
523463
It is primarily intended as a temporary diagnostic mechanism when attempting to resolve TLS errors.
524464
Using `none` in production environments is strongly discouraged.
525465

526-
[id="plugins-{type}s-{plugin}-truststore"]
527-
===== `truststore`
528-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_path>>]
529-
530-
* Value type is <<path,path>>
531-
* There is no default value for this setting.
532-
533-
If you need to use a custom truststore (`.jks`) specify that here. This does not work with .pem certs!
534-
535-
[id="plugins-{type}s-{plugin}-truststore_password"]
536-
===== `truststore_password`
537-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_password>>]
538-
539-
* Value type is <<password,password>>
540-
* There is no default value for this setting.
541-
542-
Specify the truststore password here.
543-
Note, most .jks files created with keytool require a password!
544-
545-
[id="plugins-{type}s-{plugin}-truststore_type"]
546-
===== `truststore_type`
547-
deprecated[5.6.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_type>>]
548-
549-
* Value type is <<string,string>>
550-
* Default value is `"JKS"`
551-
552-
Specify the truststore type here. One of `JKS` or `PKCS12`. Default is `JKS`
553-
554466
[id="plugins-{type}s-{plugin}-url"]
555467
===== `url`
556468

@@ -573,6 +485,27 @@ Quoting the Apache commons docs (this client is based Apache Commmons):
573485
See https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.html#setValidateAfterInactivity(int)[these docs for more info]
574486

575487

488+
[id="plugins-{type}s-{plugin}-obsolete-options"]
489+
==== HTTP Output Obsolete Configuration Options
490+
491+
WARNING: As of version `6.0.0` of this plugin, some configuration options have been replaced.
492+
The plugin will fail to start if it contains any of these obsolete options.
493+
494+
495+
[cols="<,<",options="header",]
496+
|=======================================================================
497+
|Setting|Replaced by
498+
| cacert |<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
499+
| client_cert |<<plugins-{type}s-{plugin}-ssl_certificate>>
500+
| client_key |<<plugins-{type}s-{plugin}-ssl_key>>
501+
| keystore |<<plugins-{type}s-{plugin}-ssl_keystore_path>>
502+
| keystore_password |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
503+
| keystore_type |<<plugins-{type}s-{plugin}-ssl_keystore_password>>
504+
| truststore |<<plugins-{type}s-{plugin}-ssl_truststore_path>>
505+
| truststore_password |<<plugins-{type}s-{plugin}-ssl_truststore_password>>
506+
| truststore_type |<<plugins-{type}s-{plugin}-ssl_truststore_type>>
507+
|=======================================================================
508+
576509

577510
[id="plugins-{type}s-{plugin}-common-options"]
578511
include::{include_path}/{type}.asciidoc[]

lib/logstash/outputs/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require "zlib"
88

99
class LogStash::Outputs::Http < LogStash::Outputs::Base
10-
include LogStash::PluginMixins::HttpClient[:with_deprecated => true]
10+
include LogStash::PluginMixins::HttpClient[:with_obsolete => true]
1111

1212
concurrency :shared
1313

logstash-output-http.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-output-http'
3-
s.version = '5.7.1'
3+
s.version = '6.0.0'
44
s.licenses = ['Apache License (2.0)']
55
s.summary = "Sends events to a generic HTTP or HTTPS endpoint"
66
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"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
2020

2121
# Gem dependencies
2222
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
23-
s.add_runtime_dependency "logstash-mixin-http_client", ">= 7.4.0", "< 8.0.0"
23+
s.add_runtime_dependency "logstash-mixin-http_client", ">= 7.5.0", "< 8.0.0"
2424

2525
s.add_development_dependency 'logstash-devutils'
2626
s.add_development_dependency 'sinatra'

spec/outputs/http_spec.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@
2020
let(:url) { "http://localhost:#{port}/good" }
2121
let(:method) { "post" }
2222

23+
describe "obsolete settings" do
24+
let(:config) { {"url" => url, "http_method" => "post"} }
25+
26+
[{:name => 'cacert', :canonical_name => 'ssl_certificate_authorities'},
27+
{:name => 'client_cert', :canonical_name => 'ssl_certificate'},
28+
{:name => 'client_key', :canonical_name => 'ssl_key'},
29+
{:name => "keystore", :canonical_name => 'ssl_keystore_path'},
30+
{:name => 'truststore', :canonical_name => 'ssl_truststore_path'},
31+
{:name => "keystore_password", :canonical_name => "ssl_keystore_password"},
32+
{:name => 'truststore_password', :canonical_name => "ssl_truststore_password"},
33+
{:name => "keystore_type", :canonical_name => "ssl_keystore_type"},
34+
{:name => 'truststore_type', :canonical_name => 'ssl_truststore_type'}
35+
].each do |settings|
36+
context "with option #{settings[:name]}" do
37+
let(:obsolete_config) { config.merge(settings[:name] => 'test_value') }
38+
39+
it "emits an error about the setting `#{settings[:name]}` now being obsolete and provides guidance to use `#{settings[:canonical_name]}`" do
40+
error_text = /The setting `#{settings[:name]}` in plugin `http` is obsolete and is no longer available. Use `#{settings[:canonical_name]}` instead/i
41+
expect { LogStash::Outputs::Http.new(obsolete_config) }.to raise_error LogStash::ConfigurationError, error_text
42+
end
43+
44+
end
45+
end
46+
end
47+
48+
2349
shared_examples("verb behavior") do |method|
2450

2551
shared_examples("failure log behaviour") do

0 commit comments

Comments
 (0)