class Sqreen::Attack
Attack
When creating a new attack, it gets automatically pushed to the event's queue. XXX: TURNS OUT THIS CLASS IS ACTUALLY NOT USED ANYMORE Framework.observe is used instead with unstructured attack details
Public Class Methods
record(payload)
click to toggle source
# File lib/sqreen/events/attack.rb, line 17 def self.record(payload) attack = Attack.new(payload) attack.enqueue end
Public Instance Methods
attack_type()
click to toggle source
# File lib/sqreen/events/attack.rb, line 51 def attack_type return nil unless payload['rule'] payload['rule']['attack_type'] end
backtrace()
click to toggle source
# File lib/sqreen/events/attack.rb, line 61 def backtrace return nil unless payload['context'] payload['context']['backtrace'] end
beta?()
click to toggle source
# File lib/sqreen/events/attack.rb, line 41 def beta? return nil unless payload['rule'] payload['rule']['beta'] ? true : false end
block?()
click to toggle source
# File lib/sqreen/events/attack.rb, line 46 def block? return nil unless payload['rule'] payload['rule']['block'] ? true : false end
datadog_span_id()
click to toggle source
# File lib/sqreen/events/attack.rb, line 70 def datadog_span_id payload['context']['datadog_span_id'] end
datadog_trace_id()
click to toggle source
# File lib/sqreen/events/attack.rb, line 66 def datadog_trace_id payload['context']['datadog_trace_id'] end
enqueue()
click to toggle source
# File lib/sqreen/events/attack.rb, line 74 def enqueue Sqreen.queue.push(self) end
infos()
click to toggle source
# File lib/sqreen/events/attack.rb, line 22 def infos payload['infos'] end
rule_name()
click to toggle source
# File lib/sqreen/events/attack.rb, line 31 def rule_name return nil unless payload['rule'] payload['rule']['name'] end
rulespack_id()
click to toggle source
# File lib/sqreen/events/attack.rb, line 26 def rulespack_id return nil unless payload['rule'] payload['rule']['rulespack_id'] end
test?()
click to toggle source
# File lib/sqreen/events/attack.rb, line 36 def test? return nil unless payload['rule'] payload['rule']['test'] ? true : false end
time()
click to toggle source
# File lib/sqreen/events/attack.rb, line 56 def time return nil unless payload['local'] payload['local']['time'] end