README.md in onyphe-1.1.0 vs README.md in onyphe-2.0.0

- old
+ new

@@ -1,13 +1,13 @@ # Onyphe-rb [![Gem Version](https://badge.fury.io/rb/onyphe.svg)](https://badge.fury.io/rb/onyphe) -[![Build Status](https://travis-ci.org/ninoseki/onyphe-rb.svg?branch=master)](https://travis-ci.org/ninoseki/onyphe-rb) +[![Build Status](https://travis-ci.com/ninoseki/onyphe-rb.svg?branch=master)](https://travis-ci.com/ninoseki/onyphe-rb) [![Coverage Status](https://coveralls.io/repos/github/ninoseki/onyphe-rb/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/onyphe-rb?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/c4afca9e0ff94d11a53332c0598b868f)](https://www.codacy.com/app/ninoseki/onyphe-rb) -[Onyphe](https://www.onyphe.io) API wrapper for Ruby. +[Onyphe](https://www.onyphe.io) v2 API wrapper for Ruby. ## Installation Add this line to your application's Gemfile: @@ -33,43 +33,18 @@ # When given nothing, it tries to load your API key from ENV["ONYPHE_API_KEY"] api = Onyphe::API.new # or you can pass your API key as an argument api = Onyphe::API.new(YOUR_API_KEY) -api.ctl("github.com") -api.datascan("1.1.1.1") -api.forward("1.1.1.1") -api.geoloc("1.1.1.1") -api.inetnum("1.1.1.1") -api.ip("1.1.1.1") -api.md5("44d88612fea8a8f36de82e1278abb02f") -api.onionscan("3fyb44wdhnd2ghhl.onion") -api.pastries("1.1.1.1") -api.reverse("1.1.1.1") -api.sniffer("1.1.1.1") -api.synscan("1.1.1.1") -api.threatlist("1.1.1.1") +api.summary.ip("1.1.1.1") +api.summary.domain("example.com") +api.summary.hostname("example.com") -api.search.datascan( - os: "Windows", - port: 443, - product: "HTTP Server", - tls: true -) -api.search.synscan( - country: "FR", - port: 23, - tag: "mirai" -) +api.simple.geoloc("1.1.1.1") +api.simple.ctl("example.com") -api.search.inetnum(organization: "OVH SAS") -api.search.threatlist(country: "RU") -api.search.pastries(content: "hacked") -api.search.resolver(ip: "124.108.0.0/16") -api.search.sniffer(ip: "14.164.0.0/14") -api.search.ctl(host: "vpn") -api.search.onionscan("app.http.keywords": "dump") +api.search("category:datascan product:Nginx protocol:http os:Windows tls:true") api.alert.list api.alert.add(name: "foo", query:"bar", email: "foo@bar.com") api.alert.delete("id") ``` @@ -79,44 +54,16 @@ Enumerable style pagination is not supported at the present time. You can specify page index by passing `page` argument to the method. ```rb -res = api.search.threatlist(country: "RU", page: 1) -page = res.page -max_page = res.max_page +res = api.simple.threatlist(country: "RU", page: 1) +page = res.dig("page") +max_page = res.dig("max_page") -((page + 1)..max_page).each do |page_index| - res = api.search.threatlist({ country: "RU" }, page = page_index) +((page + 1)..max_page).each do |index| + res = api.simple.threatlist({ country: "RU" }, page = index) end -``` - -### As a CLI tool - -Note: make sure that your API key is set as an environment variable `ONYPHE_API_KEY` before using the CLI tool. - -```sh -$ onyphe -Commands: - onyphe ctl DOMAIN # It will return information for the given domain name X509 certificate information from CTLs with history of changes - onyphe datascan IP/STRING # It will return datascan information for the given IPv{4,6} address or string with history of changes - onyphe forward IP # It will return forward DNS lookup information for the given IPv{4,6} address with history of changes - onyphe geoloc IP # It will return geolocation information for the given IPv{4,6} address - onyphe help [COMMAND] # Describe available commands or one specific command - onyphe inetnum IP # It will return inetnum information for the given IPv{4,6} address with history of changes - onyphe ip IP # It will return a summary of all information for the given IPv{4,6} address - onyphe md5 MD5 # It will return information for the given datamd5 filter from datascan information category with history of changes - onyphe onionscan ONION # It will return information for the given onion domain with history of changes - onyphe pastries IP # It will return pastries information for the given IPv{4,6} address with history of changes - onyphe reverse IP # It will return reverse DNS lookup information for the given IPv{4,6} address with history of changes - onyphe sniffer IP # It will return information for the given IP address with history of changes - onyphe synscan IP # It will return synscan information for the given IPv{4,6} address with history of changes. - onyphe threattlist IP # It will return threatlist information for the given IPv{4,6} address with history of change -``` - -```sh -$ onyphe geoloc 1.1.1.1 -{"count":1,"error":0,"myip":"x.x.x.x","results":[{"@category":"geoloc","@timestamp":"2018-11-18T00:15:50.000Z","@type":"doc","asn":"AS13335","city":"","country":"AU","ip":"1.1.1.1","ipv6":"false","latitude":"-33.4940","location":"-33.4940,143.2104","longitude":"143.2104","organization":"Cloudflare, Inc.","subnet":"1.1.1.0/24"}],"status":"ok","took":"0.000","total":1} ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/nioseki/onyphe.