ed8ebc635a
Creates a new filename to register auth logs. This change should allow SRE's queries to make better queries through logging infrastructure. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54528
15 lines
477 B
Ruby
15 lines
477 B
Ruby
# frozen_string_literal: true
|
|
#
|
|
# Adds logging for all Rack Attack blocks and throttling events.
|
|
|
|
ActiveSupport::Notifications.subscribe('rack.attack') do |name, start, finish, request_id, req|
|
|
if [:throttle, :blacklist].include? req.env['rack.attack.match_type']
|
|
Gitlab::AuthLogger.error(
|
|
message: 'Rack_Attack',
|
|
env: req.env['rack.attack.match_type'],
|
|
ip: req.ip,
|
|
request_method: req.request_method,
|
|
fullpath: req.fullpath
|
|
)
|
|
end
|
|
end
|