Nessus6 0.1.7 → 0.1.8

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: a93311faca0577293ac581d90586cf5cdce9788e
4
- data.tar.gz: 2d86c0f842b306a16a92e72020566e5de5571567
3
+ metadata.gz: c3aba5750c8d57f4ebc153f048b939b66c133a79
4
+ data.tar.gz: 6d3eedfd62b45e77531f081c56da11990a13d01f
5
5
  SHA512:
6
- metadata.gz: 9256f00ef92a34916df54c11d9f0b507799236b37d3c3855569494cdbf0d6a3c8aee787a772a6cfbd8f87cda0974eef16277753cb2cdaaf799240a75f8ed7941
7
- data.tar.gz: a2ec430c521b43f956ee211e27030308b9dbac328920df8224c7073938e07f66495908ade94850e5f85dfb0a8756e9b8050817483e5279b21db5aba1414eaf2c
6
+ metadata.gz: 928cc8afbaa5b4d6600980101c9cf376160b025891df37dca292a1222cb84738243b86d03633e5ea6ee5d64960d8fd208ca5fe120120aa59f9b619b97b3c2ddf
7
+ data.tar.gz: c7eb4bfad5059da1892f34076cb8cc1c1f40bb62c7f7e6a0a5bacc4e179b3028bfe81b9b049983e23d765209f7ab9fab37fc2da53fc8573aac8056855ec52036
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  sudo: false
3
+ cache: bundler
3
4
  rvm:
4
5
  - 2.0.0
5
6
  - 2.1.0
@@ -48,6 +48,7 @@ module Nessus6
48
48
  @token = @session.create(credentials[:username], credentials[:password])
49
49
  @client.header['X-Cookie'] = "token = #{@token}"
50
50
  elsif credentials[:access_key] && credentials[:secret_key]
51
+ @client.header['X-ApiKeys'] = "accessKey=#{credentials[:access_key]}; secretKey=#{credentials[:secret_key]}"
51
52
  else
52
53
  fail Nessus6::Error::AuthenticationError, 'Authentication credentials' \
53
54
  ' not provided. Must provided either username and password or ' \
@@ -16,7 +16,7 @@ module Nessus6
16
16
  # @param file_path [String] Path to the file to upload
17
17
  # @param file_type [String] MIME type. E.g. 'text/plain'
18
18
  # @return [Hash] Returns a :fileuploaded string.
19
- def upload(file_path, file_type, encrypted = 0)
19
+ def upload(file_path, file_type = 'text/plain', encrypted = 0)
20
20
  response = @client.post('file/upload',
21
21
  file: Hurley::UploadIO.new(file_path, file_type),
22
22
  no_enc: encrypted)
@@ -115,6 +115,33 @@ module Nessus6
115
115
  conflict: 'Scan is not active.'
116
116
  end
117
117
 
118
+ # Returns the output for a given plugin
119
+ #
120
+ # @param scan_id [String, Integer] The id of the scan to retrieve
121
+ # @param host_id [String, Integer] The id of the host to retrieve
122
+ # @param plugin_id [String, Integer] The id of the plugin to retrieve
123
+ # @param history_id [String, Integer] The history_id of the historical data
124
+ # that should be returned
125
+ # @return [Hash] Plugin information object
126
+ def plugin_output(scan_id, host_id, plugin_id, history_id = nil)
127
+ response = @client.get "scans/#{scan_id}/hosts/#{host_id}/plugins/"\
128
+ "#{plugin_id}", history_id: history_id
129
+ verify response,
130
+ internal_server_error: 'Internal server error'
131
+ end
132
+
133
+ # Changes the status of a scan
134
+ #
135
+ # @param scan_id [String, Fixnum] The id of the scan to change
136
+ # @param read [String, Trueclass, Falseclass] If true, the scan has been
137
+ # read
138
+ # @return [Hash]
139
+ def read_status(scan_id, read)
140
+ response = @client.put "scans/#{scan_id}/status", read: read
141
+ verify response,
142
+ not_found: 'A scan with that ID could not be located.'
143
+ end
144
+
118
145
  # Resumes a scan
119
146
  #
120
147
  # @param scan_id [String, Fixnum] The id of the scan to resume
@@ -1,5 +1,5 @@
1
1
  # The Nessus6 module is used to interact with Nessus version 6 servers.
2
2
  module Nessus6
3
3
  # VERSION is the current version of the Nessus6 gem
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
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.7
4
+ version: 0.1.8
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-09-15 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -161,3 +161,4 @@ signing_key:
161
161
  specification_version: 4
162
162
  summary: "[Under Construction] Nessus 6 API Gem"
163
163
  test_files: []
164
+ has_rdoc: