onyphe 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eedd7834c45c588f45486458d135dc85154dbc155a53c5a59fc03db87936468a
4
- data.tar.gz: 11adb31384bbc4289c80c8485ea5fa3fba952fe7e5b017bfe9609a8cf4f72d77
3
+ metadata.gz: 3fdf5767656d9b9c169eef9c558ea24f419ce33e3ab2035b8d1ab7b158a6e81e
4
+ data.tar.gz: 4adf3e68343be7bcf3c90116af0474d013a5d4ec995adbec9108bff54b101116
5
5
  SHA512:
6
- metadata.gz: 9edbed09d396675da7511a869cb68d0f5a652ffcb9f02930ad8756662bb31b6b82284353026f732a6a96c47be979a3f2784c040dd046b7668258d9ecadc2ffc7
7
- data.tar.gz: 47dd2abbd5a760def7bc340f4b974f61139c76fd0a2cd836ee5a06f8e36d6dfb7ac61d456a19669257525d827b335083fdcb6bab95e40a2c8c32409f0fa9fea3
6
+ metadata.gz: cfbd5a0f03b88b9bd82faf34015e85e7bb0e8ad02063225e40452b16dc91dc2e9023b79cb3e23f5e96203384fc7bb1cbf1c8e8c19b28e1acb461e598a8dafba8
7
+ data.tar.gz: e476f9957a6727185a1f1962a3ca95ec3d4b426568960449a63753b76ecc21d3a86cfbcbfc6bc53de73f5633397634b42917a3f853d7e5608924a1a72986b0fb
data/README.md CHANGED
@@ -25,6 +25,8 @@ Or install it yourself as:
25
25
 
26
26
  ## Usage
27
27
 
28
+ ### As a library
29
+
28
30
  ```rb
29
31
  require "ohyphe"
30
32
 
@@ -90,7 +92,7 @@ p res.to_h
90
92
  # => {:count=>10, :error=>0, :max_page=>3, :myip=>"<MY_IP>", :page=>1, :results=>[{:@category=>"sniffer", :@timestamp=>"2018-11-15T00:35:37.000Z", :@type=>"doc", :asn=>"AS20952", :city=>"London", :country=>"GB", ...
91
93
  ```
92
94
 
93
- ### Pagination
95
+ #### Pagination
94
96
 
95
97
  Enumerable style pagination is not supported at the present time.
96
98
 
@@ -106,6 +108,34 @@ max_page = res.max_page
106
108
  end
107
109
  ```
108
110
 
111
+ ### As a CLI tool
112
+
113
+ Note: make sure that your API key is set as an environment variable `ONYPHE_API_KEY` before using the CLI tool.
114
+
115
+ ```sh
116
+ $ onyphe
117
+ Commands:
118
+ onyphe ctl DOMAIN # It will return information for the given domain name X509 certificate information from CTLs with history of changes
119
+ onyphe datascan IP/STRING # It will return datascan information for the given IPv{4,6} address or string with history of changes
120
+ onyphe forward IP # It will return forward DNS lookup information for the given IPv{4,6} address with history of changes
121
+ onyphe geoloc IP # It will return geolocation information for the given IPv{4,6} address
122
+ onyphe help [COMMAND] # Describe available commands or one specific command
123
+ onyphe inetnum IP # It will return inetnum information for the given IPv{4,6} address with history of changes
124
+ onyphe ip IP # It will return a summary of all information for the given IPv{4,6} address
125
+ onyphe md5 MD5 # It will return information for the given datamd5 filter from datascan information category with history of changes
126
+ onyphe onionscan ONION # It will return information for the given onion domain with history of changes
127
+ onyphe pastries IP # It will return pastries information for the given IPv{4,6} address with history of changes
128
+ onyphe reverse IP # It will return reverse DNS lookup information for the given IPv{4,6} address with history of changes
129
+ onyphe sniffer IP # It will return information for the given IP address with history of changes
130
+ onyphe synscan IP # It will return synscan information for the given IPv{4,6} address with history of changes.
131
+ onyphe threattlist IP # It will return threatlist information for the given IPv{4,6} address with history of change
132
+ ```
133
+
134
+ ```sh
135
+ $ onyphe geoloc 1.1.1.1
136
+ {"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}
137
+ ```
138
+
109
139
  ## Contributing
110
140
 
111
141
  Bug reports and pull requests are welcome on GitHub at https://github.com/nioseki/onyphe.
@@ -74,7 +74,11 @@ module Onyphe
74
74
  def with_error_handling
75
75
  yield
76
76
  rescue StandardError => e
77
- puts "Warning: #{e}"
77
+ if e.to_s == "'api_key' argument is required"
78
+ puts "Please set your API key as an environment variable `ONYPHE_API_KEY`"
79
+ else
80
+ puts "Warning: #{e}"
81
+ end
78
82
  end
79
83
 
80
84
  def api
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onyphe
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onyphe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki