0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/lib/middleware
Jake Goldsborough d948d26d25 FIX: Rate limit health check requests per backend
Load balancers health check every backend they route to, and every
backend increments the same Redis-backed per-IP counter, so health
check volume scales linearly with backend count while the per-IP
budget does not. With enough backends, health checks alone exceed the
limit and every backend gets marked down with 429s.

Key /srv/status requests on source IP plus backend hostname via a new
HealthCheck rate limiter ahead of the IP limiter. Each backend gets
its own budget, so the per-key rate stays constant regardless of
scale, and health checks remain rate limited.

Health checks from private address space skip rate limiting by
default, so most deployments see no behavior change. This matters when
load balancers check from publicly-routable addresses, such as public
IPv6 ranges. An attacker gains N x rate_limit on /srv/status across N
backends, which is not a practical concern for one of the cheapest
routes in the application.
2026-07-30 13:36:14 +00:00
..
anonymous_cache.rb FEATURE: Allow selection of multiple content languages when viewing topics and posts (#42128) 2026-07-30 12:19:44 +08:00
crawler_hooks.rb UX: Prevent incomplete crawler localization settings (#41297) 2026-07-01 12:13:22 +08:00
csp_script_nonce_injector.rb PERF: Avoid replacing CSP nonces in non-cacheable responses (#42008) 2026-07-24 09:49:01 +08:00
default_headers.rb
discourse_public_exceptions.rb
enforce_hostname.rb
missing_avatars.rb DEV: Enable Rails/FilePath rubocop rule (#40097) 2026-05-19 19:07:54 +02:00
omniauth_bypass_middleware.rb
overload_protections.rb FIX: Include API key requests in overload protection bypass (#39702) 2026-05-07 12:59:11 +08:00
processing_request.rb PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519) 2025-12-18 10:23:42 +08:00
request_tracker.rb FIX: Rate limit health check requests per backend 2026-07-30 13:36:14 +00:00
track_view_session_id_injector.rb FIX: Anon pageview session id reused across cached responses (#39879) 2026-05-12 10:13:05 +08:00