Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move HTTP limiting to HTTPtables #1108

Open
krizhanovsky opened this issue Nov 19, 2018 · 0 comments
Open

Move HTTP limiting to HTTPtables #1108

krizhanovsky opened this issue Nov 19, 2018 · 0 comments

Comments

@krizhanovsky
Copy link
Contributor

krizhanovsky commented Nov 19, 2018

Scope

Particular protected domains (vhosts) may have specific rules to block or pass traffic by specific rule, for example:

  1. block all the traffic from particular regions (GeoIP is frequently used for DDoS mitigation) with custom HTTP status code;
  2. apply a rate limit only to requests to a prticular URL prefix and from particular geo region;

We already able to specify per-vhost rate limits, white lists, and use vhosts in HTTPtables. So now (please write a configuration examples in appropriate Wikis) we can do following:

So the first scenario can be satisfied in 0.7 using nftables GeoIP extension. The second scenario requires only integration between the rate limiting and HTTPtables, i.e. we only need to move http limiting to HTTP tables to be able to write following rules (scenario 2):

srv_group default { server 1.1.1.1; }
vhost app { proxy_pass default; }

http_chain geo_limit {
    uri != "/heavy_dynamic/*" -> app;
    -> request_rate 5;                  # 5 requests per second
}

http_chain {
    mark  == 1 -> geo_limit;   # there is match in netfilter GeoIP
    -> app;                              # pass to the application
}

The limiting logic is treated as current ACTION for HTTPtables.

Testing

The exact list of functional tests is TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant