SECURITY: Rate limit the creation of backups

This commit is contained in:
Loïc Guitaut
2023-03-14 17:07:18 +01:00
committed by Loïc Guitaut
parent 272c31023d
commit 0bd64788d2
4 changed files with 78 additions and 22 deletions

View File

@ -34,6 +34,14 @@ class Admin::BackupsController < Admin::AdminController
end
def create
RateLimiter.new(
current_user,
"max-backups-per-minute",
1,
1.minute,
apply_limit_to_staff: true,
).performed!
opts = {
publish_to_message_bus: true,
with_uploads: params.fetch(:with_uploads) == "true",