patronus_fati 1.3.5 → 1.3.6
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 +4 -4
- data/DATA_CLEANUP_TASKS.md +4 -0
- data/bin/patronus_fati +1 -1
- data/lib/patronus_fati/data_models/access_point.rb +17 -4
- data/lib/patronus_fati/data_models/client.rb +1 -1
- data/lib/patronus_fati/data_models/ssid.rb +1 -1
- data/lib/patronus_fati/message_models/bssid.rb +2 -1
- data/lib/patronus_fati/message_processor/client.rb +2 -2
- data/lib/patronus_fati/message_processor.rb +2 -29
- data/lib/patronus_fati/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61ba287f4168013f92fa49e04138633d212d535a
|
4
|
+
data.tar.gz: d566e6a16567e1d3cd5d30cf82c7125b6c01549c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a129ae80a6cf7ef9e645bf0eac7f319cae3de7bf120794c64188a91c7c8166c505969ae279c537052449ce76b1fd7bb059e5cfeadbbf58c57118cec3b94a4694
|
7
|
+
data.tar.gz: b65d3ef79d1ccebeed87355537cb57aad5a45497d0385dddff529662a69b6f6bf729c88464409a56be223cfd5a3e57c8fca179820ed0c77c79c54eed453dec51
|
@@ -0,0 +1,4 @@
|
|
1
|
+
* Multiple cloaked access points result in flapping of settings (we assume a max of 1)
|
2
|
+
* Adjust channel tracking to include breakdown of time APs spend on channels
|
3
|
+
* Adjust encryption tracking to hold down flapping changes to the largest inclusive set
|
4
|
+
* Investigate duplicate BSSIDs on multiple bands
|
data/bin/patronus_fati
CHANGED
@@ -40,7 +40,7 @@ exception_logger('process') do
|
|
40
40
|
connection.connect
|
41
41
|
|
42
42
|
PatronusFati.event_handler.on(:any) do |asset_type, event_type, msg, diagnostics|
|
43
|
-
|
43
|
+
STDERR.puts(JSON.generate(
|
44
44
|
{
|
45
45
|
asset_type: asset_type,
|
46
46
|
event_type: event_type,
|
@@ -29,7 +29,7 @@ module PatronusFati
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def announce_changes
|
32
|
-
return unless dirty? && valid?
|
32
|
+
return unless dirty? && valid? && worth_syncing?
|
33
33
|
|
34
34
|
if active?
|
35
35
|
status = new? ? :new : :changed
|
@@ -126,9 +126,14 @@ module PatronusFati
|
|
126
126
|
|
127
127
|
def track_ssid(ssid_data)
|
128
128
|
self.ssids ||= {}
|
129
|
-
ssids[ssid_data[:essid]] ||= DataModels::Ssid.new(ssid_data[:essid])
|
130
129
|
|
131
|
-
|
130
|
+
ssid_key = ssid_data[:cloaked] ?
|
131
|
+
Digest::SHA256.hexdigest(ssid_data[:crypt_set].join) :
|
132
|
+
ssid_data[:essid]
|
133
|
+
|
134
|
+
ssids[ssid_key] ||= DataModels::Ssid.new(ssid_data[:essid])
|
135
|
+
|
136
|
+
ssid = ssids[ssid_key]
|
132
137
|
ssid.presence.mark_visible
|
133
138
|
ssid.update(ssid_data)
|
134
139
|
|
@@ -138,7 +143,7 @@ module PatronusFati
|
|
138
143
|
def update(attrs)
|
139
144
|
attrs.each do |k, v|
|
140
145
|
next unless LOCAL_ATTRIBUTE_KEYS.include?(k)
|
141
|
-
next if local_attributes[k] == v
|
146
|
+
next if v.nil? || local_attributes[k] == v
|
142
147
|
|
143
148
|
set_sync_flag(:dirtyAttributes)
|
144
149
|
local_attributes[k] = v
|
@@ -155,6 +160,14 @@ module PatronusFati
|
|
155
160
|
result = Louis.lookup(local_attributes[:bssid])
|
156
161
|
result['long_vendor'] || result['short_vendor']
|
157
162
|
end
|
163
|
+
|
164
|
+
# This is a safety mechanism to check whether or not an access point is
|
165
|
+
# actually 'present'. This is intended to assist in cutting out the
|
166
|
+
# access points that are just on the edge of being visible to our sensors.
|
167
|
+
def worth_syncing?
|
168
|
+
client_macs.any? || sync_flag?(:syncedOnline) ||
|
169
|
+
(presence && presence.visible_time && presence.visible_time > INTERVAL_DURATION)
|
170
|
+
end
|
158
171
|
end
|
159
172
|
end
|
160
173
|
end
|
@@ -22,9 +22,10 @@ module PatronusFati
|
|
22
22
|
:minnoise_rssi, :maxsignal_rssi, :maxnoise_rssi,
|
23
23
|
:bestlat, :bestlon, :bestalt, :agglat, :agglon,
|
24
24
|
:aggalt, :aggpoints, :datasize, :turbocellnid,
|
25
|
-
:turbocellmode, :turbocellsat, :carrierset,
|
25
|
+
:turbocellmode, :turbocellsat, :carrierset,
|
26
26
|
:maxseenrate, :encodingset, :decrypted, :dupeivpackets,
|
27
27
|
:bsstimestamp, :fragments, :retries, :newpackets) { |val| val.to_i }
|
28
|
+
Bssid.set_data_filter(:channel) { |val| val.to_i == 0 ? nil : val.to_i }
|
28
29
|
|
29
30
|
# Attempt to map the returned BSSID type to one we know about it and
|
30
31
|
# convert it to a string. In the event we don't know it will leave this as
|
@@ -50,8 +50,8 @@ module PatronusFati::MessageProcessor::Client
|
|
50
50
|
client.announce_changes
|
51
51
|
|
52
52
|
# Don't deal in associations that are outside of our connection expiration
|
53
|
-
# time... or if we don't have
|
54
|
-
return if access_point.nil? ||
|
53
|
+
# time... or if we don't have a valid access point
|
54
|
+
return if access_point.nil? || !access_point.valid? ||
|
55
55
|
obj[:lasttime] < PatronusFati::DataModels::Connection.current_expiration_threshold
|
56
56
|
|
57
57
|
connection_key = "#{obj[:bssid]}^#{obj[:mac]}"
|
@@ -41,32 +41,6 @@ module PatronusFati
|
|
41
41
|
DataModels::Client.instances.reject! { |_, ap| ap.presence.dead? }
|
42
42
|
end
|
43
43
|
|
44
|
-
def self.report_recently_seen
|
45
|
-
@next_recent_msg ||= Time.now.to_i + 240
|
46
|
-
|
47
|
-
if @next_recent_msg <= Time.now.to_i
|
48
|
-
@next_recent_msg = Time.now.to_i + 240
|
49
|
-
cutoff_time = Time.now.to_i - 300
|
50
|
-
|
51
|
-
aps = DataModels::AccessPoint.instances.map do |bssid, ap|
|
52
|
-
next unless ap.active? && ap.presence.visible_since?(cutoff_time)
|
53
|
-
bssid
|
54
|
-
end.compact
|
55
|
-
|
56
|
-
clients = DataModels::Client.instances.map do |mac, client|
|
57
|
-
next unless client.active? && client.presence.visible_since?(cutoff_time)
|
58
|
-
mac
|
59
|
-
end.compact
|
60
|
-
|
61
|
-
return if clients.empty? && aps.empty?
|
62
|
-
PatronusFati.event_handler.event(
|
63
|
-
:sync,
|
64
|
-
:recent,
|
65
|
-
{ access_points: aps, clients: clients }
|
66
|
-
)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
44
|
def self.handle(message_obj)
|
71
45
|
if !PatronusFati.past_initial_flood? && @last_msg_received && (Time.now.to_f - @last_msg_received) >= 0.8
|
72
46
|
PatronusFati.past_initial_flood!
|
@@ -74,7 +48,6 @@ module PatronusFati
|
|
74
48
|
@last_msg_received = Time.now.to_f
|
75
49
|
|
76
50
|
periodic_flush
|
77
|
-
report_recently_seen
|
78
51
|
result = factory(class_to_name(message_obj), message_obj)
|
79
52
|
cleanup_models
|
80
53
|
result
|
@@ -106,13 +79,13 @@ module PatronusFati
|
|
106
79
|
clients = []
|
107
80
|
|
108
81
|
PatronusFati::DataModels::AccessPoint.instances.each do |bssid, access_point|
|
109
|
-
next unless access_point.
|
82
|
+
next unless access_point.sync_flag?(:syncedOnline)
|
110
83
|
PatronusFati.event_handler.event(:access_point, :sync, access_point.full_state, access_point.diagnostic_data)
|
111
84
|
access_points << bssid
|
112
85
|
end
|
113
86
|
|
114
87
|
PatronusFati::DataModels::Client.instances.each do |mac, client|
|
115
|
-
next unless client.
|
88
|
+
next unless client.sync_flag?(:syncedOnline)
|
116
89
|
PatronusFati.event_handler.event(:client, :sync, client.full_state, client.diagnostic_data)
|
117
90
|
clients << mac
|
118
91
|
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: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stelfox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: louis
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- ".gitignore"
|
134
134
|
- ".rspec"
|
135
135
|
- ".yardopts"
|
136
|
+
- DATA_CLEANUP_TASKS.md
|
136
137
|
- Gemfile
|
137
138
|
- LICENSE
|
138
139
|
- README.md
|