Appearance
Access control, rate limits and bans Since v0.1
Access control is the first check every request meets. It decides who may reach an application (by address, network, country, path or a custom condition), how fast each client may send requests, and which clients are kept out for a while after misbehaving. Because it runs first and is cheap, it also spares the heavier checks the work of inspecting traffic you never want.
What it is made of
| Part | What it does | Scope | Page |
|---|---|---|---|
| Access rules | Ordered conditions with an action: block, log, allow, trust or ban. The first rule that matches decides. | per application | Access rules |
| Address lists | Named sets of addresses and networks, written by hand or fetched from an https URL. Access rules refer to them by name. | shared by all applications | Address lists |
| Rate limits | Count requests per client, per API consumer or for everyone together, and refuse with 429 above a limit. Also a cap on requests in progress per client. | per application | Rate limits |
| Bans | Refuse a client's address for a while: by hand, from an access rule or a rate limit with action ban, or automatically after repeated refusals. | every application | Bans |
In the console, the per-application parts are on Applications > All applications >application > Access and rate limits, with the tabs Access rules, Rate limits, Suggestions, Automatic bans, Exceptions and Staging and trace. Address lists are under Shared lists > Address lists, and active bans under Monitor > Clients and bans.
How a request is checked
The access module always runs, even when an application has no access rules, because bans apply everywhere. For each request it:
- Looks up the client's country (when a country database is configured).
- Refuses the request if the client's address is banned.
- Checks the access rules in list order. The first rule whose conditions all hold decides; later rules are not checked.
Other request checks follow (cookies, sessions, cross-site checks, bots, API authentication). Then the rate-limit module counts the request against every rate limit that matches it. Access rules whose expression uses a score (attack_score, automation_score and the like) are held back and checked after the signatures, because the scores exist only then.
The client is the address after trusted proxies
Every part of access control identifies a client by its IP address, taken after the trusted proxies in front of the product are removed. If clients arrive through a load balancer or reverse proxy, add it under Traffic > Trusted proxies first, or every request looks like it comes from the proxy.
What each action means
| Action | Effect on the request | Later checks |
|---|---|---|
block | Refused with the application's block response (default status 403). | not run |
log | Passes; an event is recorded. | run |
allow | Passes the access rules; no event. | run as usual |
trust | Passes, and the modules named in Skip modules (bots, signatures, rate_limits) do not run for it. | run, except the skipped ones |
ban | Refused like block, and the client's address is banned for Ban for. | not run |
allow is not a bypass
allow only ends the access rule list. Signatures, bot checks and rate limits still inspect the request. Use trust with Skip modules to exempt a client from those checks.
Detect and block
Each application, and each module in it, runs in detect (log only) or block. A module blocks only when both the application and the module are in block: if either is in detect, detect wins. New applications start in detect.
Application or module in detect | Both in block | |
|---|---|---|
Access rule block | logged, request passes | refused |
Access rule ban | logged as "would ban", no ban is created | refused, client banned |
| Banned client | logged, request passes | refused |
| Rate limit over the limit | logged, request passes | 429 |
| Automatic bans | not counted | counted, client banned at the threshold |
trust with Skip modules | modules are skipped | modules are skipped |
The access module's mode is Access protection mode (policy.access.mode); the rate-limit module's mode is Rate limit protection mode (policy.rate_limits.mode). Leave them empty to follow the application.
trust skips checks in every mode
A trust rule skips the named modules in detect too. A trust rule that is too broad hides attacks from the signatures even while you are still only watching.
Roles
| Task | Role needed |
|---|---|
| View rules, limits, lists, bans | viewer |
| Change an application's access rules, rate limits and automatic bans | operator for that application |
| Change address lists, the country database, or add and lift bans | operator or admin with access to all applications |
How changes take effect
Every change to rules, limits, lists and settings is previewed first and then applied as a new configuration version:
- Make the change in a form (or
waap rules set,waap lists set,waap apps set). - Select Preview changes (or add
-dry-run) to see the exact changes and any problem, named by field. - Add a Comment (recorded with the new version) and select Apply (or run without
-dry-run, with-m WHY).
The new version reaches the inspection services within seconds. To undo, roll back to an earlier version under System > Configuration versions. In a high-availability pair, configuration versions, bans and fetched address lists are copied from the active node to the standby; rate-limit counters and the country database file are per node.
Bans are the exception to versioning: they are runtime state, not configuration. Adding or lifting a ban takes effect within a few seconds and is recorded in the audit log, not as a version.