envoyproxy / envoyproxy/envoy

Rate limit: add support for delay before rejection

Open
#14,264 8 comments 1 reaction 0 assignees View on GitHub
area/ratelimit help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

Description

*Title*: *Rate limit: add support for delay before rejection*

*Description*:
>When a connection or request is rate limited by the L4/L7 local rate limit filters, instead of immediately rejecting the connection or request it would be useful to reject after a pre-configured delay. That way, a malicious user is not able to retry as fast as possible which provides a better DoS protection for Envoy.

I believe the RLS service called by the rate limit filter can implement a delay on its end but it would be nice to have that functionality in Envoy especially for the local rate limit filter but could be shared by the global rate limit filter as well.

[Envoy doc](https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto)

*Proposed Solution*:
>Add config to specify the delay. For rejected requests, schedule a timer event and do the actual rejection when the timer calls back.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.