Skip to content

Commit b37536a

Browse files
authored
Standardize and add SSL settings (#185)
This commit made the plugin SSL settings consistent with the naming convention defined in the meta issue: elastic/logstash#14905. It added the following SSL settings: ssl_enabled: Enable/disable the SSL settings. Infer the value from the hosts' scheme if neither the deprecated `:ssl` nor the new `:ssl_enabled` configs were set ssl_certificate: OpenSSL-style X.509 certificate file to authenticate the client ssl_key: OpenSSL-style RSA private key that corresponds to the ssl_certificate ssl_truststore_path: The JKS truststore to validate the server's certificate ssl_truststore_type: The format of the truststore file ssl_truststore_password: The truststore password ssl_keystore_path: The keystore used to present a certificate to the server ssl_keystore_type: The format of the keystore file ssl_keystore_password: The keystore password ssl_cipher_suites: The list of cipher suites to use ssl_supported_protocols: Supported protocols with versions And deprecated: ssl in favor of ssl_enabled: ca_file in favor of ssl_certificate_authorities ssl_certificate_verification in favor of ssl_verification_mode
1 parent f461a59 commit b37536a

File tree

7 files changed

+645
-55
lines changed

7 files changed

+645
-55
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 4.17.0
2+
- Added SSL settings for: [#185](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/185)
3+
- `ssl_enabled`: Enable/disable the SSL settings. If not provided, the value is inferred from the hosts scheme
4+
- `ssl_certificate`: OpenSSL-style X.509 certificate file to authenticate the client
5+
- `ssl_key`: OpenSSL-style RSA private key that corresponds to the `ssl_certificate`
6+
- `ssl_truststore_path`: The JKS truststore to validate the server's certificate
7+
- `ssl_truststore_type`: The format of the truststore file
8+
- `ssl_truststore_password`: The truststore password
9+
- `ssl_keystore_path`: The keystore used to present a certificate to the server
10+
- `ssl_keystore_type`: The format of the keystore file
11+
- `ssl_keystore_password`: The keystore password
12+
- `ssl_cipher_suites`: The list of cipher suites to use
13+
- `ssl_supported_protocols`: Supported protocols with versions
14+
- Reviewed and deprecated SSL settings to comply with Logstash's naming convention
15+
- Deprecated `ssl` in favor of `ssl_enabled`
16+
- Deprecated `ca_file` in favor of `ssl_certificate_authorities`
17+
- Deprecated `ssl_certificate_verification` in favor of `ssl_verification_mode`
18+
119
## 4.16.0
220
- Added `ssl_certificate_verification` option to control SSL certificate verification [#180](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/180)
321

docs/index.asciidoc

Lines changed: 190 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ TIP: Set the `target` option to avoid potential schema conflicts.
9696
[id="plugins-{type}s-{plugin}-options"]
9797
==== Elasticsearch Input configuration options
9898

99-
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
99+
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.
100100

101101
[cols="<,<,<",options="header",]
102102
|=======================================================================
103103
|Setting |Input type|Required
104104
| <<plugins-{type}s-{plugin}-api_key>> |<<password,password>>|No
105-
| <<plugins-{type}s-{plugin}-ca_file>> |a valid filesystem path|No
106105
| <<plugins-{type}s-{plugin}-ca_trusted_fingerprint>> |<<string,string>>|No
107106
| <<plugins-{type}s-{plugin}-cloud_auth>> |<<password,password>>|No
108107
| <<plugins-{type}s-{plugin}-cloud_id>> |<<string,string>>|No
@@ -121,8 +120,19 @@ This plugin supports the following configuration options plus the <<plugins-{typ
121120
| <<plugins-{type}s-{plugin}-scroll>> |<<string,string>>|No
122121
| <<plugins-{type}s-{plugin}-size>> |<<number,number>>|No
123122
| <<plugins-{type}s-{plugin}-slices>> |<<number,number>>|No
124-
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|No
125-
| <<plugins-{type}s-{plugin}-ssl_certificate_verification>> |<<boolean,boolean>>|No
123+
| <<plugins-{type}s-{plugin}-ssl_certificate>> |<<path,path>>|No
124+
| <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> |list of <<path,path>>|No
125+
| <<plugins-{type}s-{plugin}-ssl_cipher_suites>> |list of <<string,string>>|No
126+
| <<plugins-{type}s-{plugin}-ssl_enabled>> |<<boolean,boolean>>|No
127+
| <<plugins-{type}s-{plugin}-ssl_key>> |<<path,path>>|No
128+
| <<plugins-{type}s-{plugin}-ssl_keystore_password>> |<<password,password>>|No
129+
| <<plugins-{type}s-{plugin}-ssl_keystore_path>> |<<path,path>>|No
130+
| <<plugins-{type}s-{plugin}-ssl_keystore_type>> |<<string,string>>|No
131+
| <<plugins-{type}s-{plugin}-ssl_supported_protocols>> |<<string,string>>|No
132+
| <<plugins-{type}s-{plugin}-ssl_truststore_password>> |<<password,password>>|No
133+
| <<plugins-{type}s-{plugin}-ssl_truststore_path>> |<<path,path>>|No
134+
| <<plugins-{type}s-{plugin}-ssl_truststore_type>> |<<string,string>>|No
135+
| <<plugins-{type}s-{plugin}-ssl_verification_mode>> |<<string,string>>, one of `["full", "none"]`|No
126136
| <<plugins-{type}s-{plugin}-socket_timeout_seconds>> | <<number,number>>|No
127137
| <<plugins-{type}s-{plugin}-target>> | {logstash-ref}/field-references-deepdive.html[field reference] | No
128138
| <<plugins-{type}s-{plugin}-retries>> | <<number,number>>|No
@@ -140,21 +150,13 @@ input plugins.
140150
* Value type is <<password,password>>
141151
* There is no default value for this setting.
142152

143-
Authenticate using Elasticsearch API key. Note that this option also requires enabling the `ssl` option.
153+
Authenticate using Elasticsearch API key. Note that this option also requires enabling the <<plugins-{type}s-{plugin}-ssl_enabled>> option.
144154

145155
Format is `id:api_key` where `id` and `api_key` are as returned by the
146156
Elasticsearch
147157
{ref}/security-api-create-api-key.html[Create
148158
API key API].
149159

150-
[id="plugins-{type}s-{plugin}-ca_file"]
151-
===== `ca_file`
152-
153-
* Value type is <<path,path>>
154-
* There is no default value for this setting.
155-
156-
SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary.
157-
158160
[id="plugins-{type}s-{plugin}-ca_trusted_fingerprint"]
159161
===== `ca_trusted_fingerprint`
160162

@@ -406,28 +408,138 @@ NOTE: The Elasticsearch manual indicates that there can be _negative_ performanc
406408
If the `slices` parameter is left unset, the plugin will _not_ inject slice
407409
instructions into the query.
408410

409-
[id="plugins-{type}s-{plugin}-ssl"]
410-
===== `ssl`
411+
[id="plugins-{type}s-{plugin}-ssl_certificate"]
412+
===== `ssl_certificate`
413+
* Value type is <<path,path>>
414+
* There is no default value for this setting.
415+
416+
SSL certificate to use to authenticate the client. This certificate should be an OpenSSL-style X.509 certificate file.
417+
418+
NOTE: This setting can be used only if <<plugins-{type}s-{plugin}-ssl_key>> is set.
419+
420+
[id="plugins-{type}s-{plugin}-ssl_certificate_authorities"]
421+
===== `ssl_certificate_authorities`
422+
423+
* Value type is a list of <<path,path>>
424+
* There is no default value for this setting
425+
426+
The `.cer` or `.pem` files to validate the server's certificate.
427+
428+
NOTE: You cannot use this setting and <<plugins-{type}s-{plugin}-ssl_truststore_path>> at the same time.
429+
430+
[id="plugins-{type}s-{plugin}-ssl_cipher_suites"]
431+
===== `ssl_cipher_suites`
432+
* Value type is a list of <<string,string>>
433+
* There is no default value for this setting
434+
435+
The list of cipher suites to use, listed by priorities.
436+
Supported cipher suites vary depending on the Java and protocol versions.
437+
438+
[id="plugins-{type}s-{plugin}-ssl_enabled"]
439+
===== `ssl_enabled`
411440

412441
* Value type is <<boolean,boolean>>
413-
* Default value is `false`
442+
* There is no default value for this setting.
414443

415-
If enabled, SSL will be used when communicating with the Elasticsearch
416-
server (i.e. HTTPS will be used instead of plain HTTP).
444+
Enable SSL/TLS secured communication to Elasticsearch cluster.
445+
Leaving this unspecified will use whatever scheme is specified in the URLs listed in <<plugins-{type}s-{plugin}-hosts>> or extracted from the <<plugins-{type}s-{plugin}-cloud_id>>.
446+
If no explicit protocol is specified plain HTTP will be used.
417447

418-
[id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
419-
===== `ssl_certificate_verification`
448+
[id="plugins-{type}s-{plugin}-ssl_key"]
449+
===== `ssl_key`
450+
* Value type is <<path,path>>
451+
* There is no default value for this setting.
420452

421-
* Value type is <<boolean,boolean>>
422-
* Default value is `true`
453+
OpenSSL-style RSA private key that corresponds to the <<plugins-{type}s-{plugin}-ssl_certificate>>.
423454

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**.
455+
NOTE: This setting can be used only if <<plugins-{type}s-{plugin}-ssl_certificate>> is set.
456+
457+
[id="plugins-{type}s-{plugin}-ssl_keystore_password"]
458+
===== `ssl_keystore_password`
459+
460+
* Value type is <<password,password>>
461+
* There is no default value for this setting.
462+
463+
Set the keystore password
464+
465+
[id="plugins-{type}s-{plugin}-ssl_keystore_path"]
466+
===== `ssl_keystore_path`
467+
468+
* Value type is <<path,path>>
469+
* There is no default value for this setting.
470+
471+
The keystore used to present a certificate to the server.
472+
It can be either `.jks` or `.p12`
473+
474+
NOTE: You cannot use this setting and <<plugins-{type}s-{plugin}-ssl_certificate>> at the same time.
475+
476+
[id="plugins-{type}s-{plugin}-ssl_keystore_type"]
477+
===== `ssl_keystore_type`
478+
479+
* Value can be any of: `jks`, `pkcs12`
480+
* If not provided, the value will be inferred from the keystore filename.
481+
482+
The format of the keystore file. It must be either `jks` or `pkcs12`.
483+
484+
[id="plugins-{type}s-{plugin}-ssl_supported_protocols"]
485+
===== `ssl_supported_protocols`
486+
487+
* Value type is <<string,string>>
488+
* Allowed values are: `'TLSv1.1'`, `'TLSv1.2'`, `'TLSv1.3'`
489+
* Default depends on the JDK being used. With up-to-date Logstash, the default is `['TLSv1.2', 'TLSv1.3']`.
490+
`'TLSv1.1'` is not considered secure and is only provided for legacy applications.
491+
492+
List of allowed SSL/TLS versions to use when establishing a connection to the Elasticsearch cluster.
493+
494+
For Java 8 `'TLSv1.3'` is supported only since **8u262** (AdoptOpenJDK), but requires that you set the
495+
`LS_JAVA_OPTS="-Djdk.tls.client.protocols=TLSv1.3"` system property in Logstash.
496+
497+
NOTE: If you configure the plugin to use `'TLSv1.1'` on any recent JVM, such as the one packaged with Logstash,
498+
the protocol is disabled by default and needs to be enabled manually by changing `jdk.tls.disabledAlgorithms` in
499+
the *$JDK_HOME/conf/security/java.security* configuration file. That is, `TLSv1.1` needs to be removed from the list.
500+
501+
[id="plugins-{type}s-{plugin}-ssl_truststore_password"]
502+
===== `ssl_truststore_password`
503+
504+
* Value type is <<password,password>>
505+
* There is no default value for this setting.
506+
507+
Set the truststore password.
508+
509+
[id="plugins-{type}s-{plugin}-ssl_truststore_path"]
510+
===== `ssl_truststore_path`
511+
512+
* Value type is <<path,path>>
513+
* There is no default value for this setting.
514+
515+
The truststore to validate the server's certificate.
516+
It can be either .jks or .p12.
517+
518+
NOTE: You cannot use this setting and <<plugins-{type}s-{plugin}-ssl_certificate_authorities>> at the same time.
519+
520+
[id="plugins-{type}s-{plugin}-ssl_truststore_type"]
521+
===== `ssl_truststore_type`
522+
523+
* Value can be any of: `jks`, `pkcs12`
524+
* If not provided, the value will be inferred from the truststore filename.
525+
526+
The format of the truststore file. It must be either `jks` or `pkcs12`.
527+
528+
[id="plugins-{type}s-{plugin}-ssl_verification_mode"]
529+
===== `ssl_verification_mode`
530+
531+
* Value can be any of: `full`, `none`
532+
* Default value is `full`
533+
534+
Defines how to verify the certificates presented by another party in the TLS connection:
535+
536+
`full` validates that the server certificate has an issue date that’s within
537+
the not_before and not_after dates; chains to a trusted Certificate Authority (CA), and
538+
has a hostname or IP address that matches the names within the certificate.
539+
540+
`none` performs no certificate validation.
541+
542+
WARNING: Setting certificate verification to `none` disables many security benefits of SSL/TLS, which is very dangerous. For more information on disabling certificate verification please read https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
431543

432544
[id="plugins-{type}s-{plugin}-socket_timeout_seconds"]
433545
===== `socket_timeout_seconds`
@@ -463,6 +575,55 @@ option when authenticating to the Elasticsearch server. If set to an
463575
empty string authentication will be disabled.
464576

465577

578+
[id="plugins-{type}s-{plugin}-deprecated-options"]
579+
==== Elasticsearch Input deprecated configuration options
580+
581+
This plugin supports the following deprecated configurations.
582+
583+
WARNING: Deprecated options are subject to removal in future releases.
584+
585+
[cols="<,<,<",options="header",]
586+
|=======================================================================
587+
|Setting|Input type|Replaced by
588+
| <<plugins-{type}s-{plugin}-ca_file>> |a valid filesystem path|<<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
589+
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|<<plugins-{type}s-{plugin}-ssl_enabled>>
590+
| <<plugins-{type}s-{plugin}-ssl_certificate_verification>> |<<boolean,boolean>>|<<plugins-{type}s-{plugin}-ssl_verification_mode>>
591+
|=======================================================================
592+
593+
[id="plugins-{type}s-{plugin}-ca_file"]
594+
===== `ca_file`
595+
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
596+
597+
* Value type is <<path,path>>
598+
* There is no default value for this setting.
599+
600+
SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary.
601+
602+
[id="plugins-{type}s-{plugin}-ssl"]
603+
===== `ssl`
604+
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
605+
606+
* Value type is <<boolean,boolean>>
607+
* Default value is `false`
608+
609+
If enabled, SSL will be used when communicating with the Elasticsearch
610+
server (i.e. HTTPS will be used instead of plain HTTP).
611+
612+
613+
[id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
614+
===== `ssl_certificate_verification`
615+
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_verification_mode>>]
616+
617+
* Value type is <<boolean,boolean>>
618+
* Default value is `true`
619+
620+
Option to validate the server's certificate. Disabling this severely compromises security.
621+
When certificate validation is disabled, this plugin implicitly trusts the machine
622+
resolved at the given address without validating its proof-of-identity.
623+
In this scenario, the plugin can transmit credentials to or process data from an untrustworthy
624+
man-in-the-middle or other compromised infrastructure.
625+
More information on the importance of certificate verification:
626+
**https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf**.
466627

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

0 commit comments

Comments
 (0)