patronus_fati 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77314a1f422b9406896be845097f3e34caac361d
4
- data.tar.gz: dfc19b91d08947979be7c5d9846f4dbead43b4fc
3
+ metadata.gz: 1876ad36866eee6d82f0cb3b740f6b5ac0e460e6
4
+ data.tar.gz: edbc4d0d8d8a159f72ea951dc654013d6640dfe7
5
5
  SHA512:
6
- metadata.gz: 33790fafdb8dc74d96e912293684046e21bff2a817872a4ba5d237dce4fe833dba4c2d66341e30d7f52e08c8576e1f641b3c0f727d4ee5bfcc4981a5dfb21d86
7
- data.tar.gz: 5e85898991dd325cf5a8923fbef0dc6cf22748981672ab85bb43a6c68fcbd8b265275f194d3aff167d4b3af310e11fe4580ee290f17b19b34482e65f2b9aa805
6
+ metadata.gz: dd68e48ee06cc05affc19167124f95b61faa092daf3f924b94f49a35851c2ed53119b1b7192af0c69b573795bf42bb820079c1d9824f4721809ac13598136c01
7
+ data.tar.gz: b42937fd98ba1422cfaeb4fc236434555e36a2c7a94169cdf769ef84e7338dacf2d98d337a20d91f05036f7b0f31f45f9383629c3b5e8cd7130bb6ad61d84586
@@ -36,7 +36,7 @@ module PatronusFati
36
36
  Bssid.set_data_filter(:rangeip, :netmaskip, :gatewayip) { |val| (val == "0.0.0.0") ? nil : val }
37
37
 
38
38
  Bssid.set_data_filter(:freqmhz) do |val|
39
- raw = val.to_s.split('*').compact.reject { |i| i.strip.empty? }.map { |v| v.split(':').map(&:to_i) }
39
+ raw = val.to_s.split('*').compact.reject { |i| (i || '').strip.empty? }.map { |v| v.split(':').map(&:to_i) }
40
40
  Hash[raw]
41
41
  end
42
42
  end
@@ -35,10 +35,10 @@ module PatronusFati
35
35
  Client.set_data_filter(:gpsfixed) { |val| val.to_i == 1 }
36
36
 
37
37
  Client.set_data_filter(:ip, :gatewayip) { |val| (val == "0.0.0.0") ? nil : val }
38
- Client.set_data_filter(:dhcphost) { |val| val.strip.empty? ? nil : val }
38
+ Client.set_data_filter(:dhcphost) { |val| (val || '').strip.empty? ? nil : val }
39
39
 
40
40
  Client.set_data_filter(:freqmhz) do |val|
41
- raw = val.to_s.split('*').compact.reject { |i| i.strip.empty? }.map { |v| v.split(':').map(&:to_i) }
41
+ raw = val.to_s.split('*').compact.reject { |i| (i || '').strip.empty? }.map { |v| v.split(':').map(&:to_i) }
42
42
  Hash[raw]
43
43
  end
44
44
  end
@@ -5,6 +5,10 @@ module PatronusFati::MessageProcessor::Bssid
5
5
  # We don't care about objects that would have expired already...
6
6
  return if obj[:lasttime] < (Time.now.to_i - PatronusFati::AP_EXPIRATION)
7
7
 
8
+ # Some messages from kismet come in corrupted with partial MACs. We care
9
+ # not for them, just drop the bad data.
10
+ return unless obj[:mac].match(/^([0-9a-f]{2}[:-]){5}[0-9a-f]{2}$/)
11
+
8
12
  # Ignore probe requests as their BSSID information is useless (the ESSID
9
13
  # isn't present and it's coming from a client).
10
14
  return unless %w(infrastructure adhoc).include?(obj.type.to_s)
@@ -9,6 +9,10 @@ module PatronusFati::MessageProcessor::Client
9
9
  # devices not following the 802.11 spec.
10
10
  return if %w( unknown from_ds ).include?(obj[:type])
11
11
 
12
+ # Some messages from kismet come in corrupted with partial MACs. We care
13
+ # not for them, just drop the bad data.
14
+ return unless obj[:mac].match(/^([0-9a-f]{2}[:-]){5}[0-9a-f]{2}$/)
15
+
12
16
  client_info = client_data(obj.attributes)
13
17
  client = PatronusFati::DataModels::Client.first_or_create({bssid: obj[:mac]}, client_info)
14
18
  client.update(client_info)
@@ -1,3 +1,3 @@
1
1
  module PatronusFati
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patronus_fati
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stelfox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dm-constraints