Appearance
Applications and core policy Since v0.2
Each entry of applications is one protected backend. policy holds its protection settings. This page covers the application keys and the core policy keys; the module sections have their own pages. Write policy. keys relative to the application.
For the structure of the file, see Configuration file. Defaults of limits are also listed in Limits and defaults. A dash in Default means the code sets no default value (the setting is empty or off).
Application keys
| Key | Type | Default | Allowed values / range | Meaning | Guide page |
|---|---|---|---|---|---|
applications[] | list of object | — | — | Group of settings: applications. | Modes and limits |
applications[].name | string | — | — | The name that identifies this entry. | Modes and limits |
applications[].hostnames | list of string | — | — | Sets hostnames. | Modes and limits |
applications[].listeners | list of string | — | — | Sets listeners. | Modes and limits |
applications[].redirect_to_https | boolean | — | — | Sets redirect to https. | Virtual servers |
applications[].certificate | object | — | — | Group of settings: certificate. | Virtual servers |
applications[].certificate.cert | string | — | — | Sets cert. | Virtual servers |
applications[].certificate.key | string | — | — | Name or path of the key. | Virtual servers |
applications[].server_pool | string | — | — | Sets server pool. | Server pools |
Upstream keys (version 1 files)
| Key | Type | Default | Allowed values / range | Meaning | Guide page |
|---|---|---|---|---|---|
applications[].upstream | object | — | — | Read only in format 1 files: the application's own backend. Spalto turns it into a server pool when the file is applied; format 2 uses server_pool. | Server pools |
applications[].upstream.targets | list of string | — | — | Sets targets. | Server pools |
applications[].upstream.balancing | string | — | round_robin, least_request, random | Sets balancing. | Server pools |
applications[].upstream.tls | object | — | — | Group of settings: tls. | Server pools |
applications[].upstream.tls.enabled | boolean | — | — | Turns the feature on or off. | Server pools |
applications[].upstream.tls.verify | boolean | true when enabled | — | default true when enabled | Server pools |
applications[].upstream.tls.ca | string | — | — | Path to the CA certificate used to verify the peer. | Server pools |
applications[].upstream.tls.server_name | string | — | — | TLS server name to present and verify. | Server pools |
applications[].upstream.health_check | object | — | — | Group of settings: health check. | Server pools |
applications[].upstream.health_check.host | string | — | — | Host name this entry applies to or connects to. | Server pools |
applications[].upstream.health_check.path | string | — | — | Request path. | Server pools |
applications[].upstream.health_check.interval | duration | 5s | — | Time between runs or checks. | Server pools |
applications[].upstream.health_check.timeout | duration | 2s | — | Time allowed before the operation is abandoned. | Server pools |
applications[].upstream.health_check.healthy_after | integer | 2 | — | Sets healthy after. | Server pools |
applications[].upstream.health_check.unhealthy_after | integer | 3 | — | Sets unhealthy after. | Server pools |
applications[].upstream.connect_timeout | duration | 5s | — | Sets connect timeout. | Server pools |
Core policy keys
| Key | Type | Default | Allowed values / range | Meaning | Guide page |
|---|---|---|---|---|---|
applications[].policy | object | — | — | Group of settings: policy. | Modes and limits |
applications[].policy.mode | string | detect | detect, block | Whether the feature only logs (detect) or also acts (block). | Modes and limits |
applications[].policy.on_inspection_failure | string | fail_open | fail_open, fail_closed | Sets on inspection failure. | Modes and limits |
applications[].policy.allowed_methods | list of string | GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE | — | Sets allowed methods. | Modes and limits |
applications[].policy.limits | object | — | — | Group of settings: limits. | Modes and limits |
applications[].policy.limits.request_body | size | 1MiB | up to 64MiB | Sets request body. | Modes and limits |
applications[].policy.limits.header_count | integer | 100 | up to 1000 | Sets header count. | Modes and limits |
applications[].policy.limits.header_bytes | size | 32KiB | up to 1MiB | Sets header bytes. | Modes and limits |
applications[].policy.limits.arguments | integer | 1000 | up to 10000 | Sets arguments. | Modes and limits |
applications[].policy.limits.module_budget | duration | 50ms | up to 5s | Sets module budget. | Modes and limits |
applications[].policy.block_response | object | — | — | Group of settings: block response. | Modes and limits |
applications[].policy.block_response.status | integer | 403 | 400 to 599 | HTTP status code. | Modes and limits |
applications[].policy.block_response.pages | object | — | — | Group of settings: pages. | Modes and limits |
applications[].policy.block_response.pages.blocked | string | — | — | the request was blocked | Modes and limits |
applications[].policy.block_response.pages.rate_limited | string | — | — | 429: too many requests | Modes and limits |
applications[].policy.block_response.pages.unavailable | string | — | — | 503: inspection failed (fail-closed) | Modes and limits |
applications[].policy.block_response.pages.error | string | — | — | an upstream error page replaced (headers.errors) | Modes and limits |
applications[].policy.signatures | object | — | — | Group of settings: signatures. | Signatures |
applications[].policy.signatures.enabled | boolean | true | — | default true | Signatures |
applications[].policy.signatures.mode | string | — | detect, block | empty: same as the application | Signatures |
applications[].policy.signatures.paranoia_level | integer | 1 | 1 to 4 | Sets paranoia level. | Paranoia and thresholds |
applications[].policy.signatures.anomaly_threshold | object | — | — | Group of settings: anomaly threshold. | Signatures |
applications[].policy.signatures.anomaly_threshold.inbound | integer | 5 | — | Sets inbound. | Signatures |
applications[].policy.signatures.anomaly_threshold.outbound | integer | 4 | — | Sets outbound. | Signatures |
applications[].policy.signatures.staged_rules | object | — | — | Group of settings: staged rules. | Staged rules |
applications[].policy.signatures.staged_rules.rules[] | list of object | — | — | Group of settings: rules. | Staged rules |
applications[].policy.signatures.staged_rules.until | time (RFC 3339) | — | — | Date or time after which the setting ends. | Staged rules |
applications[].policy.signatures.response_body | boolean | these rules cost the most | — | response_body runs the CRS response rules (data leakages, web shells) on in-scope response bodies (SIG-11). | Signatures |
applications[].policy.signatures.answer_confirmation | boolean | true | — | answer_confirmation checks the answers of requests that carry a probe shape (a quote, a markup breakout, a link to another host) for the proof: a database error, the markup unescaped, a redirect to that host. | Answer confirmation |
applications[].policy.signatures.allowed_redirect_hosts | list of string | — | — | allowed_redirect_hosts are hosts other than the application's own that its redirects may send clients to (a leading *. | Signatures |
applications[].policy.signatures.prefilter | boolean | true | — | prefilter removes, for each request, the attack rules that provably cannot match it (none of the text they require is in the request), before the rules run. | Prefilter |
applications[].policy.exceptions[] | list of object | — | — | Group of settings: exceptions. | Rule exclusions |
applications[].policy.exceptions[].name | string | — | — | The name that identifies this entry. | Rule exclusions |
applications[].policy.exceptions[].comment | string | — | — | Free-text note kept with the entry. | Rule exclusions |
applications[].policy.exceptions[].when | object | — | — | Group of settings: when. | Rule exclusions |
applications[].policy.exceptions[].when.paths | list of string | — | — | exact path, or a prefix ending in "*" | Rule exclusions |
applications[].policy.exceptions[].when.methods | list of string | — | — | uppercase methods | Rule exclusions |
applications[].policy.exceptions[].when.ip_lists | list of string | — | — | Bot rules only (bot.*): the client's address in one of these lists, its TLS or HTTP fingerprint one of these values (or leading parts ending in *). | Rule exclusions |
applications[].policy.exceptions[].when.ja4 | list of string | — | — | Sets ja4. | Rule exclusions |
applications[].policy.exceptions[].when.ja4h | list of string | — | — | Sets ja4h. | Rule exclusions |
applications[].policy.exceptions[].ignore_rules[] | list of object | — | — | Group of settings: ignore rules. | Rule exclusions |
applications[].policy.exceptions[].in | list of string | — | — | fields the rules are ignored in; empty = whole request | Rule exclusions |
applications[].policy.exceptions[].limits | object | — | — | Group of settings: limits. | Rule exclusions |
applications[].policy.exceptions[].limits.request_body | size | — | — | Sets request body. | Rule exclusions |
applications[].policy.exceptions[].skip_inspection | boolean | — | — | Sets skip inspection. | Rule exclusions |
applications[].policy.trace | object | — | — | Group of settings: trace. | Trace a request |
applications[].policy.trace.client_ips | list of string | — | — | Sets client ips. | Trace a request |
applications[].policy.trace.paths | list of string | — | — | Request paths the setting applies to. | Trace a request |
applications[].policy.trace.until | time (RFC 3339) | — | — | Date or time after which the setting ends. | Trace a request |
applications[].policy.logging | object | — | — | logging says how values are kept in events, captures and exports. | Logging and masking |
applications[].policy.logging.mask | string | off | — | mask: off (default) keeps every value as received; pci masks credentials, cookies, tokens, card numbers and sensitive fields, for applications in PCI DSS scope. | Logging and masking |
applications[].policy.logging.traffic | string | inherit | — | traffic overrides traffic.mode for this application: inherit (default), all, sample or off. | Logging and masking |
applications[].policy.logging.response_body | boolean | — | — | response_body asks inspection for this application's response bodies to record them in its traffic records and events' flow (also on when traffic.response_body is). | Logging and masking |
Example
yaml
version: 2
listeners:
- {name: web, address: "0.0.0.0:8080", protocol: http}
server_pools:
- name: shop
servers:
- {address: "127.0.0.1:9000", weight: 1, state: active}
applications:
- name: shop
hostnames: [shop.example.com]
listeners: [web]
server_pool: shop
policy:
mode: detect
on_inspection_failure: fail_open
limits: {request_body: 1MiB, header_count: 100, module_budget: 50ms}
block_response: {status: 403}
signatures: {paranoia_level: 1, anomaly_threshold: {inbound: 5, outbound: 4}}
logging: {mask: off, traffic: inherit}