Sha256: 0f80ea67cc597abdea85a000e733467868ae257f457bb8c9000f996de4594b07

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 KB

Contents

# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

require 'contrast/components/logger'

module Contrast
  module Agent
    module Protect
      # This class will store all exploits or definite attack but
      # require us to wait for response
      class ExploitableCollection
        include Contrast::Components::Logger::InstanceMethods

        def initialize
          @_collection = []
        end

        def collection
          @_collection ||= []
        end

        # Push the Result we need to store until response is available
        #
        # @param attack_result [Contrast::Agent::Reporting::AttackResult]
        def push attack_result
          @_collection << attack_result
        end

        # Attach attack results to the context
        #
        # @param context [Contrast::Agent::RequestContext]
        def report_recorded_exploits context
          context.activity.results.concat(@_collection)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
contrast-agent-6.11.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.10.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.9.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.8.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.7.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.5 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.4 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.3 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.2 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.1 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.6.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.5.1 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.5.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.4.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.3.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.2.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.1.2 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.1.1 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.1.0 lib/contrast/agent/protect/exploitable_collection.rb
contrast-agent-6.0.0 lib/contrast/agent/protect/exploitable_collection.rb