Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e14bb160
Commit
e14bb160
authored
Nov 18, 2016
by
Brian Neel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging for rack attack events
parent
0e0f1dea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
changelogs/unreleased/rack_attack_logging.yml
changelogs/unreleased/rack_attack_logging.yml
+4
-0
config/initializers/rack_attack_logging.rb
config/initializers/rack_attack_logging.rb
+7
-0
No files found.
changelogs/unreleased/rack_attack_logging.yml
0 → 100644
View file @
e14bb160
---
title
:
Add logging for rack attack events to production.log
merge_request
:
author
:
config/initializers/rack_attack_logging.rb
0 → 100644
View file @
e14bb160
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment