nexpose 5.0.0 → 5.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: 4b36711705abe08891f4b9a2a91e2661b660f589
4
- data.tar.gz: b23983acf0e13451dd48f2028decf89b5363c439
3
+ metadata.gz: 7623dcceb5d3d3c27dc38ec36c4d79e337ff1044
4
+ data.tar.gz: 44a91ad0a5b482f9b4e2ff249405fc8bf1855595
5
5
  SHA512:
6
- metadata.gz: 6918bea23f955aa033e9e61cd9249da0257daf89a422dbd714d63906e595a89ed60607067ab074b66a500946e3b3b73d6410186bc4570e5140c910b2941c14f5
7
- data.tar.gz: a47dca8c883ae9a5319f6d54d59ab3179e7d94562e7f962c07f33050f872b5c0dfa2ff5c041d411301e6ac199053ac43ed5d2d881cc7d12948937fe71297bb64
6
+ metadata.gz: d6dbf1f038b82d96689c56aa58caed2502b0e2021c7b3b8e5fd9a0099fa487c93fad78cb61b28892cd582e23332f15facd48c54664d64a2b560b8f8da726ea10
7
+ data.tar.gz: 8078c7d299558f71874710768a19541283901c4045efa571f17e8e2869ea1033b9a89866463bb08bf4b42d264c21c3d0390f96d0e6d465876656d6191608505d
@@ -1,46 +1,46 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexpose (5.0.0)
4
+ nexpose (5.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.3.7)
10
- ast (2.0.0)
11
- astrolabe (1.3.0)
12
- parser (>= 2.2.0.pre.3, < 3.0)
9
+ addressable (2.3.8)
10
+ ast (2.2.0)
11
+ astrolabe (1.3.1)
12
+ parser (~> 2.2)
13
13
  codeclimate-test-reporter (0.4.7)
14
14
  simplecov (>= 0.7.1, < 1.0.0)
15
15
  crack (0.4.2)
16
16
  safe_yaml (~> 1.0.0)
17
17
  diff-lcs (1.2.5)
18
18
  docile (1.1.5)
19
- multi_json (1.10.1)
20
- parser (2.2.0.3)
21
- ast (>= 1.1, < 3.0)
22
- powerpack (0.1.0)
19
+ multi_json (1.11.2)
20
+ parser (2.3.1.2)
21
+ ast (~> 2.2)
22
+ powerpack (0.1.1)
23
23
  rainbow (2.0.0)
24
- rspec (3.2.0)
25
- rspec-core (~> 3.2.0)
26
- rspec-expectations (~> 3.2.0)
27
- rspec-mocks (~> 3.2.0)
28
- rspec-core (3.2.1)
29
- rspec-support (~> 3.2.0)
30
- rspec-expectations (3.2.0)
24
+ rspec (3.3.0)
25
+ rspec-core (~> 3.3.0)
26
+ rspec-expectations (~> 3.3.0)
27
+ rspec-mocks (~> 3.3.0)
28
+ rspec-core (3.3.2)
29
+ rspec-support (~> 3.3.0)
30
+ rspec-expectations (3.3.1)
31
31
  diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.2.0)
33
- rspec-mocks (3.2.1)
32
+ rspec-support (~> 3.3.0)
33
+ rspec-mocks (3.3.2)
34
34
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.2.0)
36
- rspec-support (3.2.2)
35
+ rspec-support (~> 3.3.0)
36
+ rspec-support (3.3.0)
37
37
  rubocop (0.29.1)
38
38
  astrolabe (~> 1.3)
39
39
  parser (>= 2.2.0.1, < 3.0)
40
40
  powerpack (~> 0.1)
41
41
  rainbow (>= 1.99.1, < 3.0)
42
42
  ruby-progressbar (~> 1.4)
43
- ruby-progressbar (1.7.1)
43
+ ruby-progressbar (1.7.5)
44
44
  safe_yaml (1.0.4)
45
45
  simplecov (0.9.2)
46
46
  docile (~> 1.1.0)
@@ -60,10 +60,7 @@ DEPENDENCIES
60
60
  codeclimate-test-reporter (~> 0.4.6)
61
61
  nexpose!
62
62
  rspec (~> 3.2)
63
- rubocop (~> 0.29.0)
63
+ rubocop
64
64
  simplecov (~> 0.9.1)
65
65
  vcr (~> 2.9.3)
66
66
  webmock (~> 1.20.4)
67
-
68
- BUNDLED WITH
69
- 1.12.2
@@ -38,6 +38,8 @@ module Nexpose
38
38
  attr_reader :group_accounts
39
39
  # Files and directories that have been enumerated on the asset. [Lazy]
40
40
  attr_reader :files
41
+ # Unique system identifiers on the asset.
42
+ attr_accessor :unique_identifiers
41
43
 
42
44
  def initialize
43
45
  @addresses = []
@@ -47,7 +49,7 @@ module Nexpose
47
49
  # Load an asset from the provided console.
48
50
  #
49
51
  # @param [Connection] nsc Active connection to a Nexpose console.
50
- # @param [String] id Unique identifier of an asset.
52
+ # @param [Fixnum] id Unique identifier of an asset.
51
53
  # @return [Asset] The requested asset, if found.
52
54
  #
53
55
  def self.load(nsc, id)
@@ -263,6 +265,39 @@ module Nexpose
263
265
  end
264
266
  end
265
267
 
268
+ # Unique system identifiers on an asset.
269
+ #
270
+ class UniqueIdentifier < APIObject
271
+ # The source name for the uniuqe identifier.
272
+ attr_reader :source
273
+ # Unique identifier of the user as determined by the asset (not Nexpose).
274
+ attr_reader :id
275
+
276
+ def initialize(source = nil, id = nil)
277
+ @id = id
278
+ @source = source
279
+ end
280
+
281
+ def to_h
282
+ { source: source,
283
+ id: id }
284
+ end
285
+
286
+ def <=>(other)
287
+ c = source <=> other.source
288
+ return c unless c == 0
289
+ id <=> other.id
290
+ end
291
+
292
+ def ==(other)
293
+ eql?(other)
294
+ end
295
+
296
+ def eql?(other)
297
+ source.eql?(other.source) && id.eql?(other.id)
298
+ end
299
+ end
300
+
266
301
  # Assessment statistics for an asset.
267
302
  #
268
303
  class Assessment < APIObject
@@ -15,17 +15,25 @@ module Nexpose
15
15
  attr_accessor :blackout_duration
16
16
 
17
17
  def initialize(start, enabled=true, duration, type, interval)
18
- @blackout_start = start
19
- @enabled =enabled
18
+ @blackout_start = start
19
+ @enabled = enabled
20
20
  @blackout_duration = duration.to_i
21
- @blackout_type = type
21
+ @blackout_type = type
22
22
  @blackout_interval = interval.to_i
23
23
  end
24
24
 
25
25
  def self.from_hash(hash)
26
26
  repeat_blackout_hash = hash[:repeat_blackout]
27
- blackout = new(hash[:start_date], hash[:blackout_duration], repeat_blackout_hash[:type], repeat_blackout_hash[:interval])
28
- blackout
27
+
28
+ if repeat_blackout_hash.nil?
29
+ type = 'daily'
30
+ interval = 0
31
+ else
32
+ type = repeat_blackout_hash[:type]
33
+ interval = repeat_blackout_hash[:interval]
34
+ end
35
+
36
+ new(hash[:start_date], hash[:blackout_duration], type, interval)
29
37
  end
30
38
 
31
39
  def to_h
@@ -42,4 +50,4 @@ module Nexpose
42
50
  blackout_hash
43
51
  end
44
52
  end
45
- end
53
+ end
@@ -79,6 +79,8 @@ module Nexpose
79
79
  attr_accessor :groups
80
80
  # Files and directories on the asset.
81
81
  attr_accessor :files
82
+ # Unique system identifiers on the asset.
83
+ attr_accessor :unique_identifiers
82
84
  # A list of key-value attributes associated with the asset.
83
85
  attr_accessor :attributes
84
86
  # Asset-level vulnerabilities.
@@ -92,6 +94,7 @@ module Nexpose
92
94
  @users = []
93
95
  @groups = []
94
96
  @files = []
97
+ @unique_identifiers = []
95
98
  @vulnerabilities = []
96
99
  end
97
100
 
@@ -113,6 +116,7 @@ module Nexpose
113
116
  users: users.map(&:to_h),
114
117
  groups: groups.map(&:to_h),
115
118
  files: files.map(&:to_h),
119
+ unique_identifiers: unique_identifiers.map(&:to_h),
116
120
  vulnerabilities: vulnerabilities.map(&:to_h),
117
121
  attributes: Attributes.to_hash(attributes) }
118
122
  end
@@ -1,4 +1,4 @@
1
1
  module Nexpose
2
2
  # The latest version of the Nexpose gem
3
- VERSION = '5.0.0'
3
+ VERSION = '5.1.0'
4
4
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency('codeclimate-test-reporter', '~> 0.4.6')
23
23
  s.add_development_dependency('simplecov', '~> 0.9.1')
24
24
  s.add_development_dependency('rspec', '~> 3.2')
25
- s.add_development_dependency('rubocop', '~> 0.29.0')
25
+ s.add_development_dependency('rubocop')
26
26
  s.add_development_dependency('webmock', '~> 1.20.4')
27
27
  s.add_development_dependency('vcr', '~> 2.9.3')
28
28
  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: 5.0.0
4
+ version: 5.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: 2016-06-23 00:00:00.000000000 Z
16
+ date: 2016-08-26 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -75,16 +75,16 @@ dependencies:
75
75
  name: rubocop
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - "~>"
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 0.29.0
80
+ version: '0'
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - "~>"
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
- version: 0.29.0
87
+ version: '0'
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: webmock
90
90
  requirement: !ruby/object:Gem::Requirement
@@ -214,8 +214,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.4.5.1
217
+ rubygems_version: 2.4.6
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Ruby API for Rapid7 Nexpose
221
221
  test_files: []
222
+ has_rdoc: