lib/nexpose/vuln_exception.rb
# Submit this exception on the security console.
#
# @param [Connection] connection Connection to security console.
# @return [Fixnum] Newly assigned exception ID.
#
Submit this exception on the security console.
Submit this exception on the security console .
def save(connection, comment = nil)
      validate
      xml = connection.make_xml('VulnerabilityExceptionCreateRequest')
      xml.add_attributes({ 'vuln-id' => @vuln_id,
                           'scope' => @scope,
                           'reason' => @reason })
      case @scope
      when Scope::ALL_INSTANCES_ON_A_SPECIFIC_ASSET
        xml.add_attributes({ 'device-id' => @asset_id })
      when Scope::SPECIFIC_INSTANCE_OF_SPECIFIC_ASSET
        xml.add_attributes({ 'device-id' => @asset_id,
                             'port-no' => @port,
                             'vuln-key' => @vuln_key })
      end
      @submitter_comment = comment if comment
      if @submitter_comment
        comment_elem = REXML::Element.new('comment')
        comment_elem.add_text(@submitter_comment)
        xml.add_element(comment_elem)
      end
      response = connection.execute(xml, '1.2')
      @id = response.attributes['exception-id'].to_i if response.success
    end
def save ( connection , comment = nil ) validate xml = connection . make_xml ( 'VulnerabilityExceptionCreateRequest' ) xml . add_attributes ( { 'vuln-id' => @vuln_id , 'scope' => @scope , 'reason' => @reason } ) case @scope when Scope :: ALL_INSTANCES_ON_A_SPECIFIC_ASSET xml . add_attributes ( { 'device-id' => @asset_id } ) when Scope :: SPECIFIC_INSTANCE_OF_SPECIFIC_ASSET xml . add_attributes ( { 'device-id' => @asset_id , 'port-no' => @port , 'vuln-key' => @vuln_key } ) end @submitter_comment = comment if comment if @submitter_comment comment_elem = REXML :: Element . new ( 'comment' ) comment_elem . add_text ( @submitter_comment ) xml . add_element ( comment_elem ) end response = connection . execute ( xml , '1.2' ) @id = response . attributes [ 'exception-id' ] . to_i if response . success end
Submit this exception on the security console.
Submit this exception on the security console .
Newly assigned exception ID.
Newly assigned exception ID .
Fixnum
connection
<not_specific>
comment
<not_specific>
<not_specific>
connection Connection to security console.
connection Connection to security console .