Commit 8d7cb865 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'add-logging-to-rack-attack' into 'master'

Add logging for rack attack events

Patch for issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/15612 and partial patch for https://gitlab.com/gitlab-com/support/issues/119.

Also related: https://gitlab.com/gitlab-org/gitlab-ce/issues/22527 

Adds logging for throttle and blacklist rack attack events to the production log.

@stanhu @MrChrisW

See merge request !7585
parents 78e34d8a e14bb160
---
title: Add logging for rack attack events to production.log
merge_request:
author:
# 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']
Rails.logger.info("Rack_Attack: #{req.env['rack.attack.match_type']} #{req.ip} #{req.request_method} #{req.fullpath}")
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment