logstash-filter-fingerprint 3.4.1 → 3.4.2

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: 314340e6e62bfa1dc34740e1f44af4313668c797dc99cb15b8fc37519f601c75
4
- data.tar.gz: bba012a2b02065879152ac51fe926e8ba8beef8ed96d577b3aecb4555a255dce
3
+ metadata.gz: 5f2a16bce946eb4f6e8397822a4abf882c600dcce7dee9fb10d4a94c186921b7
4
+ data.tar.gz: 74a90fce053b44de8fcd0991f24f84fe2cfe6eedf7971ef4dd170f467d7b04c5
5
5
  SHA512:
6
- metadata.gz: bb420df3e75d292c83cf6e7f6488ff6bad9b194d45787ee43c1e2b2fadb9fc038b42b6ebb8d2403b852d111799ebc139819109a559abd59692693ca8d7fed42b
7
- data.tar.gz: 451164868428c63860da386b856c4ea0adff10ce290ae24dc4a5d45a7b8ab12a6c90c74bf352bcab0af702cec820d9cba1fcf04889ed02bac63a45b93037d03a
6
+ metadata.gz: e086c37f7f9a7321741febefb51a3ab35ffdad9ca635da178aec9378131842cce321df124c545b7c10149ec5c588b965ee13b2a2857fe034fd31654e3aebb1b2
7
+ data.tar.gz: 4fef51f2ecf2a468006d8aca31ea225aac49ceca8826b8f4e4048bb2ad2d6052d22d388fa50b468ed5618c130c5e94d6a6b4f846c5cc86be4a4b45a446e85e13
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.4.2
2
+ - Key config type changed to `Password` type for better protection from leaks. [#71](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/71)
3
+
1
4
  ## 3.4.1
2
5
  - Added backward compatibility of timestamp format to provide consistent fingerprint [#67](https://github.com/logstash-plugins/logstash-filter-fingerprint/pull/67)
3
6
 
data/docs/index.asciidoc CHANGED
@@ -59,7 +59,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
59
59
  | <<plugins-{type}s-{plugin}-concatenate_sources>> |<<boolean,boolean>>|No
60
60
  | <<plugins-{type}s-{plugin}-concatenate_all_fields>> |<<boolean,boolean>>|No
61
61
  | <<plugins-{type}s-{plugin}-ecs_compatibility>> | <<string,string>>|No
62
- | <<plugins-{type}s-{plugin}-key>> |<<string,string>>|No
62
+ | <<plugins-{type}s-{plugin}-key>> |<<password,password>>|No
63
63
  | <<plugins-{type}s-{plugin}-method>> |<<string,string>>, one of `["SHA1", "SHA256", "SHA384", "SHA512", "MD5", "MURMUR3", "MURMUR3_128", IPV4_NETWORK", "UUID", "PUNCTUATION"]`|Yes
64
64
  | <<plugins-{type}s-{plugin}-source>> |<<array,array>>|No
65
65
  | <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
@@ -164,7 +164,7 @@ See <<plugins-{type}s-{plugin}-ecs_metadata>> for detailed information.
164
164
  [id="plugins-{type}s-{plugin}-key"]
165
165
  ===== `key`
166
166
 
167
- * Value type is <<string,string>>
167
+ * Value type is <<password,password>>
168
168
  * There is no default value for this setting.
169
169
 
170
170
  When used with the `IPV4_NETWORK` method fill in the subnet prefix length.
@@ -61,7 +61,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
61
61
 
62
62
  # When used with the `IPV4_NETWORK` method fill in the subnet prefix length.
63
63
  # With other methods, optionally fill in the HMAC key.
64
- config :key, :validate => :string
64
+ config :key, :validate => :password
65
65
 
66
66
  # When set to `true`, the `SHA1`, `SHA256`, `SHA384`, `SHA512`, `MD5` and `MURMUR3_128` fingerprint
67
67
  # methods will produce base64 encoded rather than hex encoded strings.
@@ -199,7 +199,7 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
199
199
 
200
200
  def fingerprint_ipv4_network(ip_string)
201
201
  # in JRuby 1.7.11 outputs as US-ASCII
202
- IPAddr.new(ip_string).mask(@key.to_i).to_s.force_encoding(Encoding::UTF_8)
202
+ IPAddr.new(ip_string).mask(@key.value.to_i).to_s.force_encoding(Encoding::UTF_8)
203
203
  end
204
204
 
205
205
  def fingerprint_openssl(data)
@@ -220,10 +220,10 @@ class LogStash::Filters::Fingerprint < LogStash::Filters::Base
220
220
  end
221
221
  else
222
222
  if @base64encode
223
- hash = OpenSSL::HMAC.digest(digest, @key, data.to_s)
223
+ hash = OpenSSL::HMAC.digest(digest, @key.value, data.to_s)
224
224
  Base64.strict_encode64(hash).force_encoding(Encoding::UTF_8)
225
225
  else
226
- OpenSSL::HMAC.hexdigest(digest, @key, data.to_s).force_encoding(Encoding::UTF_8)
226
+ OpenSSL::HMAC.hexdigest(digest, @key.value, data.to_s).force_encoding(Encoding::UTF_8)
227
227
  end
228
228
  end
229
229
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-fingerprint'
4
- s.version = '3.4.1'
4
+ s.version = '3.4.2'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = "Fingerprints fields by replacing values with a consistent hash"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -29,7 +29,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
29
29
 
30
30
  describe "the IPV4_NETWORK method" do
31
31
  let(:fingerprint_method) { "IPV4_NETWORK" }
32
- let(:config) { super().merge("key" => 24) }
32
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("24")) }
33
33
 
34
34
  it "fingerprints the ip as the network" do
35
35
  expect(fingerprint).to eq("123.123.123.0")
@@ -115,7 +115,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
115
115
  end
116
116
 
117
117
  context "with HMAC" do
118
- let(:config) { super().merge("key" => "longencryptionkey") }
118
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("longencryptionkey")) }
119
119
 
120
120
  it "fingerprints the value" do
121
121
  expect(fingerprint).to eq("fdc60acc4773dc5ac569ffb78fcb93c9630797f4")
@@ -141,7 +141,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
141
141
  expect(fingerprint).to eq("4dabcab210766e35f03e77120e6986d6e6d4752b2a9ff22980b9253d026080d8")
142
142
  end
143
143
  context "with HMAC" do
144
- let(:config) { super().merge("key" => "longencryptionkey") }
144
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("longencryptionkey")) }
145
145
  it "fingerprints the value" do
146
146
  expect(fingerprint).to eq("345bec3eff242d53b568916c2610b3e393d885d6b96d643f38494fd74bf4a9ca")
147
147
  end
@@ -160,7 +160,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
160
160
  expect(fingerprint).to eq("fd605b0a3af3e04ce0d7a0b0d9c48d67a12dab811f60072e6eae84e35d567793ffb68a1807536f11c90874065c2a4392")
161
161
  end
162
162
  context "with HMAC" do
163
- let(:config) { super().merge("key" => "longencryptionkey") }
163
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("longencryptionkey")) }
164
164
  it "fingerprints the value" do
165
165
  expect(fingerprint).to eq("22d4c0e8c4fbcdc4887d2038fca7650f0e2e0e2457ff41c06eb2a980dded6749561c814fe182aff93e2538d18593947a")
166
166
  end
@@ -178,7 +178,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
178
178
  expect(fingerprint).to eq("5468e2dc64ea92b617782aae884b35af60041ac9e168a283615b6a462c54c13d42fa9542cce9b7d76a8124ac6616818905e3e5dd35d6e519f77c3b517558639a")
179
179
  end
180
180
  context "with HMAC" do
181
- let(:config) { super().merge("key" => "longencryptionkey") }
181
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("longencryptionkey")) }
182
182
  it "fingerprints the value" do
183
183
  expect(fingerprint).to eq("11c19b326936c08d6c50a3c847d883e5a1362e6a64dd55201a25f2c1ac1b673f7d8bf15b8f112a4978276d573275e3b14166e17246f670c2a539401c5bfdace8")
184
184
  end
@@ -196,7 +196,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
196
196
  expect(fingerprint).to eq("ccdd8d3d940a01b2fb3258c059924c0d")
197
197
  end
198
198
  context "with HMAC" do
199
- let(:config) { super().merge("key" => "longencryptionkey") }
199
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("longencryptionkey")) }
200
200
  it "fingerprints the value" do
201
201
  expect(fingerprint).to eq("9336c879e305c9604a3843fc3e75948f")
202
202
  end
@@ -281,7 +281,7 @@ describe LogStash::Filters::Fingerprint, :ecs_compatibility_support, :aggregate_
281
281
  let(:config) { super().merge("source" => ['@timestamp']) }
282
282
 
283
283
  describe 'OpenSSL Fingerprinting' do
284
- let(:config) { super().merge("key" => '0123') }
284
+ let(:config) { super().merge("key" => ::LogStash::Util::Password.new("0123")) }
285
285
  let(:fingerprint_method) { "SHA1" }
286
286
  let(:data) { { "@timestamp" => epoch_time } }
287
287
  it "fingerprints the timestamp correctly" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-16 00:00:00.000000000 Z
11
+ date: 2023-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement