onyphe 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +4 -0
- data/lib/onyphe.rb +1 -0
- data/lib/onyphe/api.rb +4 -0
- data/lib/onyphe/client.rb +9 -0
- data/lib/onyphe/clients/alert.rb +24 -0
- data/lib/onyphe/version.rb +1 -1
- data/onyphe.gemspec +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4be6ceccc9070b0ff3e837f9df144bd8b1871f369559b735cbc24c3928de33e5
|
4
|
+
data.tar.gz: f21a7895f4c10fb3290f81a807912cfcc70477d53ecf0ba82800f736b3b6e9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c15b5f8728f4f5f67e620bc4b3fea7fa6e322c2bf139bbccdad9ace88abaa90b0f89c37b362534f8c2e4af986d43985b13795acc2917ee2e9a7cc9bc0805a03
|
7
|
+
data.tar.gz: 2f4b24073d4c4e9f7ffee038343814a46260846f1fbfad9d490277acd3c15e87133f5576576e5784648106fc619a1bc90969e47aa0517e31956ca4d0332a80ee
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -68,6 +68,10 @@ api.search.resolver(ip: "124.108.0.0/16")
|
|
68
68
|
api.search.sniffer(ip: "14.164.0.0/14")
|
69
69
|
api.search.ctl(host: "vpn")
|
70
70
|
api.search.onionscan("app.http.keywords": "dump")
|
71
|
+
|
72
|
+
api.alert.list
|
73
|
+
api.alert.add(name: "foo", query:"bar", email: "foo@bar.com")
|
74
|
+
api.alert.delete("id")
|
71
75
|
```
|
72
76
|
|
73
77
|
#### Pagination
|
data/lib/onyphe.rb
CHANGED
data/lib/onyphe/api.rb
CHANGED
data/lib/onyphe/client.rb
CHANGED
@@ -56,5 +56,14 @@ module Onyphe
|
|
56
56
|
get = Net::HTTP::Get.new(url)
|
57
57
|
request(get, &block)
|
58
58
|
end
|
59
|
+
|
60
|
+
def post(path, params = {}, &block)
|
61
|
+
url = url_for(path)
|
62
|
+
|
63
|
+
post = Net::HTTP::Post.new(url)
|
64
|
+
post.set_form_data params
|
65
|
+
post["Authorization"] = "apikey #{@api_key}"
|
66
|
+
request(post, &block)
|
67
|
+
end
|
59
68
|
end
|
60
69
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Onyphe
|
4
|
+
module Clients
|
5
|
+
class Alert < Client
|
6
|
+
def list
|
7
|
+
get("/v2/alert/list") { |json| json }
|
8
|
+
end
|
9
|
+
|
10
|
+
def add(name:, query:, email:)
|
11
|
+
params = {
|
12
|
+
name: name,
|
13
|
+
query: query,
|
14
|
+
email: email
|
15
|
+
}
|
16
|
+
post("/v2/alert/add", params) { |json| json }
|
17
|
+
end
|
18
|
+
|
19
|
+
def delete(id)
|
20
|
+
post("/v2/alert/del/#{id}") { |json| json }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/onyphe/version.rb
CHANGED
data/onyphe.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
27
|
spec.add_dependency "addressable", "~> 2.7"
|
28
|
-
spec.add_dependency "thor", "~> 0
|
28
|
+
spec.add_dependency "thor", "~> 1.0"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 2.
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
31
31
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
32
32
|
spec.add_development_dependency "rake", "~> 13.0"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.9"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onyphe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2.
|
47
|
+
version: '2.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2.
|
54
|
+
version: '2.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- lib/onyphe/api.rb
|
146
146
|
- lib/onyphe/cli.rb
|
147
147
|
- lib/onyphe/client.rb
|
148
|
+
- lib/onyphe/clients/alert.rb
|
148
149
|
- lib/onyphe/clients/ctl.rb
|
149
150
|
- lib/onyphe/clients/datascan.rb
|
150
151
|
- lib/onyphe/clients/forward.rb
|
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
182
|
- !ruby/object:Gem::Version
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
|
-
rubygems_version: 3.0.
|
185
|
+
rubygems_version: 3.0.3
|
185
186
|
signing_key:
|
186
187
|
specification_version: 4
|
187
188
|
summary: ONYPHE API wrapper for Ruby
|