Sha256: 85aa33ddc573e5cc91dc9d2bbd5589931bc706f889f11e4480eb6af581172c2e
Contents?: true
Size: 1.1 KB
Versions: 9
Compression:
Stored size: 1.1 KB
Contents
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/log' require 'sqreen/exception' require 'sqreen/actions/base' require 'sqreen/actions/user_action_class' module Sqreen module Actions # Blocks a user at the point Sqreen::identify() # or Sqreen::auth_track() are called class BlockUser < Base extend UserActionClass self.type_name = 'block_user' def initialize(id, opts, _params = {}) super(id, opts) end def do_run(identity_params) Sqreen.log.info( "Will raise due to user being blocked by action #{id}. " \ "Blocked user identity: #{identity_params}" ) e = Sqreen::AttackBlocked.new( "Blocked user with identity #{identity_params} " \ 'due to automatic security response. No action is required' ) { :status => :raise, :exception => e, } end def event_properties(identity_params) { 'user' => identity_params } end end end end
Version data entries
9 entries across 9 versions & 1 rubygems