forked from logstash-plugins/logstash-input-beats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduce client verification when using `ssl`, when using this option you need to specify the **Certificate Authority** using the `ssl_certificate_authorities` option, this configuration take a certificate to validate the client with it. You also need to specify a `ssl_verify_mode`, If you want strict ssl verification use `force_peer`, with this value if the client doesn't provide a valid certificate the plugins will refuse the client. On Filebeat you need to configure the client to declare a certificate using theses options. ``` tls: certificate_authorities: ["/etc/server.crt"] certificate: /etc/server.crt certificate_key: /etc/server.key ``` This change also introduce testing with travis-ci and an integration suite with filebeat and LSF for the SSL options. Fix: logstash-plugins#8
- Loading branch information
Showing
13 changed files
with
1,126 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sudo: false | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- jruby-1.7.24 | ||
before_script: | ||
- bundle exec rake test:integration:setup | ||
script: | ||
- bundle exec rspec spec | ||
- bundle exec rspec spec --tag integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,64 @@ | ||
# encoding: utf-8 | ||
|
||
OS_PLATFORM = RbConfig::CONFIG["host_os"] | ||
VENDOR_PATH = File.expand_path(File.join(File.dirname(__FILE__), "vendor")) | ||
if OS_PLATFORM == "linux" | ||
FILEBEAT_URL = "https://beats-nightlies.s3.amazonaws.com/filebeat/filebeat-5.0.0-nightlylatest-#{RbConfig::CONFIG["host_cpu"]}.tar.gz" | ||
else | ||
FILEBEAT_URL = "https://beats-nightlies.s3.amazonaws.com/filebeat/filebeat-5.0.0-nightlylatest-#{OS_PLATFORM}.tar.gz" | ||
end | ||
LSF_URL = "https://download.elastic.co/logstash-forwarder/binaries/logstash-forwarder_#{OS_PLATFORM}_amd64" | ||
|
||
require "fileutils" | ||
@files=[] | ||
|
||
task :default do | ||
system("rake -T") | ||
end | ||
|
||
require "logstash/devutils/rake" | ||
|
||
namespace :test do | ||
namespace :integration do | ||
task :setup do | ||
Rake::Task["test:integration:setup:filebeat"].invoke | ||
Rake::Task["test:integration:setup:lsf"].invoke | ||
end | ||
|
||
namespace :setup do | ||
desc "Download lastest stable version of Logstash-forwarder" | ||
task :lsf do | ||
destination = File.join(VENDOR_PATH, "logstash-forwarder") | ||
FileUtils.rm_rf(destination) | ||
FileUtils.mkdir_p(destination) | ||
download_destination = File.join(destination, "logstash-forwarder") | ||
puts "Logstash-forwarder: downloading from #{LSF_URL} to #{download_destination}" | ||
download(LSF_URL, download_destination) | ||
File.chmod(0755, download_destination) | ||
end | ||
|
||
desc "Download nigthly filebeat for integration testing" | ||
task :filebeat do | ||
FileUtils.mkdir_p(VENDOR_PATH) | ||
download_destination = File.join(VENDOR_PATH, "filebeat.tar.gz") | ||
destination = File.join(VENDOR_PATH, "filebeat") | ||
FileUtils.rm_rf(download_destination) | ||
FileUtils.rm_rf(destination) | ||
FileUtils.rm_rf(File.join(VENDOR_PATH, "filebeat.tar")) | ||
puts "Filebeat: downloading from #{FILEBEAT_URL} to #{download_destination}" | ||
download(FILEBEAT_URL, download_destination) | ||
|
||
untar_all(download_destination, File.join(VENDOR_PATH, "filebeat")) { |e| e } | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Uncompress all the file from the archive this only work with | ||
# one level directory structure and its fine for LSF and filebeat packaging. | ||
def untar_all(file, destination) | ||
untar(file) do |entry| | ||
out = entry.full_name.split("/").last | ||
File.join(destination, out) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.