investigate 1.0.0 → 1.1.0
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/investigate.rb +8 -1
- data/spec/tests.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 538c5507bba753b5dfdbb89cd684ff66c7ec9053
|
4
|
+
data.tar.gz: 3bd96717e89bceb498c787638045027f5372af60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ac057484f33e3837a174a7eb6e8e687c27528e7557ddc985992b9ae770ba0af145cc17f66169c19fc9e1fbe51e547d0d677351e5dfea9e24d5eb57561ec7b3
|
7
|
+
data.tar.gz: 152453669de7352b18fede7bd2ea082b6db978a0c7ffa8bd8c616b893627c102c12c33f25c520a74d8aa444b3ae00444844ebeb8f7895b6767fb9f9b020cf48e
|
data/lib/investigate.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rest-client'
|
|
3
3
|
|
4
4
|
# Ruby API for the OpenDNS Security Graph
|
5
5
|
class Investigate
|
6
|
-
VERSION = '1.
|
6
|
+
VERSION = '1.1.0'
|
7
7
|
SGRAPH_URL = 'https://investigate.api.opendns.com'
|
8
8
|
SIPHASH_KEY = 'Umbrella/OpenDNS'
|
9
9
|
SUPPORTED_DNS_TYPES = [
|
@@ -94,6 +94,13 @@ class Investigate
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
+
# Gets the latest known malicious domains associated with the given
|
98
|
+
# IP address, if any. Returns the list of malicious domains.
|
99
|
+
def latest_domains(ip)
|
100
|
+
resp = get("/ips/#{ip}/latest_domains")
|
101
|
+
resp.map { |h| h['name'] }
|
102
|
+
end
|
103
|
+
|
97
104
|
private
|
98
105
|
|
99
106
|
# Make a GET call to '/dnsdb/ip/a/{ip}.json'.
|
data/spec/tests.rb
CHANGED
@@ -96,4 +96,10 @@ describe "Investigate" do
|
|
96
96
|
has_keys?(tag_entry['period'], ['begin', 'end'])
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
it "does latest_domains() correctly" do
|
101
|
+
resp_json = @sg.latest_domains('46.161.41.43')
|
102
|
+
expect(resp_json.kind_of?(Array)).to eq true
|
103
|
+
expect(resp_json.length).to be > 0
|
104
|
+
end
|
99
105
|
end
|