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.
328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/nexpose/filter.rb', line 328 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_count ⇒ Object (readonly)
Returns the value of attribute exploit_count.
320 321 322 |
# File 'lib/nexpose/filter.rb', line 320 def exploit_count @exploit_count end |
#id ⇒ Object (readonly)
Unique identifier of this asset. Also known as device ID.
314 315 316 |
# File 'lib/nexpose/filter.rb', line 314 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
316 317 318 |
# File 'lib/nexpose/filter.rb', line 316 def ip @ip end |
#last_scan ⇒ Object (readonly)
Returns the value of attribute last_scan.
326 327 328 |
# File 'lib/nexpose/filter.rb', line 326 def last_scan @last_scan end |
#malware_count ⇒ Object (readonly)
Returns the value of attribute malware_count.
321 322 323 |
# File 'lib/nexpose/filter.rb', line 321 def malware_count @malware_count end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
317 318 319 |
# File 'lib/nexpose/filter.rb', line 317 def name @name end |
#os ⇒ Object (readonly)
Returns the value of attribute os.
318 319 320 |
# File 'lib/nexpose/filter.rb', line 318 def os @os end |
#risk_score ⇒ Object (readonly)
Returns the value of attribute risk_score.
323 324 325 |
# File 'lib/nexpose/filter.rb', line 323 def risk_score @risk_score end |
#site_id ⇒ Object (readonly)
Returns the value of attribute site_id.
325 326 327 |
# File 'lib/nexpose/filter.rb', line 325 def site_id @site_id end |
#vuln_count ⇒ Object (readonly)
Returns the value of attribute vuln_count.
322 323 324 |
# File 'lib/nexpose/filter.rb', line 322 def vuln_count @vuln_count end |