class DefaultMode
Public Class Methods
new(options)
click to toggle source
Initializes the mode
Calls superclass method
BaseMode::new
# File lib/nexpose_ticketing/modes/default_mode.rb, line 6 def initialize(options) super(options) end
Public Instance Methods
get_description(nexpose_id, row)
click to toggle source
Returns the base ticket description object
# File lib/nexpose_ticketing/modes/default_mode.rb, line 31 def get_description(nexpose_id, row) description = { nxid: "NXID: #{get_nxid(nexpose_id, row)}" } fields = %w(header references solutions) fields.each { |f| description[f.intern] = self.send("get_#{f}", row) } description[:header] << get_discovery_info(row) description end
get_matching_fields()
click to toggle source
Returns the fields used to identify individual tickets
# File lib/nexpose_ticketing/modes/default_mode.rb, line 16 def get_matching_fields %w(ip_address vulnerability_id) end
get_nxid(nexpose_id, row)
click to toggle source
Generates a unique identifier for a ticket
# File lib/nexpose_ticketing/modes/default_mode.rb, line 26 def get_nxid(nexpose_id, row) "#{nexpose_id}d#{row['asset_id']}d#{row['vulnerability_id']}" end
get_title(row)
click to toggle source
Returns the ticket's title
# File lib/nexpose_ticketing/modes/default_mode.rb, line 21 def get_title(row) truncate_title "#{row['ip_address']} => #{get_short_summary(row)}" end
print_description(description)
click to toggle source
Converts the ticket description object into a formatted string
# File lib/nexpose_ticketing/modes/default_mode.rb, line 45 def print_description(description) fields = [:header, :references, :solutions].map { |f| description[f] } finalize_description(fields.join("\n"), description[:nxid]) end
update_description(description, row)
click to toggle source
Updates the ticket description based on row data
# File lib/nexpose_ticketing/modes/default_mode.rb, line 40 def update_description(description, row) description end
updates_supported?()
click to toggle source
True if this mode supports ticket updates
# File lib/nexpose_ticketing/modes/default_mode.rb, line 11 def updates_supported? false end