dap 0.1.14 → 0.1.15
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/lib/dap/filter/geoip.rb +14 -8
- data/lib/dap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adf8abb293a1c85685f6fc76159e3ab5be1dc757
|
4
|
+
data.tar.gz: 1205a2a56d1650c411558601e2cd8f028779a980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60103d15be7a449573bfb1c8b496978e60bd86f5949443c886ae10fd32985c542bcfe1442075bc91fee869b4910497ed0ac628dbfb4cd1b48f67a87ae0c95b7f
|
7
|
+
data.tar.gz: 15dce6f7722ae2d7424163af019d810faf055baabfeda62756983e6255ce22e1a2b761ff1d48ef457b19cab1be38df4cc5d9b0cd0f54e2524fdaae17a56134ef
|
data/lib/dap/filter/geoip.rb
CHANGED
@@ -4,7 +4,7 @@ module Dap
|
|
4
4
|
module Filter
|
5
5
|
|
6
6
|
module GeoIPLibrary
|
7
|
-
GEOIP_DIRS = [
|
7
|
+
GEOIP_DIRS = [
|
8
8
|
File.expand_path( File.join( File.dirname(__FILE__), "..", "..", "..", "data")),
|
9
9
|
"/var/lib/geoip"
|
10
10
|
]
|
@@ -38,18 +38,20 @@ module GeoIPLibrary
|
|
38
38
|
break
|
39
39
|
end
|
40
40
|
end
|
41
|
-
end
|
41
|
+
end
|
42
42
|
end
|
43
43
|
|
44
44
|
|
45
45
|
#
|
46
|
-
# Add GeoIP tags using the MaxMind GeoIP::City
|
46
|
+
# Add GeoIP tags using the MaxMind GeoIP::City
|
47
47
|
#
|
48
48
|
class FilterGeoIP
|
49
49
|
include BaseDecoder
|
50
50
|
include GeoIPLibrary
|
51
51
|
def decode(ip)
|
52
|
-
|
52
|
+
unless @@geo_city
|
53
|
+
raise "No MaxMind GeoIP::City data found"
|
54
|
+
end
|
53
55
|
geo_hash = @@geo_city.look_up(ip)
|
54
56
|
return unless geo_hash
|
55
57
|
ret = {}
|
@@ -57,7 +59,7 @@ class FilterGeoIP
|
|
57
59
|
next unless k
|
58
60
|
ret[k.to_s] = v.to_s
|
59
61
|
end
|
60
|
-
|
62
|
+
|
61
63
|
ret
|
62
64
|
end
|
63
65
|
end
|
@@ -69,7 +71,9 @@ class FilterGeoIPOrg
|
|
69
71
|
include BaseDecoder
|
70
72
|
include GeoIPLibrary
|
71
73
|
def decode(ip)
|
72
|
-
|
74
|
+
unless @@geo_orgs
|
75
|
+
raise "No MaxMind GeoIP::Organization data found"
|
76
|
+
end
|
73
77
|
geo_hash = @@geo_orgs.look_up(ip)
|
74
78
|
return unless (geo_hash and geo_hash[:name])
|
75
79
|
{ :org => geo_hash[:name] }
|
@@ -78,12 +82,14 @@ end
|
|
78
82
|
|
79
83
|
#
|
80
84
|
# Add GeoIP ASN tags using the MaxMind GeoIP::ASN database
|
81
|
-
#
|
85
|
+
#
|
82
86
|
class FilterGeoIPAsn
|
83
87
|
include BaseDecoder
|
84
88
|
include GeoIPLibrary
|
85
89
|
def decode(ip)
|
86
|
-
|
90
|
+
unless @@geo_asn
|
91
|
+
raise "No MaxMind GeoIP::ASN data found"
|
92
|
+
end
|
87
93
|
geo_hash = @@geo_asn.look_up(ip)
|
88
94
|
return unless (geo_hash and geo_hash[:name])
|
89
95
|
{ :asn => geo_hash[:name].split(' ')[0] }
|
data/lib/dap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
version: '0'
|
254
254
|
requirements: []
|
255
255
|
rubyforge_project:
|
256
|
-
rubygems_version: 2.5.2
|
256
|
+
rubygems_version: 2.4.5.2
|
257
257
|
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: 'DAP: The Data Analysis Pipeline'
|