Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gpt
large_projects
gitlabhq1
Commits
3e56e069
Commit
3e56e069
authored
8 years ago
by
Brian Neel
Browse files
Options
Download
Email Patches
Plain Diff
safelist/blocklist is for the Beta gem. Restore whitelist/blacklist
parent
1f35aee0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
config/initializers/rack_attack.rb.example
config/initializers/rack_attack.rb.example
+2
-2
config/initializers/rack_attack_git_basic_auth.rb
config/initializers/rack_attack_git_basic_auth.rb
+2
-2
No files found.
config/initializers/rack_attack.rb.example
View file @
3e56e069
...
...
@@ -26,12 +26,12 @@ whitelist = Gitlab.config.rack_attack['whitelist']
blacklist = Gitlab.config.rack_attack['blacklist'] unless Gitlab.config.rack_attack['blacklist'].nil?
unless Rails.env.test? || !rack_attack_enabled
Rack::Attack.
saf
elist('allow custom whitelist') do |req|
Rack::Attack.
whit
elist('allow custom whitelist') do |req|
whitelist.include? req.ip
end
unless blacklist.nil?
Rack::Attack.bl
o
cklist('ban custom blacklist') do |req|
Rack::Attack.bl
a
cklist('ban custom blacklist') do |req|
blacklist.include? req.ip
end
end
...
...
This diff is collapsed.
Click to expand it.
config/initializers/rack_attack_git_basic_auth.rb
View file @
3e56e069
...
...
@@ -3,8 +3,8 @@ git_basic_auth_enabled = Gitlab.config.rack_attack.git_basic_auth['enabled']
unless
Rails
.
env
.
test?
||
!
rack_attack_enabled
||
!
git_basic_auth_enabled
# Tell the Rack::Attack Rack middleware to maintain an IP blocklist. We will
# update the bl
o
cklist from GitLab::Auth.rate_limit
Rack
::
Attack
.
bl
o
cklist
(
'Git HTTP Basic Auth'
)
do
|
req
|
# update the bl
a
cklist from GitLab::Auth.rate_limit
Rack
::
Attack
.
bl
a
cklist
(
'Git HTTP Basic Auth'
)
do
|
req
|
Rack
::
Attack
::
Allow2Ban
.
filter
(
req
.
ip
,
Gitlab
.
config
.
rack_attack
.
git_basic_auth
)
do
# This block only gets run if the IP was not already banned.
# Return false, meaning that we do not see anything wrong with the
...
...
This diff is collapsed.
Click to expand it.
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