Sha256: 44eeeb21faa21d656844ea4dece18a05f94b613113346db79777c81fc50a866a
Contents?: true
Size: 965 Bytes
Versions: 29
Compression:
Stored size: 965 Bytes
Contents
# typed: true # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/exception' require 'sqreen/actions/base' require 'sqreen/actions/ip_range_indexed_action_class' module Sqreen module Actions # Block a list of IP address ranges. Standard "raise" behavior. class BlockIp < Base extend IpRangeIndexedActionClass self.type_name = 'block_ip' def initialize(id, opts, _params = {}) # no need to store the ranges for this action, the index filter the class super(id, opts) end def do_run(client_ip) e = Sqreen::AttackBlocked.new("Blocked client's IP #{client_ip} " \ "(action: #{id}). No action is required") { :status => :raise, :exception => e, :skip_rem_cbs => true } end def event_properties(client_ip) { 'ip_address' => client_ip } end end end end
Version data entries
29 entries across 29 versions & 1 rubygems