nexpose 0.6.1 → 0.6.2

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: 6ad801dadec80e96926962637c8fa6d3cf6a338f
4
- data.tar.gz: 763a538eae968c90943ccf4d9aa463fea6cf0ad8
3
+ metadata.gz: 0fc2b706c73a141e3ca722783d6d59bfeebc318e
4
+ data.tar.gz: 14807c2250fd38f7a3b42218902e8514f3f529db
5
5
  SHA512:
6
- metadata.gz: 08da6caad801348db0f240fde304b5b0bd8abaa84cf3351642e8e085c23dd074075342eba8560962b901aca306505f5598d670010bcbc39937475af1f58ae96e
7
- data.tar.gz: 1a2ae21afc4fad982028ff2fe531547743fa8d752591a2674ec7e944fa81131b11ee562dcb6e06a3570cac93dc918b1cf009dcf5cd79ca2b9395455112c8cb2d
6
+ metadata.gz: ceae9134faa08616595a2f532f1fe51d16d1a2aab57243658148ab1b1a55341e1eb42202cfa28cd6d45d33ba632dd170822a1117140be33a603f0bd4bf2837e6
7
+ data.tar.gz: 8efd62b961e8870c99448851fb03b42fd58ee0ccd2bdc598405587ee1a35d339a69a0f67ba2873fd1bff3331d6574ff14beabd20b55c6c0d8b85dd02c84b26ec
data/README.markdown CHANGED
@@ -2,11 +2,18 @@
2
2
 
3
3
  This is the official gem package for the Ruby Nexpose API.
4
4
 
5
- For assistance with using the gem, to share your scripts, or to discuss different approaches, please visit the Rapid7 forums for Nexpose: https://community.rapid7.com/community/nexpose
5
+ For assistance with using the gem, to share your scripts, or to discuss different approaches, please visit the Rapid7 forums for Nexpose: https://community.rapid7.com/community/nexpose/nexpose-apis
6
+
7
+ Check out https://github.com/rapid7/nexpose-client/wiki for walk-throughs and release notes for recent versions.
8
+
9
+ This gem is heavily used for internal, automated testing of the Nexpose product. It provides calls to the Nexpose XML APIs version 1.1 and 1.2 (except for some multi-tenant operations). It also includes a number of helper methods which are not currently exposed through alternate means.
10
+
6
11
 
7
12
  ## Contributions
8
13
 
9
- This package is currently a work in progress. Most of the Nexpose API is exposed, but there are some operations missing. Also, there are stylistic differences between different calls that we hope to eliminate over time. We welcome contributions to this package. We ask only that pull requests and patches adhere to our coding standards.
14
+ We welcome contributions to this package.
15
+
16
+ Our coding standards include:
10
17
 
11
18
  * Favor returning classes over key-value maps. Classes tend to be easier for users to manipulate and use.
12
19
  * Unless otherwise noted, code should adhere to the Ruby Style Guide: https://github.com/bbatsov/ruby-style-guide
@@ -153,6 +153,8 @@ module Nexpose
153
153
  ENDS_WITH = 'ENDS_WITH'
154
154
  ON_OR_BEFORE = 'ON_OR_BEFORE'
155
155
  ON_OR_AFTER = 'ON_OR_AFTER'
156
+ BETWEEN = 'BETWEEN'
157
+ EARLIER_THAN = 'EARLIER_THAN'
156
158
  WITHIN_THE_LAST = 'WITHIN_THE_LAST'
157
159
  GREATER_THAN = 'GREATER_THAN'
158
160
  LESS_THAN = 'LESS_THAN'
data/lib/nexpose/group.rb CHANGED
@@ -110,9 +110,9 @@ module Nexpose
110
110
  def rescan_assets(connection)
111
111
  sites_ids = @assets.map { |d| d.site_id }.uniq
112
112
  scans = {}
113
- sites_ids.each do |id|
114
- to_scan = @assets.select { |d| d.site_id == id }
115
- scans[id] = connection.scan_assets(to_scan)
113
+ sites_ids.each do |site_id|
114
+ to_scan = @assets.select { |d| d.site_id == site_id }
115
+ scans[site_id] = connection.scan_devices(to_scan)
116
116
  end
117
117
  scans
118
118
  end
@@ -308,7 +308,7 @@ module Nexpose
308
308
  def self.build(connection, site_id, site_name, type, format, generate_now = false)
309
309
  name = %(#{site_name} #{type} report in #{format})
310
310
  config = ReportConfig.new(name, type, format)
311
- config.frequency = Frequency.new(true, false)
311
+ config.frequency = Frequency.new(true, false) unless generate_now
312
312
  config.filters << Filter.new('site', site_id)
313
313
  config.save(connection, generate_now)
314
314
  config
@@ -58,10 +58,15 @@ module Nexpose
58
58
 
59
59
  # @return [String] Unique identifier of the scan template.
60
60
  def id
61
- root = REXML::XPath.first(xml, 'ScanTemplate')
61
+ root = REXML::XPath.first(@xml, 'ScanTemplate')
62
62
  root.attributes['id']
63
63
  end
64
64
 
65
+ def id=(value)
66
+ root = REXML::XPath.first(@xml, 'ScanTemplate')
67
+ root.attributes['id'] = value
68
+ end
69
+
65
70
  # @return [String] Name or title of this scan template.
66
71
  def name
67
72
  desc = REXML::XPath.first(@xml, 'ScanTemplate/templateDescription')
@@ -349,7 +354,7 @@ module Nexpose
349
354
  def self.copy(nsc, id)
350
355
  dupe = load(nsc, id)
351
356
  dupe.id = '#NewScanTemplate#'
352
- dupe.title = "#{dupe.title} Copy"
357
+ dupe.name = "#{dupe.name} Copy"
353
358
  dupe
354
359
  end
355
360
 
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: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HD Moore
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-09 00:00:00.000000000 Z
13
+ date: 2014-01-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: librex