Class: Nexpose::FilteredAsset
- Inherits:
-
Object
- Object
- Nexpose::FilteredAsset
- 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
The first Site ID returned for this asset.
-
#site_ids ⇒ Object
readonly
Array of Site IDs for the asset.
-
#vuln_count ⇒ Object
readonly
Returns the value of attribute vuln_count.
Instance Method Summary collapse
-
#initialize(json) ⇒ FilteredAsset
constructor
A new instance of FilteredAsset.
Constructor Details
#initialize(json) ⇒ FilteredAsset
Returns a new instance of FilteredAsset.
384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/nexpose/filter.rb', line 384 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_ids = json['sitePermissions'].map { |site| site['siteID'] } @site_id = @site_ids.first @last_scan = Time.at(json['lastScanDate'].to_i / 1000) end |
Instance Attribute Details
#exploit_count ⇒ Object (readonly)
Returns the value of attribute exploit_count.
372 373 374 |
# File 'lib/nexpose/filter.rb', line 372 def exploit_count @exploit_count end |
#id ⇒ Object (readonly)
Unique identifier of this asset. Also known as device ID.
366 367 368 |
# File 'lib/nexpose/filter.rb', line 366 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
368 369 370 |
# File 'lib/nexpose/filter.rb', line 368 def ip @ip end |
#last_scan ⇒ Object (readonly)
Returns the value of attribute last_scan.
382 383 384 |
# File 'lib/nexpose/filter.rb', line 382 def last_scan @last_scan end |
#malware_count ⇒ Object (readonly)
Returns the value of attribute malware_count.
373 374 375 |
# File 'lib/nexpose/filter.rb', line 373 def malware_count @malware_count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
369 370 371 |
# File 'lib/nexpose/filter.rb', line 369 def name @name end |
#os ⇒ Object (readonly)
Returns the value of attribute os.
370 371 372 |
# File 'lib/nexpose/filter.rb', line 370 def os @os end |
#risk_score ⇒ Object (readonly)
Returns the value of attribute risk_score.
375 376 377 |
# File 'lib/nexpose/filter.rb', line 375 def risk_score @risk_score end |
#site_id ⇒ Object (readonly)
The first Site ID returned for this asset. Not recommended if Asset Linking feature is enabled.
379 380 381 |
# File 'lib/nexpose/filter.rb', line 379 def site_id @site_id end |
#site_ids ⇒ Object (readonly)
Array of Site IDs for the asset. Use when Asset Linking is enabled.
381 382 383 |
# File 'lib/nexpose/filter.rb', line 381 def site_ids @site_ids end |
#vuln_count ⇒ Object (readonly)
Returns the value of attribute vuln_count.
374 375 376 |
# File 'lib/nexpose/filter.rb', line 374 def vuln_count @vuln_count end |