Class: Tenable::Models::Vulnerability
- Inherits:
-
Data
- Object
- Data
- Tenable::Models::Vulnerability
- Defined in:
- lib/tenable/models/vulnerability.rb
Overview
Represents a vulnerability finding from the Tenable.io API.
Instance Attribute Summary collapse
-
#asset ⇒ Object
readonly
Returns the value of attribute asset.
-
#cve ⇒ Object
readonly
Returns the value of attribute cve.
-
#cvss_base_score ⇒ Object
readonly
Returns the value of attribute cvss_base_score.
-
#first_found ⇒ Object
readonly
Returns the value of attribute first_found.
-
#last_fixed ⇒ Object
readonly
Returns the value of attribute last_fixed.
-
#last_found ⇒ Object
readonly
Returns the value of attribute last_found.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#plugin_id ⇒ Object
readonly
Returns the value of attribute plugin_id.
-
#plugin_name ⇒ Object
readonly
Returns the value of attribute plugin_name.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#severity_id ⇒ Object
readonly
Returns the value of attribute severity_id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#vpr_score ⇒ Object
readonly
Returns the value of attribute vpr_score.
Class Method Summary collapse
-
.from_api(data) ⇒ Vulnerability
Builds a Vulnerability from a raw API response hash.
Instance Attribute Details
#asset ⇒ Object (readonly)
Returns the value of attribute asset
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def asset @asset end |
#cve ⇒ Object (readonly)
Returns the value of attribute cve
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def cve @cve end |
#cvss_base_score ⇒ Object (readonly)
Returns the value of attribute cvss_base_score
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def cvss_base_score @cvss_base_score end |
#first_found ⇒ Object (readonly)
Returns the value of attribute first_found
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def first_found @first_found end |
#last_fixed ⇒ Object (readonly)
Returns the value of attribute last_fixed
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def last_fixed @last_fixed end |
#last_found ⇒ Object (readonly)
Returns the value of attribute last_found
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def last_found @last_found end |
#output ⇒ Object (readonly)
Returns the value of attribute output
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def output @output end |
#plugin_id ⇒ Object (readonly)
Returns the value of attribute plugin_id
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def plugin_id @plugin_id end |
#plugin_name ⇒ Object (readonly)
Returns the value of attribute plugin_name
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def plugin_name @plugin_name end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def severity @severity end |
#severity_id ⇒ Object (readonly)
Returns the value of attribute severity_id
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def severity_id @severity_id end |
#state ⇒ Object (readonly)
Returns the value of attribute state
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def state @state end |
#vpr_score ⇒ Object (readonly)
Returns the value of attribute vpr_score
6 7 8 |
# File 'lib/tenable/models/vulnerability.rb', line 6 def vpr_score @vpr_score end |
Class Method Details
.from_api(data) ⇒ Vulnerability
Builds a Vulnerability from a raw API response hash.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tenable/models/vulnerability.rb', line 15 def self.from_api(data) # rubocop:disable Metrics/MethodLength data = data.transform_keys(&:to_sym) new( plugin_id: data[:plugin_id], plugin_name: data[:plugin_name], severity: data[:severity], severity_id: data[:severity_id], state: data[:state], asset: data[:asset] ? Asset.from_api(data[:asset]) : nil, output: data[:output], first_found: data[:first_found], last_found: data[:last_found], last_fixed: data[:last_fixed], vpr_score: data[:vpr_score], cvss_base_score: data[:cvss_base_score], cve: data[:cve] || [] ) end |