Class: Nexpose::Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/filter.rb

Overview

Asset data as returned by an Asset Filter search.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Asset

Returns a new instance of Asset.



344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/nexpose/filter.rb', line 344

def initialize(json)
  @id = json['assetID']
  @ip = json['assetIP']
  @name = json['assetName']
  @os = json['assetOSName']
  @exploit_count = json['exploitCount'].to_i
  @malware_count = json['malwareCount'].to_i
  @vuln_count = json['vulnCount'].to_i
  @risk_score = json['riskScore'].to_f
  @site_id = json['siteID']
  @last_scan = Time.at(json['lastScanDate'] / 1000)
end

Instance Attribute Details

#exploit_countObject (readonly)

Returns the value of attribute exploit_count.



336
337
338
# File 'lib/nexpose/filter.rb', line 336

def exploit_count
  @exploit_count
end

#idObject (readonly)

Unique identifier of this asset. Also known as device ID.



330
331
332
# File 'lib/nexpose/filter.rb', line 330

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



332
333
334
# File 'lib/nexpose/filter.rb', line 332

def ip
  @ip
end

#last_scanObject (readonly)

Returns the value of attribute last_scan.



342
343
344
# File 'lib/nexpose/filter.rb', line 342

def last_scan
  @last_scan
end

#malware_countObject (readonly)

Returns the value of attribute malware_count.



337
338
339
# File 'lib/nexpose/filter.rb', line 337

def malware_count
  @malware_count
end

#nameObject (readonly)

Returns the value of attribute name.



333
334
335
# File 'lib/nexpose/filter.rb', line 333

def name
  @name
end

#osObject (readonly)

Returns the value of attribute os.



334
335
336
# File 'lib/nexpose/filter.rb', line 334

def os
  @os
end

#risk_scoreObject (readonly)

Returns the value of attribute risk_score.



339
340
341
# File 'lib/nexpose/filter.rb', line 339

def risk_score
  @risk_score
end

#site_idObject (readonly)

Returns the value of attribute site_id.



341
342
343
# File 'lib/nexpose/filter.rb', line 341

def site_id
  @site_id
end

#vuln_countObject (readonly)

Returns the value of attribute vuln_count.



338
339
340
# File 'lib/nexpose/filter.rb', line 338

def vuln_count
  @vuln_count
end