Sha256: 962fcf70cb4e251073e7303e1b01a79ac76a5258170c9c925bac6d4e74a1e98a
Contents?: true
Size: 1.47 KB
Versions: 19
Compression:
Stored size: 1.47 KB
Contents
# typed: true # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html # TODO: sqreen/events require 'sqreen/event' module Sqreen # 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 class Attack < Event def self.record(payload) attack = Attack.new(payload) attack.enqueue end def infos payload['infos'] end def rulespack_id return nil unless payload['rule'] payload['rule']['rulespack_id'] end def rule_name return nil unless payload['rule'] payload['rule']['name'] end def test? return nil unless payload['rule'] payload['rule']['test'] ? true : false end def beta? return nil unless payload['rule'] payload['rule']['beta'] ? true : false end def block? return nil unless payload['rule'] payload['rule']['block'] ? true : false end def attack_type return nil unless payload['rule'] payload['rule']['attack_type'] end def time return nil unless payload['local'] payload['local']['time'] end def backtrace return nil unless payload['context'] payload['context']['backtrace'] end def enqueue Sqreen.queue.push(self) end end end
Version data entries
19 entries across 19 versions & 1 rubygems