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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/investigate.rb +8 -1
  3. data/spec/tests.rb +6 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac625584a4ae8f946228752e85e8ff967d588d4b
4
- data.tar.gz: eb65489710eaefebb6e5253fe582b81fcdf92df9
3
+ metadata.gz: 538c5507bba753b5dfdbb89cd684ff66c7ec9053
4
+ data.tar.gz: 3bd96717e89bceb498c787638045027f5372af60
5
5
  SHA512:
6
- metadata.gz: b6af4681102260bdf2d264f1cea6bb2d32713e4e5701e384c84b649ec589c352889769cc5d2959fc485f69f36c5f5ab328c0205b1e98473e317b3680e84b61e5
7
- data.tar.gz: a6551994bad83549cfbeb092a08dc2e7f79cfef9424a2fa432e8d043063878bbbc670dcfc0df9553c9d621671eb47bfb5e69a3b412c6eebd598f1dd24123dfdb
6
+ metadata.gz: d4ac057484f33e3837a174a7eb6e8e687c27528e7557ddc985992b9ae770ba0af145cc17f66169c19fc9e1fbe51e547d0d677351e5dfea9e24d5eb57561ec7b3
7
+ data.tar.gz: 152453669de7352b18fede7bd2ea082b6db978a0c7ffa8bd8c616b893627c102c12c33f25c520a74d8aa444b3ae00444844ebeb8f7895b6767fb9f9b020cf48e
@@ -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.0.0'
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'.
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: investigate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - skyler