Class: Nexpose::Asset
- Inherits:
-
Object
- Object
- Nexpose::Asset
- Defined in:
- lib/nexpose/filter.rb
Overview
Asset data as returned by an Asset Filter search.
Instance Attribute Summary collapse
-
#exploit_count ⇒ Object
readonly
Returns the value of attribute exploit_count.
-
#id ⇒ Object
readonly
Unique identifier of this asset.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#last_scan ⇒ Object
readonly
Returns the value of attribute last_scan.
-
#malware_count ⇒ Object
readonly
Returns the value of attribute malware_count.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#os ⇒ Object
readonly
Returns the value of attribute os.
-
#risk_score ⇒ Object
readonly
Returns the value of attribute risk_score.
-
#site_id ⇒ Object
readonly
Returns the value of attribute site_id.
-
#vuln_count ⇒ Object
readonly
Returns the value of attribute vuln_count.
Instance Method Summary collapse
-
#initialize(json) ⇒ Asset
constructor
A new instance of Asset.
Constructor Details
#initialize(json) ⇒ Asset
Returns a new instance of Asset.
369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/nexpose/filter.rb', line 369 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'].to_i / 1000) end |
Instance Attribute Details
#exploit_count ⇒ Object (readonly)
Returns the value of attribute exploit_count.
361 362 363 |
# File 'lib/nexpose/filter.rb', line 361 def exploit_count @exploit_count end |
#id ⇒ Object (readonly)
Unique identifier of this asset. Also known as device ID.
355 356 357 |
# File 'lib/nexpose/filter.rb', line 355 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
357 358 359 |
# File 'lib/nexpose/filter.rb', line 357 def ip @ip end |
#last_scan ⇒ Object (readonly)
Returns the value of attribute last_scan.
367 368 369 |
# File 'lib/nexpose/filter.rb', line 367 def last_scan @last_scan end |
#malware_count ⇒ Object (readonly)
Returns the value of attribute malware_count.
362 363 364 |
# File 'lib/nexpose/filter.rb', line 362 def malware_count @malware_count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
358 359 360 |
# File 'lib/nexpose/filter.rb', line 358 def name @name end |
#os ⇒ Object (readonly)
Returns the value of attribute os.
359 360 361 |
# File 'lib/nexpose/filter.rb', line 359 def os @os end |
#risk_score ⇒ Object (readonly)
Returns the value of attribute risk_score.
364 365 366 |
# File 'lib/nexpose/filter.rb', line 364 def risk_score @risk_score end |
#site_id ⇒ Object (readonly)
Returns the value of attribute site_id.
366 367 368 |
# File 'lib/nexpose/filter.rb', line 366 def site_id @site_id end |
#vuln_count ⇒ Object (readonly)
Returns the value of attribute vuln_count.
363 364 365 |
# File 'lib/nexpose/filter.rb', line 363 def vuln_count @vuln_count end |