Nessus6 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +13 -0
- data/Nessus6.gemspec +1 -0
- data/lib/Nessus6/folders/methods.rb +18 -0
- data/lib/Nessus6/groups/methods.rb +35 -0
- data/lib/Nessus6/permissions/methods.rb +12 -0
- data/lib/Nessus6/scans/methods.rb +18 -0
- data/lib/Nessus6/version.rb +1 -1
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80b280c90c8525f396797ee7a8ede1eaafee968e
|
4
|
+
data.tar.gz: bb9bba8b28e74ffde223f0e88f2a15c7b285bd7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adca72a28588ee39fc1ccaee35eb9d78783637eaf136f702b984b62f88c7b3b61ff61e686a1153a2aeb907750723896bfa9bf494ca12e11bf7a7c8ee7f7c001a
|
7
|
+
data.tar.gz: 8ec5723e60ea92f8220dd9357b0359edd4d5074dccca9c394bce984c7870e8221a839cd3ae4848410e9a413d3928149dd7f164190ce5530ffc72c89858576880
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2015 Kevin Kirsche
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/Nessus6.gemspec
CHANGED
@@ -24,5 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.9"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "minitest", "~> 5.8"
|
27
|
+
spec.add_development_dependency "yard", "~> 0.8"
|
27
28
|
spec.add_runtime_dependency "hurley", "~> 0.1"
|
28
29
|
end
|
@@ -12,16 +12,31 @@ module Nessus6
|
|
12
12
|
@client = client
|
13
13
|
end
|
14
14
|
|
15
|
+
# Creates a new folder for the current user. This request requires
|
16
|
+
# read-only user permissions.
|
17
|
+
#
|
18
|
+
# @param name [String] The name of the folder.
|
19
|
+
# @return [Hash]
|
15
20
|
def create(name)
|
16
21
|
response = @client.post('folders', name: name)
|
17
22
|
verify_create response
|
18
23
|
end
|
19
24
|
|
25
|
+
# Deletes a folder. This request requires read-only user permissions.
|
26
|
+
#
|
27
|
+
# @param folder_id [String, Fixnum] The id of the folder to delete.
|
28
|
+
# @return [Hash]
|
20
29
|
def delete(folder_id)
|
21
30
|
response = @client.delete("folders/#{folder_id}")
|
22
31
|
verify_delete response
|
23
32
|
end
|
24
33
|
|
34
|
+
# Rename a folder for the current user. This request requires read-only
|
35
|
+
# user permissions.
|
36
|
+
#
|
37
|
+
# @param folder_id [String, Fixnum] The id of the folder to edit.
|
38
|
+
# @param name [String] The name of the folder.
|
39
|
+
# @return [Hash]
|
25
40
|
def edit(folder_id, name)
|
26
41
|
response = @client.put("folders/#{folder_id}", name: name)
|
27
42
|
verify_edit response
|
@@ -29,6 +44,9 @@ module Nessus6
|
|
29
44
|
|
30
45
|
alias_method :rename, :edit
|
31
46
|
|
47
|
+
# Returns the current user's scan folders.
|
48
|
+
#
|
49
|
+
# @return [Hash] { "folders": [folder Resource] }
|
32
50
|
def list
|
33
51
|
response = @client.get('folders')
|
34
52
|
verify_list response
|
@@ -12,26 +12,53 @@ module Nessus6
|
|
12
12
|
@client = client
|
13
13
|
end
|
14
14
|
|
15
|
+
# Add a user to the group. This request requires administrator user
|
16
|
+
# permissions.
|
17
|
+
#
|
18
|
+
# @param group_id [String, Fixnum] The unique id of the group.
|
19
|
+
# @param user_id [String, Fixnum] The unique id of the user.
|
20
|
+
# @return [Hash]
|
15
21
|
def add_user(group_id, user_id)
|
16
22
|
response = @client.post("groups/#{group_id}/users/#{user_id}")
|
17
23
|
verify_add_user response
|
18
24
|
end
|
19
25
|
|
26
|
+
# Create a group. This request requires administrator user
|
27
|
+
# permissions.
|
28
|
+
#
|
29
|
+
# @param name [String, Fixnum] The name of the group.
|
30
|
+
# @return [Hash]
|
20
31
|
def create(name)
|
21
32
|
response = @client.post('groups', name: name)
|
22
33
|
verify_create response
|
23
34
|
end
|
24
35
|
|
36
|
+
# Delete a group. This request requires administrator user
|
37
|
+
# permissions.
|
38
|
+
#
|
39
|
+
# @param group_id [String, Fixnum] The unique id of the group.
|
40
|
+
# @return [Hash]
|
25
41
|
def delete(group_id)
|
26
42
|
response = @client.delete("groups/#{group_id}")
|
27
43
|
verify_delete response
|
28
44
|
end
|
29
45
|
|
46
|
+
# Deletes a user from the group. This request requires administrator user
|
47
|
+
# permissions.
|
48
|
+
#
|
49
|
+
# @param group_id [String, Fixnum] The unique id of the group.
|
50
|
+
# @param user_id [String, Fixnum] The unique id of the user.
|
51
|
+
# @return [Hash]
|
30
52
|
def delete_user(group_id, user_id)
|
31
53
|
response = @client.delete("groups/#{group_id}/users/#{user_id}")
|
32
54
|
verify_delete_user response
|
33
55
|
end
|
34
56
|
|
57
|
+
# Edit a group. This request requires administrator user permissions.
|
58
|
+
#
|
59
|
+
# @param group_id [String, Fixnum] The unique id of the group.
|
60
|
+
# @param name [String] The name of the group.
|
61
|
+
# @return [Hash]
|
35
62
|
def edit(group_id, name)
|
36
63
|
response = @client.put("groups/#{group_id}", name: name)
|
37
64
|
verify_edit response
|
@@ -39,11 +66,19 @@ module Nessus6
|
|
39
66
|
|
40
67
|
alias_method :rename, :edit
|
41
68
|
|
69
|
+
# Returns the group list. This request requires read-only user permissions.
|
70
|
+
#
|
71
|
+
# @return [Hash]
|
42
72
|
def list
|
43
73
|
response = @client.get('groups')
|
44
74
|
verify_list response
|
45
75
|
end
|
46
76
|
|
77
|
+
# Return the group user list. This request requires administrator user
|
78
|
+
# permissions.
|
79
|
+
#
|
80
|
+
# @param group_id [String, Fixnum] The unique id of the group.
|
81
|
+
# @return [Hash]
|
47
82
|
def list_users(group_id)
|
48
83
|
response = @client.get("groups/#{group_id}/users")
|
49
84
|
verify_list_users response
|
@@ -10,12 +10,24 @@ module Nessus6
|
|
10
10
|
@client = client
|
11
11
|
end
|
12
12
|
|
13
|
+
# Changes the permissions for an object.
|
14
|
+
#
|
15
|
+
# @param object_type [String] The type of object.
|
16
|
+
# @param object_id [String, Fixnum] The unique id of the object.
|
17
|
+
# @param permissions [String] An array of permission resources to apply
|
18
|
+
# to the object.
|
19
|
+
# @return [Hash]
|
13
20
|
def change(object_type, object_id, permissions)
|
14
21
|
response = @client.put("permissions/#{object_type}/#{object_id}",
|
15
22
|
body: permissions)
|
16
23
|
verify_change response
|
17
24
|
end
|
18
25
|
|
26
|
+
# Returns the current object's permissions.
|
27
|
+
#
|
28
|
+
# @param object_type [String] The type of object.
|
29
|
+
# @param object_id [String, Fixnum] The unique id of the object.
|
30
|
+
# @return [Hash]
|
19
31
|
def list(object_type, object_id)
|
20
32
|
response = @client.get("permissions/#{object_type}/#{object_id}")
|
21
33
|
verify_list response
|
@@ -12,6 +12,13 @@ module Nessus6
|
|
12
12
|
@client = client
|
13
13
|
end
|
14
14
|
|
15
|
+
# Launches a scan.
|
16
|
+
#
|
17
|
+
# @param scan_id [String, Fixnum] The id of the scan to launch.
|
18
|
+
# @param alt_targets [Array] If specified, these targets will be scanned
|
19
|
+
# instead of the default. Value can be an array where each index is a
|
20
|
+
# target, or an array with a single index of comma separated targets.
|
21
|
+
# @return [Hash] The scan UUID or throws an error
|
15
22
|
def launch(scan_id, alt_targets = nil)
|
16
23
|
if alt_targets.is_a? Array
|
17
24
|
response = @client.post "scans/#{scan_id}/launch",
|
@@ -23,16 +30,27 @@ module Nessus6
|
|
23
30
|
verify_launch response
|
24
31
|
end
|
25
32
|
|
33
|
+
# Returns the scan list.
|
34
|
+
#
|
35
|
+
# @return [Hash] Returns the scan list.
|
26
36
|
def list
|
27
37
|
response = @client.get 'scans'
|
28
38
|
JSON.parse response.body
|
29
39
|
end
|
30
40
|
|
41
|
+
# Pauses a scan.
|
42
|
+
#
|
43
|
+
# @param scan_id [String, Fixnum] The id of the scan to pause.
|
44
|
+
# @return [Hash] The scan UUID or throws an error
|
31
45
|
def pause(scan_id)
|
32
46
|
response = @client.post "scans/#{scan_id}/pause"
|
33
47
|
verify_pause response
|
34
48
|
end
|
35
49
|
|
50
|
+
# Stops a scan.
|
51
|
+
#
|
52
|
+
# @param scan_id [String, Fixnum] The id of the scan to stop.
|
53
|
+
# @return [Hash] The scan UUID or throws an error
|
36
54
|
def stop(scan_id)
|
37
55
|
response = @client.post "scans/#{scan_id}/stop"
|
38
56
|
verify_stop response
|
data/lib/Nessus6/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Nessus6
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Kirsche
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: yard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.8'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.8'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: hurley
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,6 +90,7 @@ files:
|
|
76
90
|
- ".gitignore"
|
77
91
|
- ".travis.yml"
|
78
92
|
- Gemfile
|
93
|
+
- LICENSE
|
79
94
|
- Nessus6.gemspec
|
80
95
|
- README.md
|
81
96
|
- Rakefile
|
@@ -123,3 +138,4 @@ signing_key:
|
|
123
138
|
specification_version: 4
|
124
139
|
summary: "[Under Construction] Nessus 6 API Gem"
|
125
140
|
test_files: []
|
141
|
+
has_rdoc:
|