Sha256: af8f7ef3ae909e1c53fe116a2bb83fb62288935654857007e0bef0d022ffe135
Contents?: true
Size: 967 Bytes
Versions: 10
Compression:
Stored size: 967 Bytes
Contents
# typed: ignore # 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
10 entries across 10 versions & 1 rubygems