Class: Nexpose::VulnFilter
- Inherits:
-
Object
- Object
- Nexpose::VulnFilter
- Defined in:
- lib/nexpose/alert.rb
Overview
Vulnerability filtering for alerting. Set values to 1 to enable and 0 to disable.
Instance Attribute Summary collapse
-
#confirmed ⇒ Object
Vulnerability events to alert on.
-
#potential ⇒ Object
Vulnerability events to alert on.
-
#severity ⇒ Object
Only alert on vulnerability findings with a severity level greater than this level.
-
#unconfirmed ⇒ Object
Vulnerability events to alert on.
Class Method Summary collapse
Instance Method Summary collapse
- #as_xml ⇒ Object
-
#initialize(severity = 1, confirmed = 1, unconfirmed = 1, potential = 1) ⇒ VulnFilter
constructor
A new instance of VulnFilter.
- #to_xml ⇒ Object
Constructor Details
#initialize(severity = 1, confirmed = 1, unconfirmed = 1, potential = 1) ⇒ VulnFilter
Returns a new instance of VulnFilter.
116 117 118 |
# File 'lib/nexpose/alert.rb', line 116 def initialize(severity = 1, confirmed = 1, unconfirmed = 1, potential = 1) @severity, @confirmed, @unconfirmed, @potential = severity, confirmed, unconfirmed, potential end |
Instance Attribute Details
#confirmed ⇒ Object
Vulnerability events to alert on.
114 115 116 |
# File 'lib/nexpose/alert.rb', line 114 def confirmed @confirmed end |
#potential ⇒ Object
Vulnerability events to alert on.
114 115 116 |
# File 'lib/nexpose/alert.rb', line 114 def potential @potential end |
#severity ⇒ Object
Only alert on vulnerability findings with a severity level greater than this level. Range is 0 to 10. Values in the UI correspond as follows:
Any severity: 1
Severe and critical: 4
Only critical: 8
111 112 113 |
# File 'lib/nexpose/alert.rb', line 111 def severity @severity end |
#unconfirmed ⇒ Object
Vulnerability events to alert on.
114 115 116 |
# File 'lib/nexpose/alert.rb', line 114 def unconfirmed @unconfirmed end |
Class Method Details
.parse(xml) ⇒ Object
133 134 135 136 137 138 |
# File 'lib/nexpose/alert.rb', line 133 def self.parse(xml) new(xml.attributes['severityThreshold'].to_i, xml.attributes['confirmed'].to_i, xml.attributes['unconfirmed'].to_i, xml.attributes['potential'].to_i) end |
Instance Method Details
#as_xml ⇒ Object
120 121 122 123 124 125 126 127 |
# File 'lib/nexpose/alert.rb', line 120 def as_xml xml = REXML::Element.new('vulnFilter') xml.attributes['severityThreshold'] = @severity xml.attributes['confirmed'] = @confirmed xml.attributes['unconfirmed'] = @unconfirmed xml.attributes['potential'] = @potential xml end |
#to_xml ⇒ Object
129 130 131 |
# File 'lib/nexpose/alert.rb', line 129 def to_xml as_xml.to_s end |