Appearance
Modes and limits Since v0.1
These settings apply to a whole application: its protection mode, what happens when inspection fails, the allowed methods and the bounds on each request. The last section covers settings that are shared by every application.
Before you begin
- Role:
operatorfor the application (viewercan read the settings). - To judge detect results, you need the application's events: Monitor > Events.
Switch an application between detect and block
In detect, the application logs what it would block. In block, it stops attacks. A module in block inside an application in detect only logs. The workflow: watch the events, add exceptions for false positives, then switch to block.
text
1. Open Applications > All applications, and select the application.
2. Open Request checks > General.
3. Under Security policy, set Protection mode.
4. Select Preview changes, add a comment and select Apply.sh
waap apps set -app shop -m "enforce" policy.mode=blockyaml
# applications[].policy in the configuration
policy:
mode: blockA false positive blocks a real user
Read a few days of events from normal traffic before you switch to block.
Choose the failure policy
The failure policy decides what happens when inspection itself fails: an error in the pipeline, a module that stops at its time budget, or Envoy not reaching the inspection service.
text
1. Open Applications > All applications, and select the application.
2. Open Request checks > General.
3. Under Security policy, set When inspection fails.
4. Select Preview changes, add a comment and select Apply.sh
waap apps set -app shop -m "refuse when inspection fails" policy.on_inspection_failure=fail_closedyaml
policy:
on_inspection_failure: fail_closed # default: fail_openfail_open passes the request. fail_closed refuses it with 503.
fail_closed can refuse all traffic
If the inspection service is down, every request to a fail_closed application is refused. Use it where a missed attack costs more than an outage.
Set request limits
Limits bound the work done for one request. An over-limit request is refused with 413 (body) or 431 (headers), and an event explains why.
text
1. Open Applications > All applications, and select the application.
2. Open Request checks > General.
3. Under Request limits, set Request body, Headers, Header bytes, Parameters and
Time per module.
4. Select Preview changes, add a comment and select Apply.sh
waap apps set -app shop -m "bigger uploads" policy.limits.request_body=8MiByaml
policy:
limits:
request_body: 8MiB
header_count: 100
header_bytes: 32KiB
arguments: 1000
module_budget: 50msThe time budget
policy.limits.module_budget bounds each module. What happens at the budget depends on whether the module has a result.
- A module that stops without a result is an inspection failure. The failure policy decides, and the event's error names the module, for example
signatures: stopped after request headers: context deadline exceeded. - A module that finishes late with a finding still acts on it: it blocks in
blockand logs indetect. The event keeps the overrun (signatures: exceeded time budget (61ms > 50ms)) and the request trace shows it.
Over-budget runs mean the host is overloaded or the rules are slow for the traffic.
Choose the allowed methods and the block status
policy.allowed_methods lists the methods the application accepts. Others are refused. Envoy's parser refuses unknown methods first, and they appear only in the access log. policy.block_response.status is the status sent with the block page.
sh
waap apps set -app shop -m "no PUT" policy.allowed_methods=GET,HEAD,POST,OPTIONS,PATCH,DELETE policy.block_response.status=403yaml
policy:
allowed_methods: [GET, HEAD, POST, OPTIONS, PATCH, DELETE]
block_response: {status: 403}Replace the block pages
Each application can show its own page for four situations: blocked, rate_limited (429), unavailable (503, inspection failed with fail_closed) and error. API clients get JSON with the event reference instead.
text
1. Open Applications > All applications, and select the application.
2. Open Traffic > Error and block pages.
3. For a kind, upload an HTML file. It is checked before you apply.
Select Preview changes, then Apply. Reset returns to the built-in page.sh
waap pages set -app shop -kind blocked -f page.html -m "branded block page"
waap pages reset -app shop -kind blockedThe page is plain HTML of at most 64 KiB. Scripts do not run in it. It can use the placeholders , , and .
Settings reference
Security policy
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Protection mode (policy.mode) | Logs only, or stops attacks. | detect | detect, block | all |
When inspection fails (policy.on_inspection_failure) | Pass or refuse the request when inspection fails. | fail_open | fail_open, fail_closed | all |
Allowed methods (policy.allowed_methods) | Methods the application accepts. | GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE | uppercase HTTP methods, no duplicates | all |
Block status (policy.block_response.status) | Status sent with the block page. | 403 | 400 to 599 | block |
Request limits
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Request body (policy.limits.request_body) | Bytes of request body accepted and inspected. | 1MiB | 1 byte to 64 MiB | all |
Headers (policy.limits.header_count) | Request headers accepted. | 100 | 1 to 1000 | all |
Header bytes (policy.limits.header_bytes) | Bytes of all request headers together. | 32KiB | 1 KiB to 1 MiB | all |
Parameters (policy.limits.arguments) | Query and body parameters per request. | 1000 | 1 to 10000 | all |
Time per module (policy.limits.module_budget) | Inspection time one module may take per request. | 50ms | 1ms to 5s | all |
JSON and XML nesting depth and element counts are API protection limits, not application limits. Their defaults are 32 levels each, with a maximum of 512 (policy.api.limits.json.depth, policy.api.limits.xml.depth).
Settings shared by every application
Shared settings live outside any one application. Edit them under System > Settings, or with waap settings get SECTION and waap settings set SECTION KEY=VALUE... (get lists each key with its default and range).
| Section | What it controls | Where |
|---|---|---|
events | Event storage: bytes of request body kept per event, retention, maximum event count and storage size. | System > Settings > Event storage |
traffic | The traffic log. | System > Settings > Traffic log |
geoip | The country database. | System > Settings > Country database |
bot_catalog | Whether published search-engine ranges are downloaded, and your own catalog entries. | Shared lists > Bot catalog |
management | Management access (administrators). | System > Accounts and access |
ha | High-availability pair settings (administrators). | System > High availability |
Event storage
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
| Request body bytes kept per event | Cap on the body saved with an event. | empty: each application's request body limit | 0 keeps none; at most 64 KiB | all applications |
| Retention | How long events are kept. | 720h (30 days) | 1h to 3 years | all applications |
| Most events kept | Count cap; the oldest go first. | 1000000 | up to 100000000 | all applications |
Most event storage (max_bytes) | Size cap; the oldest go first. | 2GiB | 1 MiB to 16 TiB | all applications |
Limits apply at the next cleanup, within minutes.
Durations use hours
Go durations have no d unit. Write 30 days as 720h.
Limits
| Limit | Value |
|---|---|
| Request body | 64 MiB maximum |
| Headers per request | 1000 maximum |
| Header bytes | 1 MiB maximum |
| Parameters per request | 10000 maximum |
| Module time budget | 5s maximum |
| Block page | 64 KiB |
For every default and bound in one place, see Limits and defaults.
Troubleshooting
An attack was allowed although the application is in block. Cause: the module is in detect, or it exceeded its time budget without a result under fail_open. Check: the event's mode and error, and the request trace. Fix: set the module to block, or speed up the rules and raise the budget.
Requests are refused with 413 or 431. Cause: a request is over a limit. Check: the event of the refusal. Fix: raise the limit if the traffic is legitimate.
Requests are refused with 503. Cause: inspection failed and the application is fail_closed. Check: the inspection service status and the event's error. Fix: restore the service or choose fail_open.