fluent-plugin-syslog-tls 0.5.0 → 0.6.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
  SHA1:
3
- metadata.gz: 5edc3aa71986c902deb084d88ab9bed3300e60c1
4
- data.tar.gz: 6862dea55d337fed6b6738188f877a00b0b64e69
3
+ metadata.gz: ddf273fb2c9a34084d8a7a1feb129bc1bbb1839b
4
+ data.tar.gz: dfdc191ec721da7055e0378d1ce56cc0f6764a5c
5
5
  SHA512:
6
- metadata.gz: e6c585a645fbf5cb43da9b2a7fe2c7ab4f1302a963f116e0e60c480804688ef01f90156baa066fc6c601bc809f1d6b65b0301a251458c91c8c74d557edd8a4e5
7
- data.tar.gz: 6db891b9196133b8315f9f1394c41cec4fe9f8e22d7172d070cea805e825de36f1eff5fcc6e56252cbec010bc03a6ede2a978f778960c8d57c107ef0a8fd802f
6
+ metadata.gz: 4319df63af40e195d1d027103c520a93fba78919094a8d2b4cb6b29e0665eaed8a0342fc8c9c3c48f6daa73d5f31db96e0f3ec17cbd106f72870b0e024e1af3a
7
+ data.tar.gz: cc5cfffaa6760872316e6952332dfaf2ba79691863fcde49d5ae81ad84672f94a5963d3d2c626f9a7c0b09284d9c2c768bb345558f2a9bf675834a78a3814a5e
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  *.rbc
3
3
  /.config
4
4
  /coverage/
5
- /Gemfile.lock
6
5
  /InstalledFiles
7
6
  /pkg/
8
7
  /spec/reports/
@@ -30,8 +29,8 @@ build/
30
29
  # for a library or gem, you might want to ignore these files since the code is
31
30
  # intended to run in multiple environments; otherwise, check them in:
32
31
  # Gemfile.lock
33
- # .ruby-version
34
- # .ruby-gemset
32
+ .ruby-version
33
+ .ruby-gemset
35
34
 
36
35
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
37
36
  .rvmrc
data/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ Note: v0.5+ is compatible with Fluent 0.12. Use v1.0+ with Fluent 0.14.
2
+
3
+ #### 0.6.0
4
+ * Backport `ca_cert` from master to fluent-0.12 branch
5
+ - Added `ca_cert` to validate the remote certificate. Defaults to 'system' which uses the system certificate store.
6
+
7
+
8
+ #### 0.5.0
9
+
10
+ Comparable to 1.0.0 from [master (Fluent 0.14) branch](https://github.com/zarqman/fluent-plugin-syslog-tls).
11
+
12
+ * Standard fluent formatting plugins are supported. Json output remains the default.
13
+ * `token` (Structured Data in syslog terms) is now optional, for syslog hosts that don't require it.
14
+ * Message payload in the syslog packet no longer duplicates Time or includes Tag by default.
15
+
16
+
17
+ #### < 0.2.0
18
+
19
+ From [Fluent::Plugin::SumologicCloudSyslog](https://github.com/acquia/fluent-plugin-sumologic-cloud-syslog)
data/Gemfile.lock ADDED
@@ -0,0 +1,85 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fluent-plugin-syslog-tls (0.6.0)
5
+ fluent-mixin-config-placeholders (~> 0.3)
6
+ fluentd (~> 0.12.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.5.1)
12
+ public_suffix (~> 2.0, >= 2.0.2)
13
+ cool.io (1.5.0)
14
+ coveralls (0.8.21)
15
+ json (>= 1.8, < 3)
16
+ simplecov (~> 0.14.1)
17
+ term-ansicolor (~> 1.3)
18
+ thor (~> 0.19.4)
19
+ tins (~> 1.6)
20
+ crack (0.4.3)
21
+ safe_yaml (~> 1.0.0)
22
+ docile (1.1.5)
23
+ fluent-mixin-config-placeholders (0.4.0)
24
+ fluentd
25
+ uuidtools (>= 2.1.5)
26
+ fluentd (0.12.39)
27
+ cool.io (>= 1.2.2, < 2.0.0)
28
+ http_parser.rb (>= 0.5.1, < 0.7.0)
29
+ json (>= 1.4.3)
30
+ msgpack (>= 0.5.11, < 2)
31
+ sigdump (~> 0.2.2)
32
+ string-scrub (>= 0.0.3, <= 0.0.5)
33
+ tzinfo (>= 1.0.0)
34
+ tzinfo-data (>= 1.0.0)
35
+ yajl-ruby (~> 1.0)
36
+ hashdiff (0.3.5)
37
+ http_parser.rb (0.6.0)
38
+ json (2.1.0)
39
+ minitest (5.10.3)
40
+ minitest-stub_any_instance (1.0.1)
41
+ msgpack (1.1.0)
42
+ power_assert (1.0.2)
43
+ public_suffix (2.0.5)
44
+ rake (10.5.0)
45
+ safe_yaml (1.0.4)
46
+ sigdump (0.2.4)
47
+ simplecov (0.14.1)
48
+ docile (~> 1.1.0)
49
+ json (>= 1.8, < 3)
50
+ simplecov-html (~> 0.10.0)
51
+ simplecov-html (0.10.1)
52
+ string-scrub (0.0.5)
53
+ term-ansicolor (1.6.0)
54
+ tins (~> 1.0)
55
+ test-unit (3.2.5)
56
+ power_assert
57
+ thor (0.19.4)
58
+ thread_safe (0.3.6)
59
+ tins (1.15.0)
60
+ tzinfo (1.2.3)
61
+ thread_safe (~> 0.1)
62
+ tzinfo-data (1.2017.2)
63
+ tzinfo (>= 1.0.0)
64
+ uuidtools (2.1.5)
65
+ webmock (2.3.2)
66
+ addressable (>= 2.3.6)
67
+ crack (>= 0.3.2)
68
+ hashdiff
69
+ yajl-ruby (1.3.0)
70
+
71
+ PLATFORMS
72
+ ruby
73
+
74
+ DEPENDENCIES
75
+ coveralls
76
+ fluent-plugin-syslog-tls!
77
+ minitest (~> 5.8)
78
+ minitest-stub_any_instance (~> 1.0.0)
79
+ rake (~> 10.5)
80
+ simplecov (~> 0.11)
81
+ test-unit (~> 3.1)
82
+ webmock (~> 2.0)
83
+
84
+ BUNDLED WITH
85
+ 1.14.6
data/README.md CHANGED
@@ -8,20 +8,20 @@ Tested with [Papertrail](https://papertrailapp.com) and should also work with [S
8
8
 
9
9
 
10
10
  ## Installation
11
- ---
11
+
12
12
  ```sh
13
- $ gem install fluent-plugin-syslog-tls -v '~> 0.5'
13
+ $ gem install fluent-plugin-syslog-tls -v '~> 0.6'
14
14
  ```
15
15
  or
16
16
  ```sh
17
- $ td-agent-gem install fluent-plugin-syslog-tls -v '~> 0.5'
17
+ $ td-agent-gem install fluent-plugin-syslog-tls -v '~> 0.6'
18
18
  ```
19
19
 
20
20
  _Hint: Use v0.5+ for Fluentd 0.12 and v1.0+ for Fluentd 0.14. (See Version Compatibility below.)_
21
21
 
22
22
 
23
23
  ## Configuration
24
- ---
24
+
25
25
  In your Fluentd configuration, use `@type syslog_tls`. Examples:
26
26
 
27
27
  Sumologic:
@@ -58,15 +58,11 @@ Note that the v1.x series has more features and is more robust than the v0.x ser
58
58
 
59
59
  ## Origin/History
60
60
 
61
- This plugin is derived from [Fluent::Plugin::SumologicCloudSyslog](https://github.com/acquia/fluent-plugin-sumologic-cloud-syslog). Changes from the original:
62
-
63
- * Standard fluent formatting plugins are supported. Json output remains the default.
64
- * `token` (Structured Data in syslog terms) is now optional, for syslog hosts that don't require it.
65
- * Message payload in the syslog packet no longer duplicates Time or includes Tag by default.
61
+ This plugin is derived from [Fluent::Plugin::SumologicCloudSyslog](https://github.com/acquia/fluent-plugin-sumologic-cloud-syslog). Changes for the v0.x+ series are in this branch's [Changelog](CHANGELOG.md).
66
62
 
67
63
 
68
64
  ## License
69
- ---
65
+
70
66
  Except as otherwise noted this software is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
71
67
 
72
68
  Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +15,14 @@ Host represents DNS name of endpoint where should be data sent. Example: `syslog
15
15
 
16
16
  Example: `6514`
17
17
 
18
+ ### ca_cert
19
+
20
+ Whether and how to verify the server's TLS certificate. Examples:
21
+ * ca_cert system - Default; use the system CA certificate store (which must then be configured correctly)
22
+ * ca_cert false - Disable verification; not recommended
23
+ * ca_cert /path/to/file - A path+filename to a single CA file
24
+ * ca_cert /path/to/dir/ - A directory of CA files (in format that OpenSSL can parse); must end with /
25
+
18
26
  ### token
19
27
 
20
28
  Some services require a token to identify the account. Example: `ABABABABABABA@99999`. Not required for Papertrail.
@@ -27,6 +27,7 @@ module Fluent
27
27
 
28
28
  config_param :host, :string
29
29
  config_param :port, :integer
30
+ config_param :ca_cert, :string, default: 'system'
30
31
  config_param :token, :string, :default => nil
31
32
  config_param :cert, :string, :default => nil
32
33
  config_param :key, :string, :default => nil
@@ -89,7 +90,7 @@ module Fluent
89
90
  end
90
91
 
91
92
  def new_logger(tag)
92
- transport = ::SyslogTls::SSLTransport.new(host, port, cert: cert, key: key, max_retries: 3)
93
+ transport = ::SyslogTls::SSLTransport.new(host, port, ca_cert: ca_cert, cert: cert, key: key, max_retries: 3)
93
94
  logger = ::SyslogTls::Logger.new(transport, token)
94
95
  logger.facility(facility)
95
96
  logger.hostname(hostname)
@@ -20,11 +20,12 @@ module SyslogTls
20
20
  class SSLTransport
21
21
  attr_accessor :socket
22
22
 
23
- attr_reader :host, :port, :cert, :key, :ssl_version
23
+ attr_reader :host, :port, :ca_cert, :cert, :key, :ssl_version
24
24
 
25
25
  attr_writer :retries
26
26
 
27
- def initialize(host, port, cert: nil, key: nil, ssl_version: :TLSv1_2, max_retries: 1)
27
+ def initialize(host, port, ca_cert: 'system', cert: nil, key: nil, ssl_version: :TLSv1_2, max_retries: 1)
28
+ @ca_cert = ca_cert
28
29
  @host = host
29
30
  @port = port
30
31
  @cert = cert
@@ -46,9 +47,24 @@ module SyslogTls
46
47
  ctx.set_params(verify_mode: OpenSSL::SSL::VERIFY_PEER)
47
48
  ctx.ssl_version = ssl_version
48
49
 
49
- ctx.cert = OpenSSL::X509::Certificate.new(File.open(cert)) if cert
50
- ctx.key = OpenSSL::PKey::RSA.new(File.open(key)) if key
51
- OpenSSL::SSL::SSLSocket.new(tcp, ctx)
50
+ case ca_cert
51
+ when true, 'true', 'system'
52
+ # use system certs, same as openssl cli
53
+ ctx.cert_store = OpenSSL::X509::Store.new
54
+ ctx.cert_store.set_default_paths
55
+ when false, 'false'
56
+ ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
57
+ when %r{/$} # ends in /
58
+ ctx.ca_path = ca_cert
59
+ when String
60
+ ctx.ca_file = ca_cert
61
+ end
62
+
63
+ ctx.cert = OpenSSL::X509::Certificate.new(File.read(cert)) if cert
64
+ ctx.key = OpenSSL::PKey::read(File.read(key)) if key
65
+ socket = OpenSSL::SSL::SSLSocket.new(tcp, ctx)
66
+ socket.sync_close = true
67
+ socket
52
68
  end
53
69
 
54
70
  # Allow to retry on failed writes
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module SyslogTls
17
- VERSION = '0.5.0'
17
+ VERSION = '0.6.0'
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-syslog-tls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-11 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -132,7 +132,9 @@ files:
132
132
  - ".coveralls.yml"
133
133
  - ".gitignore"
134
134
  - ".travis.yml"
135
+ - CHANGELOG.md
135
136
  - Gemfile
137
+ - Gemfile.lock
136
138
  - LICENSE
137
139
  - README.md
138
140
  - Rakefile
@@ -172,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
174
  version: '0'
173
175
  requirements: []
174
176
  rubyforge_project:
175
- rubygems_version: 2.5.2
177
+ rubygems_version: 2.6.11
176
178
  signing_key:
177
179
  specification_version: 4
178
180
  summary: Fluent Syslog TLS output plugin