nexpose 7.0.1 → 7.1.0

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: 89a7f9d4854b3ac3826f56995370a1d38d0514be
4
- data.tar.gz: 4b5a6783ca354eae0b694f970963c5eb44cf3de3
3
+ metadata.gz: 59f070e8c264d2a89412a6fc5ab76fc6c381aced
4
+ data.tar.gz: a18e65e39dc9af8eeed11bf9dc9def359530041d
5
5
  SHA512:
6
- metadata.gz: 2faafc134faf7d0cd56ddf94a1119f6093e078c46164066f54ebafe1f13763be044c2c09930bc8adb7ebb93073c32c928fe09fc9c47042939960f8766675bda7
7
- data.tar.gz: 30683f228a157c4c5c34ea74c78b991e69cc6d0ef6749299083c9e2b4e2b92df8dbfb3d8dcc535d31d41a9403ae2b31556009697adaa2378201642a2bddc53f6
6
+ metadata.gz: cce4d28b939fd0802867eba5cd7658a71ef9e324223435c589ae95ca8e8ff43cd64bfce4289e43204dc2d43d529215492a751710e17d835914731fb0ca2f661c
7
+ data.tar.gz: 2e93edccb2e6161c2bd314602bfe3217bc0c613db80d734342f4613ad54bec9c4a4afb63130d47b912f2073ca84cdf03b3b97fa525ae2a2d64ade58df02ee65e
@@ -1,5 +1,35 @@
1
1
  # Change Log
2
2
 
3
+ ## [Unreleased](https://github.com/rapid7/nexpose-client/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/rapid7/nexpose-client/compare/v7.0.1...HEAD)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - nsc.list\_vuln\_exceptions does not return site\_id as documented [\#250](https://github.com/rapid7/nexpose-client/issues/250)
10
+
11
+ **Closed issues:**
12
+
13
+ - support for encryption for recovery [\#290](https://github.com/rapid7/nexpose-client/issues/290)
14
+ - Connection Timeout When Creating DynamicAssetGroup with large number of criteria [\#274](https://github.com/rapid7/nexpose-client/issues/274)
15
+ - Vulnerability Exception 'approve' function applies vulnerability exception but throws a ruby exception [\#271](https://github.com/rapid7/nexpose-client/issues/271)
16
+ - Add a global timeout parameter to Connection [\#269](https://github.com/rapid7/nexpose-client/issues/269)
17
+ - Update Example Scripts [\#244](https://github.com/rapid7/nexpose-client/issues/244)
18
+
19
+ **Merged pull requests:**
20
+
21
+ - adding the ability to include a password when restoring a backup [\#298](https://github.com/rapid7/nexpose-client/pull/298) ([sgreen-r7](https://github.com/sgreen-r7))
22
+ - Allow for Starting Scan during Blackout [\#297](https://github.com/rapid7/nexpose-client/pull/297) ([sgreen-r7](https://github.com/sgreen-r7))
23
+
24
+ ## [v7.0.1](https://github.com/rapid7/nexpose-client/tree/v7.0.1) (2017-09-11)
25
+ [Full Changelog](https://github.com/rapid7/nexpose-client/compare/v7.0.0...v7.0.1)
26
+
27
+ **Merged pull requests:**
28
+
29
+ - Only Cleanup!! v3 [\#295](https://github.com/rapid7/nexpose-client/pull/295) ([sgreen-r7](https://github.com/sgreen-r7))
30
+ - Revert "Only Cleanup!" [\#293](https://github.com/rapid7/nexpose-client/pull/293) ([sgreen-r7](https://github.com/sgreen-r7))
31
+ - Only Cleanup! [\#292](https://github.com/rapid7/nexpose-client/pull/292) ([sgreen-r7](https://github.com/sgreen-r7))
32
+
3
33
  ## [v7.0.0](https://github.com/rapid7/nexpose-client/tree/v7.0.0) (2017-08-31)
4
34
  [Full Changelog](https://github.com/rapid7/nexpose-client/compare/v6.1.1...v7.0.0)
5
35
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexpose (7.0.1)
4
+ nexpose (7.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -15,6 +15,8 @@ Since version 1.0 nexpose-client uses [Semantic Versioning](http://semver.org/).
15
15
 
16
16
  Release notes are available on the [Releases](https://github.com/rapid7/nexpose-client/releases) page.
17
17
 
18
+ The full Changelog is available as well, on the [Changelog](https://github.com/rapid7/nexpose-client/blob/master/CHANGELOG.md) page.
19
+
18
20
  ## Contributions
19
21
 
20
22
  We welcome contributions to this package. Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
@@ -96,12 +96,15 @@ module Nexpose
96
96
  # It will restart the console after acknowledging receiving the request.
97
97
  #
98
98
  # @param [Connection] nsc An active connection to a Nexpose console.
99
+ # @param [String] (Optional) The password to use when restoring the backup.
99
100
  # @return [Boolean] Whether the request was received.
100
101
  #
101
- def restore(nsc)
102
+ def restore(nsc, password = nil)
103
+ raise 'Supplied Password is incorrect for restoring this Backup.' if invalid_backup_password?(nsc, password)
102
104
  parameters = { 'backupid' => @name,
103
105
  'cmd' => 'restore',
104
- 'targetTask' => 'backupRestore' }
106
+ 'targetTask' => 'backupRestore',
107
+ 'password' => password }
105
108
  xml = AJAX.form_post(nsc, '/admin/global/maintenance/maintCmd.txml', parameters)
106
109
  if !!(xml =~ /succeded="true"/)
107
110
  nsc._maintenance_restart
@@ -129,5 +132,23 @@ module Nexpose
129
132
  hash['Platform-Independent'],
130
133
  hash['Size'])
131
134
  end
135
+
136
+ private
137
+
138
+ def invalid_backup_password?(nsc, password)
139
+ !correct_backup_password?(nsc, password) if backup_need_password?(nsc)
140
+ end
141
+
142
+ def backup_need_password?(nsc)
143
+ resp = Nexpose::AJAX.get(nsc, '/data/admin/backups/password', Nexpose::AJAX::CONTENT_TYPE::JSON, 'backupID' => name)
144
+ resp == 'true'
145
+ end
146
+
147
+ def correct_backup_password?(nsc, password)
148
+ raise 'This Backup file requires a Password. Please include a password during the restore command.' if password.nil?
149
+ resp = Nexpose::AJAX.post(nsc, "/data/admin/backups/password?backupID=#{name}&password=#{password}", nil, Nexpose::AJAX::CONTENT_TYPE::JSON)
150
+ resp == 'true'
151
+ end
152
+
132
153
  end
133
154
  end
@@ -196,10 +196,12 @@ module Nexpose
196
196
  # Initiate a site scan.
197
197
  #
198
198
  # @param [Fixnum] site_id Site ID to scan.
199
+ # @param [Boolean] blackout_override Optional. Given suffencent permissions, force bypass blackout and start scan.
199
200
  # @return [Scan] Scan launch information.
200
201
  #
201
- def scan_site(site_id)
202
- xml = make_xml('SiteScanRequest', 'site-id' => site_id)
202
+ def scan_site(site_id, blackout_override = false)
203
+ xml = make_xml('SiteScanRequest', 'site-id' => site_id)
204
+ xml.add_attributes({ 'force' => true }) if blackout_override
203
205
  response = execute(xml)
204
206
  Scan.parse(response.res) if response.success
205
207
  end
@@ -540,14 +540,16 @@ module Nexpose
540
540
  #
541
541
  # @param [Connection] connection Connection to console where scan will be launched.
542
542
  # @param [String] sync_id Optional synchronization token.
543
+ # @param [Boolean] blackout_override Optional. Given suffencent permissions, force bypass blackout and start scan.
543
544
  # @return [Scan] Scan launch information.
544
545
  #
545
- def scan(connection, sync_id = nil)
546
+ def scan(connection, sync_id = nil, blackout_override = false)
546
547
  xml = REXML::Element.new('SiteScanRequest')
547
548
  xml.add_attributes({ 'session-id' => connection.session_id,
548
549
  'site-id' => @id,
549
550
  'sync-id' => sync_id })
550
551
 
552
+ xml.add_attributes({ 'force' => true }) if blackout_override
551
553
  response = connection.execute(xml, '1.1', timeout: 60)
552
554
  Scan.parse(response.res) if response.success
553
555
  end
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '7.0.1'.freeze
3
+ VERSION = '7.1.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexpose
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-09-11 00:00:00.000000000 Z
16
+ date: 2017-09-26 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler