Class: Threatstack::Events::AttackEvent
- Defined in:
- lib/events/models/attack_event.rb
Overview
Instrumentation event model that inherits the common attributes and adds its own specifics
Instance Attribute Summary collapse
-
#attack_details ⇒ Object
Returns the value of attribute attack_details.
-
#attack_message ⇒ Object
Returns the value of attribute attack_message.
-
#attack_stack ⇒ Object
Returns the value of attribute attack_stack.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#request_headers ⇒ Object
Returns the value of attribute request_headers.
-
#request_ip ⇒ Object
Returns the value of attribute request_ip.
-
#request_method ⇒ Object
Returns the value of attribute request_method.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
Attributes inherited from BaseEvent
#agent_type, #event_id, #event_type, #timestamp
Instance Method Summary collapse
-
#initialize(args) ⇒ AttackEvent
constructor
A new instance of AttackEvent.
- #to_hash ⇒ Object
Methods inherited from BaseEvent
#to_core_hash, #to_json_string
Constructor Details
#initialize(args) ⇒ AttackEvent
Returns a new instance of AttackEvent.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/events/models/attack_event.rb', line 30 def initialize(args) args[:event_type] = Threatstack::Constants::ATTACK @request_ip = args[:request_ip] @request_headers = args[:request_headers] @request_url = args[:request_url] @request_method = args[:request_method] @module_name = args[:module_name] @attack_message = args[:attack_message] @attack_stack = args[:attack_stack] @attack_details = args[:attack_details] super args end |
Instance Attribute Details
#attack_details ⇒ Object
Returns the value of attribute attack_details.
17 18 19 |
# File 'lib/events/models/attack_event.rb', line 17 def attack_details @attack_details end |
#attack_message ⇒ Object
Returns the value of attribute attack_message.
15 16 17 |
# File 'lib/events/models/attack_event.rb', line 15 def @attack_message end |
#attack_stack ⇒ Object
Returns the value of attribute attack_stack.
16 17 18 |
# File 'lib/events/models/attack_event.rb', line 16 def attack_stack @attack_stack end |
#module_name ⇒ Object
Returns the value of attribute module_name.
14 15 16 |
# File 'lib/events/models/attack_event.rb', line 14 def module_name @module_name end |
#request_headers ⇒ Object
Returns the value of attribute request_headers.
11 12 13 |
# File 'lib/events/models/attack_event.rb', line 11 def request_headers @request_headers end |
#request_ip ⇒ Object
Returns the value of attribute request_ip.
10 11 12 |
# File 'lib/events/models/attack_event.rb', line 10 def request_ip @request_ip end |
#request_method ⇒ Object
Returns the value of attribute request_method.
13 14 15 |
# File 'lib/events/models/attack_event.rb', line 13 def request_method @request_method end |
#request_url ⇒ Object
Returns the value of attribute request_url.
12 13 14 |
# File 'lib/events/models/attack_event.rb', line 12 def request_url @request_url end |
Instance Method Details
#to_hash ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/events/models/attack_event.rb', line 43 def to_hash hash = to_core_hash hash[:module_name] = @module_name hash[:payload] = { :attack => { :message => @attack_message, :stack => @attack_stack, :details => @attack_details }, :req => { :headers => @request_headers, :ip_address => @request_ip, :url => @request_url, :method => @request_method } } hash end |