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 +4 -4
- data/README.markdown +9 -2
- data/lib/nexpose/filter.rb +2 -0
- data/lib/nexpose/group.rb +3 -3
- data/lib/nexpose/report.rb +1 -1
- data/lib/nexpose/scan_template.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fc2b706c73a141e3ca722783d6d59bfeebc318e
|
4
|
+
data.tar.gz: 14807c2250fd38f7a3b42218902e8514f3f529db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/nexpose/filter.rb
CHANGED
@@ -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 |
|
114
|
-
to_scan = @assets.select { |d| d.site_id ==
|
115
|
-
scans[
|
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
|
data/lib/nexpose/report.rb
CHANGED
@@ -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.
|
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.
|
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-
|
13
|
+
date: 2014-01-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: librex
|