Nessus6 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +49 -0
- data/.travis.yml +1 -0
- data/Nessus6.gemspec +6 -4
- data/README.md +7 -5
- data/Rakefile +1 -1
- data/lib/Nessus6.rb +1 -1
- data/lib/Nessus6/editor.rb +5 -1
- data/lib/Nessus6/file.rb +1 -0
- data/lib/Nessus6/folder.rb +1 -0
- data/lib/Nessus6/group.rb +1 -0
- data/lib/Nessus6/permission.rb +1 -0
- data/lib/Nessus6/plugin.rb +1 -0
- data/lib/Nessus6/plugin_rule.rb +1 -0
- data/lib/Nessus6/scan.rb +11 -0
- data/lib/Nessus6/scanner.rb +1 -0
- data/lib/Nessus6/server.rb +1 -0
- data/lib/Nessus6/session.rb +2 -1
- data/lib/Nessus6/user.rb +1 -0
- data/lib/Nessus6/verification.rb +1 -0
- data/lib/Nessus6/version.rb +2 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d5f74268631e12a7f57ba4a136bd591da5b1a37
|
4
|
+
data.tar.gz: f6eb5f515119e9b788c4ada09eefad0169d282d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14fc6d68c0e61e0076f90e35de06ffe5ff4a7972a6960dec149b3686fa2c5e18db81d1f01e2f2e48a3e25c8ff0ef13f210b9b57e4d85fadf78b6dc0a1444b805
|
7
|
+
data.tar.gz: 2448df2fefbbc269f1ca485cc63fa120da2b624175ce3faea7cf65b8d8e32da36b2d52d0be6a844abf83f6de08da8269a4e2a48eafb22ee0c09fa549cdbef5da
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# This is a sample .codeclimate.yml configured for Engine analysis on Code
|
2
|
+
# Climate Platform. For an overview of the Code Climate Platform, see here:
|
3
|
+
# http://docs.codeclimate.com/article/300-the-codeclimate-platform
|
4
|
+
|
5
|
+
# Under the engines key, you can configure which engines will analyze your repo.
|
6
|
+
# Each key is an engine name. For each value, you need to specify enabled: true
|
7
|
+
# to enable the engine as well as any other engines-specific configuration.
|
8
|
+
|
9
|
+
# For more details, see here:
|
10
|
+
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
|
11
|
+
|
12
|
+
# For a list of all available engines, see here:
|
13
|
+
# http://docs.codeclimate.com/article/296-engines-available-engines
|
14
|
+
|
15
|
+
# languages:
|
16
|
+
# Ruby: true
|
17
|
+
|
18
|
+
engines:
|
19
|
+
rubocop:
|
20
|
+
enabled: true
|
21
|
+
flay:
|
22
|
+
enabled: true
|
23
|
+
bundler-audit:
|
24
|
+
enabled: true
|
25
|
+
|
26
|
+
# Engines can analyze files and report issues on them, but you can separately
|
27
|
+
# decide which files will receive ratings based on those issues. This is
|
28
|
+
# specified by path patterns under the ratings key.
|
29
|
+
|
30
|
+
# For more details see here:
|
31
|
+
# http://docs.codeclimate.com/article/289-configuring-your-repository-via-codeclimate-yml#platform
|
32
|
+
|
33
|
+
ratings:
|
34
|
+
paths:
|
35
|
+
- bin/**
|
36
|
+
- lib/**
|
37
|
+
- test/**
|
38
|
+
- Rakefile
|
39
|
+
- Nessus6.gemspec
|
40
|
+
- Gemfile
|
41
|
+
# - "**.rb"
|
42
|
+
# - "**.go"
|
43
|
+
|
44
|
+
# You can globally exclude files from being analyzed by any engine using the
|
45
|
+
# exclude_paths key.
|
46
|
+
|
47
|
+
#exclude_paths:
|
48
|
+
#- spec/**/*
|
49
|
+
#- vendor/**/*
|
data/.travis.yml
CHANGED
data/Nessus6.gemspec
CHANGED
@@ -10,13 +10,15 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['kev.kirsche@gmail.com']
|
11
11
|
spec.license = 'Apache-2.0'
|
12
12
|
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
13
|
+
spec.summary = '[Under Construction] Nessus 6 API Gem'
|
14
|
+
spec.description = 'Gem for interacting with the Tenable Nessus 6 REST API.'
|
15
15
|
spec.homepage = 'https://github.com/kkirsche/Nessus6'
|
16
16
|
|
17
17
|
spec.required_ruby_version = '>= 2.0.0'
|
18
18
|
|
19
|
-
spec.files = `git ls-files -z`.split("\x0").reject
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |files|
|
20
|
+
files.match(%r{^(test|spec|features)/})
|
21
|
+
end
|
20
22
|
spec.bindir = 'exe'
|
21
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
24
|
spec.require_paths = ['lib']
|
@@ -26,5 +28,5 @@ Gem::Specification.new do |spec|
|
|
26
28
|
spec.add_development_dependency 'minitest', '~> 5.8'
|
27
29
|
spec.add_development_dependency 'yard', '~> 0.8'
|
28
30
|
spec.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
|
29
|
-
spec.add_runtime_dependency 'hurley', '~> 0.
|
31
|
+
spec.add_runtime_dependency 'hurley', '~> 0.2'
|
30
32
|
end
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
[![Code Climate](https://codeclimate.com/github/kkirsche/Nessus6/badges/gpa.svg)](https://codeclimate.com/github/kkirsche/Nessus6) [![Test Coverage](https://codeclimate.com/github/kkirsche/Nessus6/badges/coverage.svg)](https://codeclimate.com/github/kkirsche/Nessus6/coverage) [![Gem Version](https://badge.fury.io/rb/Nessus6.svg)](http://badge.fury.io/rb/Nessus6)
|
1
|
+
[![Build Status](https://travis-ci.org/kkirsche/Nessus6.svg)](https://travis-ci.org/kkirsche/Nessus6) [![Code Climate](https://codeclimate.com/github/kkirsche/Nessus6/badges/gpa.svg)](https://codeclimate.com/github/kkirsche/Nessus6) [![Test Coverage](https://codeclimate.com/github/kkirsche/Nessus6/badges/coverage.svg)](https://codeclimate.com/github/kkirsche/Nessus6/coverage) [![Gem Version](https://badge.fury.io/rb/Nessus6.svg)](http://badge.fury.io/rb/Nessus6)
|
2
2
|
|
3
3
|
# Nessus6
|
4
4
|
|
5
|
-
Welcome to
|
5
|
+
Welcome to the Nessus6 gem. This gem focuses on allowing you to programmatically interact with the Nessus version 6 REST API.
|
6
6
|
|
7
|
-
|
7
|
+
## Requires
|
8
|
+
* Nessus 6
|
9
|
+
* Ruby >= 2.0
|
8
10
|
|
9
11
|
## Installation
|
10
12
|
|
@@ -24,13 +26,13 @@ Or install it yourself as:
|
|
24
26
|
|
25
27
|
## Usage
|
26
28
|
|
27
|
-
|
29
|
+
To learn how to use this, please go to https://rubygems.org/gems/Nessus6 and then click on Documentation in the right hand menu or use Yard to generate documentation for this library locally.
|
28
30
|
|
29
31
|
## Development
|
30
32
|
|
31
33
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
34
|
|
33
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
35
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
34
36
|
|
35
37
|
## Contributing
|
36
38
|
|
data/Rakefile
CHANGED
data/lib/Nessus6.rb
CHANGED
@@ -29,7 +29,7 @@ module Nessus6
|
|
29
29
|
nessus[:port] = '8834' unless nessus.key?(:port)
|
30
30
|
|
31
31
|
# Create our client
|
32
|
-
@client = Hurley::Client.new
|
32
|
+
@client = Hurley::Client.new "https://#{nessus[:ip]}:#{nessus[:port]}"
|
33
33
|
@client.ssl_options.skip_verification = true
|
34
34
|
|
35
35
|
authenticate credentials
|
data/lib/Nessus6/editor.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# The Nessus6 module is used to interact with Nessus version 6 servers.
|
1
2
|
module Nessus6
|
2
3
|
# The Editor class is for interacting with Nessus6 templates. Templates are
|
3
4
|
# used to create scans or policies with predefined parameters.
|
@@ -58,6 +59,8 @@ module Nessus6
|
|
58
59
|
def list(type)
|
59
60
|
response = @client.get("editor/#{type}/templates")
|
60
61
|
verify response,
|
62
|
+
bad_request: 'Request could not be completed. Please use either '\
|
63
|
+
'type "scan" or type "policy".',
|
61
64
|
forbidden: 'You do not have permission to view the list',
|
62
65
|
internal_server_error: 'Internal server error occurred.'
|
63
66
|
end
|
@@ -72,7 +75,8 @@ module Nessus6
|
|
72
75
|
# the family.
|
73
76
|
# @return [Hash] The plugin output
|
74
77
|
def plugin_description(policy_id, family_id, plugin_id)
|
75
|
-
response = @client.get("editor/policy/#{policy_id}/families/#{family_id}
|
78
|
+
response = @client.get("editor/policy/#{policy_id}/families/#{family_id}"\
|
79
|
+
"/plugins/#{plugin_id}")
|
76
80
|
verify response,
|
77
81
|
internal_server_error: 'Internal server error occurred.'
|
78
82
|
end
|
data/lib/Nessus6/file.rb
CHANGED
data/lib/Nessus6/folder.rb
CHANGED
data/lib/Nessus6/group.rb
CHANGED
data/lib/Nessus6/permission.rb
CHANGED
data/lib/Nessus6/plugin.rb
CHANGED
data/lib/Nessus6/plugin_rule.rb
CHANGED
data/lib/Nessus6/scan.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# The Nessus6 module is used to interact with Nessus version 6 servers.
|
1
2
|
module Nessus6
|
2
3
|
# The Scans class is for interacting with Nessus6 scans.
|
3
4
|
# https://localhost:8834/api#/resources/scans
|
@@ -124,5 +125,15 @@ module Nessus6
|
|
124
125
|
not_found: 'Scan does not exist.',
|
125
126
|
conflict: 'Scan is not active.'
|
126
127
|
end
|
128
|
+
|
129
|
+
# Returns the timezone list for creating a scan.
|
130
|
+
#
|
131
|
+
# @return [Hash] The timezone resource
|
132
|
+
def timezones
|
133
|
+
response = @client.get 'scans/timezones'
|
134
|
+
verify response,
|
135
|
+
unauthorized: 'You do not have permission to view timezones',
|
136
|
+
internal_server_error: 'Internal server error occurred'
|
137
|
+
end
|
127
138
|
end
|
128
139
|
end
|
data/lib/Nessus6/scanner.rb
CHANGED
data/lib/Nessus6/server.rb
CHANGED
data/lib/Nessus6/session.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# The Nessus6 module is used to interact with Nessus version 6 servers.
|
1
2
|
module Nessus6
|
2
3
|
# The Session class is used to create a session with Nessus6. User sessions
|
3
4
|
# allow us to interact throughout our applications.
|
@@ -22,7 +23,7 @@ module Nessus6
|
|
22
23
|
# @return [String] The session token
|
23
24
|
def create(username, password)
|
24
25
|
response = @client.post('session',
|
25
|
-
|
26
|
+
username: username, password: password)
|
26
27
|
verified = verify response,
|
27
28
|
bad_request: 'Username format is not valid',
|
28
29
|
unauthorized: 'Username or password is invalid',
|
data/lib/Nessus6/user.rb
CHANGED
data/lib/Nessus6/verification.rb
CHANGED
@@ -7,6 +7,7 @@ require 'Nessus6/error/not_found'
|
|
7
7
|
require 'Nessus6/error/unauthorized'
|
8
8
|
require 'Nessus6/error/unknown'
|
9
9
|
|
10
|
+
# The Nessus6 module is used to interact with Nessus version 6 servers.
|
10
11
|
module Nessus6
|
11
12
|
# The verification class allows methods to verify responses from Nessus
|
12
13
|
module Verification
|
data/lib/Nessus6/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Kirsche
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
89
|
+
version: '0.2'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
96
|
+
version: '0.2'
|
97
97
|
description: Gem for interacting with the Tenable Nessus 6 REST API.
|
98
98
|
email:
|
99
99
|
- kev.kirsche@gmail.com
|
@@ -101,6 +101,7 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- ".codeclimate.yml"
|
104
105
|
- ".gitignore"
|
105
106
|
- ".travis.yml"
|
106
107
|
- Gemfile
|