Commit 3e56e069 authored by Brian Neel's avatar Brian Neel
Browse files

safelist/blocklist is for the Beta gem. Restore whitelist/blacklist

parent 1f35aee0
......@@ -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.safelist('allow custom whitelist') do |req|
Rack::Attack.whitelist('allow custom whitelist') do |req|
whitelist.include? req.ip
end
unless blacklist.nil?
Rack::Attack.blocklist('ban custom blacklist') do |req|
Rack::Attack.blacklist('ban custom blacklist') do |req|
blacklist.include? req.ip
end
end
......
......@@ -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 blocklist from GitLab::Auth.rate_limit
Rack::Attack.blocklist('Git HTTP Basic Auth') do |req|
# update the blacklist from GitLab::Auth.rate_limit
Rack::Attack.blacklist('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
......
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