Class: Contrast::Agent::Protect::ExploitableCollection

Inherits:
Object
  • Object
show all
Includes:
Components::Logger::InstanceMethods
Defined in:
lib/contrast/agent/protect/exploitable_collection.rb

Overview

This class will store all exploits or definite attack but require us to wait for response

Instance Method Summary collapse

Methods included from Components::Logger::InstanceMethods

#cef_logger, #logger

Constructor Details

#initializeExploitableCollection

Returns a new instance of ExploitableCollection.



14
15
16
# File 'lib/contrast/agent/protect/exploitable_collection.rb', line 14

def initialize
  @_collection = []
end

Instance Method Details

#collectionObject



18
19
20
# File 'lib/contrast/agent/protect/exploitable_collection.rb', line 18

def collection
  @_collection ||= []
end

#push(attack_result) ⇒ Object

Push the Result we need to store until response is available

Parameters:



25
26
27
# File 'lib/contrast/agent/protect/exploitable_collection.rb', line 25

def push attack_result
  @_collection << attack_result
end

#report_recorded_exploits(context) ⇒ Object

Attach attack results to the context

Parameters:



32
33
34
# File 'lib/contrast/agent/protect/exploitable_collection.rb', line 32

def report_recorded_exploits context
  context.activity.results.concat(@_collection)
end