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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67207fc36dd073bd4d9dcca0e5e006da3d978565
4
- data.tar.gz: a8e5ef92f78f4a92c3ae3d69df70a423bcef441c
3
+ metadata.gz: 1d5f74268631e12a7f57ba4a136bd591da5b1a37
4
+ data.tar.gz: f6eb5f515119e9b788c4ada09eefad0169d282d8
5
5
  SHA512:
6
- metadata.gz: ad144c667cc670901f42f9a021de9877d088300966ab57967ecc3736f81f7f81d342c0fd1e04bd5cab2c1f1ec60607ac45312bd2dfc7531de0c699eabadbdb0e
7
- data.tar.gz: 0b9ed6e0c6193cc023bd8bfef559348de1842ca4cc0daec36cfbc64b667c9c217722aba207e68bb9d45849fa2d16ec33588b6f9547f98ac493aa28e708e018e1
6
+ metadata.gz: 14fc6d68c0e61e0076f90e35de06ffe5ff4a7972a6960dec149b3686fa2c5e18db81d1f01e2f2e48a3e25c8ff0ef13f210b9b57e4d85fadf78b6dc0a1444b805
7
+ data.tar.gz: 2448df2fefbbc269f1ca485cc63fa120da2b624175ce3faea7cf65b8d8e32da36b2d52d0be6a844abf83f6de08da8269a4e2a48eafb22ee0c09fa549cdbef5da
@@ -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/**/*
@@ -7,6 +7,7 @@ rvm:
7
7
  - 2.2.0
8
8
  - 2.2.1
9
9
  - 2.2.2
10
+ - 2.2.3
10
11
  - rbx-2
11
12
  - ruby-head
12
13
  - jruby-head
@@ -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 = %q{[Under Construction] Nessus 6 API Gem}
14
- spec.description = %q{Gem for interacting with the Tenable Nessus 6 REST API.}
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 { |f| f.match(%r{^(test|spec|features)/}) }
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.1'
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 your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Nessus6`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
35
+ To install this gem onto your local machine, run `bundle exec rake install`.
34
36
 
35
37
  ## Contributing
36
38
 
data/Rakefile CHANGED
@@ -8,4 +8,4 @@ Rake::TestTask.new(:test) do |t|
8
8
  t.pattern = 'test/spec/**/*_spec.rb'
9
9
  end
10
10
 
11
- task :default => :test
11
+ task default: :test
@@ -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 'https://' + nessus[:ip] + ':' + nessus[:port]
32
+ @client = Hurley::Client.new "https://#{nessus[:ip]}:#{nessus[:port]}"
33
33
  @client.ssl_options.skip_verification = true
34
34
 
35
35
  authenticate credentials
@@ -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}/plugins/#{plugin_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
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The File class is for uploading files to Nessus.
3
4
  # https://localhost:8834/api#/resources/file
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Folders class is for interacting with Nessus6 folders. Folders are used
3
4
  # to sort and organize a user's scan results.
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Groups class is for interacting with Nessus6 user groups. Groups are
3
4
  # utilized to make sharing easier.
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Permissions class is for interacting with Nessus6 user permissions.
3
4
  # Permissions are used to provide access rights to a given object.
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Plugin class is for interacting with Nessus6 plugins.
3
4
  # https://localhost:8834/api#/resources/plugins
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Plugin class is for interacting with Nessus6 plugins.
3
4
  # https://localhost:8834/api#/resources/plugins
@@ -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
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Scanner class provides details about the available scanners
3
4
  # https://localhost:8834/api#/resources/server
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Server class returns information about the Nessus Server itself
3
4
  # https://localhost:8834/api#/resources/server
@@ -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
- username: username, password: password)
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',
@@ -1,3 +1,4 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # The Users class allows us to interact with Nessus 6 users.
3
4
  # Users can utilize Nessus based on their given role.
@@ -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
@@ -1,4 +1,5 @@
1
+ # The Nessus6 module is used to interact with Nessus version 6 servers.
1
2
  module Nessus6
2
3
  # VERSION is the current version of the Nessus6 gem
3
- VERSION = "0.1.5"
4
+ VERSION = '0.1.6'
4
5
  end
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.5
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-08-24 00:00:00.000000000 Z
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.1'
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.1'
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