-
Notifications
You must be signed in to change notification settings - Fork 103
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
Confusing vhost and defatult frang limits #1440
Comments
Also the configuration from #1439 (comment) leads to misleading configuration error
instead of explaining that the limit must be in global section. Maybe it's easier to run a configuration check in a user space script than to handle it in the kernel C configuration. Probably this is subject for |
This is all about implicit directives and directive inheritance between sections. (Some times I hate that feature because of debugging complexity). What is happening in this configuration. A top-level
Connection-level limits will be applied to all vhosts, because they works at lower levels, when HTTP information is not yet available. Since message-level limits are defined at top-level of configuration, they are not attached to any vhost instead they update default Frang values for vhost listed below top-level directive. In your configuration explicit default vhost was listed before frang configuration was redefined, that it why you didn't see In the test the situation differ: default vhost is added implicitly after the whole configuration is processed. That is why it catches updated Frang defaults. When we spoke about #862 and #67 we mentioned that Tempesta should have option to print current effective configuration in short (skipping implicit) and long (showing all implicit) forms. This will make understanding and debugging configuration much more easier and user-friendly. |
OK, I added example configuration
to https://github.com/tempesta-tech/tempesta/wiki/HTTP-security#frang-security-limits-enforcing-module . I also added statement that the global limits must be specified before vhosts. Also I missed a line of the log error, the whole error was:
|
Scope
I've spent about 1 hour trying to understand why if I use a configuration like
and send many requests producing 403 response, Tempesta FW doesn't execute the
http_resp_code_block
limit. The reason is that I had to movefrang_limits
tovhost
section - in this case the limit works perfectly. I'd expect that the configuration above applies as the default for all virtual hosts, but this doesn't happen. Also note thatfrang/test_http_resp_code_block.py
test uses configuration as, i.e. w/o any vhosts at all and the test works fine.
We need either to fix the problem or explain the behaviour in https://github.com/tempesta-tech/tempesta/wiki/HTTP-security#frang-security-limits-enforcing-module
Testing
Please update
frang/test_http_resp_code_block.py
with the scenario,The text was updated successfully, but these errors were encountered: