fluent-plugin-ssl-check 2.2.0 → 2.3.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
  SHA256:
3
- metadata.gz: 6f57a4e0f824d263cc4cde461a9b4846695309b16e7211486ba6ccd2e41365c0
4
- data.tar.gz: c93593774d277d9769bb953f0e7893bbaf7168adf514dadff415a2382b37e37b
3
+ metadata.gz: ab7b3def2e942f92cf1b8a1fa46f4c7bafe50fbee692334736e19574849e9911
4
+ data.tar.gz: 5083966b749ba1407cdce60b33f8952dce4b300c5bd7e33496e1b1e02ae0814a
5
5
  SHA512:
6
- metadata.gz: 4e4cdfd93bd663bfb08e75fc60b9cd5ec34d58957001207569932cd6696e2e6c51e5ae3392fcbf76caa624af9a1d00684e56646f2690a8d96fbdd778b7fc653c
7
- data.tar.gz: 3446b7d2cfb26a28754bafee5074725f8bff7a1381d1020128d61b01bb31ae7785b08762749c17fd83c378a78f8815e98c9809f5c5e5d9ccb874140114954be8
6
+ metadata.gz: fe0d1bd834d8831a510df5754cb488d2e543fbca465bf3b344312b92f236278fbd75cf972efee0d0ffc45838f4550d09f81dba34fbcbf0445810a831b6fda365
7
+ data.tar.gz: 8cef76bf6831eae2d1053a99699fc07f31077939bd3bc5ab28a402be4d709f9f4eec53ec9c14e954a01cefd5866a399e4d2ceeb373bd0e94d205023bf0375b3a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-ssl-check (2.2.0)
4
+ fluent-plugin-ssl-check (2.3.0)
5
5
  fluentd (>= 0.14.10, < 2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [Fluentd](https://fluentd.org/) input plugin to check ssl service.
4
4
 
5
+
5
6
  ## plugins
6
7
 
7
8
  ### in - ssl_check
@@ -42,6 +43,52 @@ Options are:
42
43
 
43
44
  If no port is specified with host, default port is 443.
44
45
 
46
+
47
+ ## output examples
48
+
49
+ ### log output example
50
+
51
+ ``` json
52
+ {
53
+ "timestamp": "2023-10-03T09:59:41.580+02:00",
54
+ "status": 1,
55
+ "host": "www.google.fr",
56
+ "port": 443,
57
+ "ssl_version": "TLSv1.2",
58
+ "ssl_dn": "/CN=*.google.fr",
59
+ "ssl_not_after": "2023-11-27T08:25:08.000Z",
60
+ "expire_in_days": 55,
61
+ "serial": "4e79dbb13c6b57b309780da2d1edbda4"
62
+ }
63
+ ```
64
+
65
+ ### metric output example
66
+
67
+ ``` json
68
+ {
69
+ "timestamp": "2023-10-03T10:06:21.417+02:00",
70
+ "metric_name": "ssl_status",
71
+ "metric_value": 1,
72
+ "host": "www.google.fr",
73
+ "port": 443,
74
+ "ssl_dn": "/CN=*.google.fr",
75
+ "ssl_version": "TLSv1.2",
76
+ "ssl_not_after": "2023-11-27T08:25:08.000Z",
77
+ "serial": "4e79dbb13c6b57b309780da2d1edbda4"
78
+ }
79
+
80
+ {
81
+ "timestamp": "2023-10-03T10:06:21.417+02:00",
82
+ "metric_name": "ssl_expirency",
83
+ "metric_value": 55,
84
+ "host": "www.google.fr",
85
+ "port": 443,
86
+ "ssl_dn": "/CN=*.google.fr",
87
+ "serial": "4e79dbb13c6b57b309780da2d1edbda4"
88
+ }
89
+ ```
90
+
91
+
45
92
  ## Installation
46
93
 
47
94
  Manual install, by executing:
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fluent-plugin-ssl-check'
8
- spec.version = '2.2.0'
8
+ spec.version = '2.3.0'
9
9
  spec.authors = ['Thomas Tych']
10
10
  spec.email = ['thomas.tych@gmail.com']
11
11
 
@@ -134,7 +134,8 @@ module Fluent
134
134
  'ssl_version' => ssl_info.ssl_version,
135
135
  'ssl_dn' => ssl_info.subject_s,
136
136
  'ssl_not_after' => ssl_info.not_after,
137
- 'expire_in_days' => ssl_info.expire_in_days
137
+ 'expire_in_days' => ssl_info.expire_in_days,
138
+ 'serial' => ssl_info.serial
138
139
  }
139
140
  record.update('error_class' => ssl_info.error_class) if ssl_info.error_class
140
141
  router.emit(tag, Fluent::EventTime.from_time(ssl_info.time), record)
@@ -154,7 +155,8 @@ module Fluent
154
155
  "#{event_prefix}port" => ssl_info.port,
155
156
  "#{event_prefix}ssl_dn" => ssl_info.subject_s,
156
157
  "#{event_prefix}ssl_version" => ssl_info.ssl_version,
157
- "#{event_prefix}ssl_not_after" => ssl_info.not_after
158
+ "#{event_prefix}ssl_not_after" => ssl_info.not_after,
159
+ "#{event_prefix}serial" => ssl_info.serial
158
160
  }
159
161
  router.emit(tag, Fluent::EventTime.from_time(ssl_info.time), record)
160
162
  end
@@ -168,7 +170,8 @@ module Fluent
168
170
  'metric_value' => ssl_info.expire_in_days,
169
171
  "#{event_prefix}host" => ssl_info.host,
170
172
  "#{event_prefix}port" => ssl_info.port,
171
- "#{event_prefix}ssl_dn" => ssl_info.subject_s
173
+ "#{event_prefix}ssl_dn" => ssl_info.subject_s,
174
+ "#{event_prefix}serial" => ssl_info.serial
172
175
  }
173
176
  router.emit(tag, Fluent::EventTime.from_time(ssl_info.time), record)
174
177
  end
@@ -219,6 +222,10 @@ module Fluent
219
222
  cert.not_after.iso8601(3)
220
223
  end
221
224
 
225
+ def serial
226
+ cert&.serial&.to_s(16)&.downcase
227
+ end
228
+
222
229
  def status
223
230
  return KO if error
224
231
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-ssl-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Tych
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bump