nessus 0.0.1.beta.1 → 0.0.1.beta.2

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
  SHA1:
3
- metadata.gz: 825f74b9310ffb651d9ec525d7d40419e9528ea8
4
- data.tar.gz: d77bd6c102bc7becfea59d182e11516723ecb29e
3
+ metadata.gz: 152073eca0ca8a7293d6d2fccbcadcd18909ca00
4
+ data.tar.gz: ddf8237ed5e6d9387f84e7ec74a5a8425bab3949
5
5
  SHA512:
6
- metadata.gz: ab37c5926f975501ac7a872db4e4c814bee41d21050d744e322d15b67b8c94e069d8c4d3012eb5bfe2154587a0f390c0cd8b32fe3b90bbeb552dc5d380947446
7
- data.tar.gz: d737f0c6b2ea3be02d2dd701cad9cb9bff489394d89761c5081042b54e7316edf5f0192ce4c9275768bfdcc6474fbd89c89d592993fb1a85b29579af4af43b74
6
+ metadata.gz: f83c4eff46bcc2b9199f68ad0b631030dec0ff3dde574099d836b937fac6ee81fcafa455141580c574a2ea9a344b7738438afcda5e290afbf81743d91856f83f
7
+ data.tar.gz: 699224f98c5e9a3d1876672b6fad84f30f534f4db3df235f55fd46a3ca65c3bb4444f24bf6eb8a03ab9b076069a648e4e23a74885d45ad6cc811167c6ddac95f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nessus (0.0.1.beta.1)
4
+ nessus (0.0.1.beta.2)
5
5
  faraday
6
6
 
7
7
  GEM
data/lib/nessus/client.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'cgi'
2
2
  require 'faraday'
3
3
  require 'json'
4
- require 'pry'
5
4
  require 'nessus/client/file'
6
5
  require 'nessus/client/policy'
7
6
  require 'nessus/client/report'
8
7
  require 'nessus/client/report2'
9
8
  require 'nessus/client/scan'
9
+ require 'nessus/error'
10
10
  require 'nessus/version'
11
11
 
12
12
  module Nessus
@@ -8,6 +8,8 @@ module Nessus
8
8
  # @param [Fixnum] policy_id a numeric ID that references the policy to use
9
9
  # @param [String] scan_name the name to assign to this scan
10
10
  # @param [Fixnum] seq a unique identifer for the specific request
11
+ #
12
+ # @return [Hash] the newly created scan object
11
13
  def create_scan(target, policy_id, scan_name, seq = nil)
12
14
  payload = {
13
15
  :target => target,
@@ -18,6 +20,10 @@ module Nessus
18
20
  payload[:seq] = seq if seq
19
21
  resp = post '/scan/new', payload
20
22
 
23
+ if resp['reply']['status'].eql? 'ERROR'
24
+ raise Nessus::UnknownError, resp['reply']['contents']
25
+ end
26
+
21
27
  resp['reply']['contents']['scan']
22
28
  end
23
29
 
@@ -0,0 +1,4 @@
1
+ module Nessus
2
+ # @todo add more descriptive error classes
3
+ UnknownError = Class.new(StandardError)
4
+ end
@@ -1,4 +1,4 @@
1
1
  module Nessus
2
2
  # The version of the Nessus.rb library
3
- VERSION = '0.0.1.beta.1'
3
+ VERSION = '0.0.1.beta.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nessus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta.1
4
+ version: 0.0.1.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erran Carey
@@ -110,6 +110,7 @@ files:
110
110
  - lib/nessus/client/timezones.rb
111
111
  - lib/nessus/client/users.rb
112
112
  - lib/nessus/client/uuid.rb
113
+ - lib/nessus/error.rb
113
114
  - lib/nessus/version.rb
114
115
  - nessus.gemspec
115
116
  homepage: https://github.com/threatagent/nessus.rb