Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ssl verification boolean and docs #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
| <<plugins-{type}s-{plugin}-size>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-slices>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-ssl>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-ssl_certificate_verification>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-user>> |<<string,string>>|No
|=======================================================================

Expand Down Expand Up @@ -300,6 +301,16 @@ instructions into the query.
If enabled, SSL will be used when communicating with the Elasticsearch
server (i.e. HTTPS will be used instead of plain HTTP).

[id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
===== `ssl_certificate_verification`

* Value type is <<boolean,boolean>>
* Default value is `true`

Option to validate the server's certificate. Disabling this severely compromises security.
For more information on disabling certificate verification please read
https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf

[id="plugins-{type}s-{plugin}-user"]
===== `user`

Expand Down
6 changes: 5 additions & 1 deletion lib/logstash/inputs/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
# SSL
config :ssl, :validate => :boolean, :default => false

# ssl_certificate_verification - Disable ssl_verification with false
config :ssl_certificate_verification, :validate => :boolean, :default => true

# SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary
config :ca_file, :validate => :path

Expand Down Expand Up @@ -197,7 +200,8 @@ def register
else
@hosts
end
ssl_options = { :ssl => true, :ca_file => @ca_file } if @ssl && @ca_file
ssl_options = { :ssl => true, :ca_file => @ca_file, :verify => @ssl_certificate_verification } if @ssl && @ca_file
ssl_options ||= { :ssl => @ssl, :verify => @ssl_certificate_verification } if @ssl
ssl_options ||= {}

@logger.warn "Supplied proxy setting (proxy => '') has no effect" if @proxy.eql?('')
Expand Down