Class: Nexpose::FilteredAsset

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) ⇒ FilteredAsset

Returns a new instance of FilteredAsset.



381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/nexpose/filter.rb', line 381

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_countObject (readonly)

Returns the value of attribute exploit_count.



373
374
375
# File 'lib/nexpose/filter.rb', line 373

def exploit_count
  @exploit_count
end

#idObject (readonly)

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



367
368
369
# File 'lib/nexpose/filter.rb', line 367

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



369
370
371
# File 'lib/nexpose/filter.rb', line 369

def ip
  @ip
end

#last_scanObject (readonly)

Returns the value of attribute last_scan.



379
380
381
# File 'lib/nexpose/filter.rb', line 379

def last_scan
  @last_scan
end

#malware_countObject (readonly)

Returns the value of attribute malware_count.



374
375
376
# File 'lib/nexpose/filter.rb', line 374

def malware_count
  @malware_count
end

#nameObject (readonly)

Returns the value of attribute name.



370
371
372
# File 'lib/nexpose/filter.rb', line 370

def name
  @name
end

#osObject (readonly)

Returns the value of attribute os.



371
372
373
# File 'lib/nexpose/filter.rb', line 371

def os
  @os
end

#risk_scoreObject (readonly)

Returns the value of attribute risk_score.



376
377
378
# File 'lib/nexpose/filter.rb', line 376

def risk_score
  @risk_score
end

#site_idObject (readonly)

Returns the value of attribute site_id.



378
379
380
# File 'lib/nexpose/filter.rb', line 378

def site_id
  @site_id
end

#vuln_countObject (readonly)

Returns the value of attribute vuln_count.



375
376
377
# File 'lib/nexpose/filter.rb', line 375

def vuln_count
  @vuln_count
end