Skip to content

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 ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[]list of object——Group of settings: applications.Modes and limits
applications[].namestring——The name that identifies this entry.Modes and limits
applications[].hostnameslist of string——Sets hostnames.Modes and limits
applications[].listenerslist of string——Sets listeners.Modes and limits
applications[].redirect_to_httpsboolean——Sets redirect to https.Virtual servers
applications[].certificateobject——Group of settings: certificate.Virtual servers
applications[].certificate.certstring——Sets cert.Virtual servers
applications[].certificate.keystring——Name or path of the key.Virtual servers
applications[].server_poolstring——Sets server pool.Server pools

Upstream keys (version 1 files) ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].upstreamobject——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.targetslist of string——Sets targets.Server pools
applications[].upstream.balancingstring—round_robin, least_request, randomSets balancing.Server pools
applications[].upstream.tlsobject——Group of settings: tls.Server pools
applications[].upstream.tls.enabledboolean——Turns the feature on or off.Server pools
applications[].upstream.tls.verifybooleantrue when enabled—default true when enabledServer pools
applications[].upstream.tls.castring——Path to the CA certificate used to verify the peer.Server pools
applications[].upstream.tls.server_namestring——TLS server name to present and verify.Server pools
applications[].upstream.health_checkobject——Group of settings: health check.Server pools
applications[].upstream.health_check.hoststring——Host name this entry applies to or connects to.Server pools
applications[].upstream.health_check.pathstring——Request path.Server pools
applications[].upstream.health_check.intervalduration5s—Time between runs or checks.Server pools
applications[].upstream.health_check.timeoutduration2s—Time allowed before the operation is abandoned.Server pools
applications[].upstream.health_check.healthy_afterinteger2—Sets healthy after.Server pools
applications[].upstream.health_check.unhealthy_afterinteger3—Sets unhealthy after.Server pools
applications[].upstream.connect_timeoutduration5s—Sets connect timeout.Server pools

Core policy keys ​

KeyTypeDefaultAllowed values / rangeMeaningGuide page
applications[].policyobject——Group of settings: policy.Modes and limits
applications[].policy.modestringdetectdetect, blockWhether the feature only logs (detect) or also acts (block).Modes and limits
applications[].policy.on_inspection_failurestringfail_openfail_open, fail_closedSets on inspection failure.Modes and limits
applications[].policy.allowed_methodslist of stringGET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE—Sets allowed methods.Modes and limits
applications[].policy.limitsobject——Group of settings: limits.Modes and limits
applications[].policy.limits.request_bodysize1MiBup to 64MiBSets request body.Modes and limits
applications[].policy.limits.header_countinteger100up to 1000Sets header count.Modes and limits
applications[].policy.limits.header_bytessize32KiBup to 1MiBSets header bytes.Modes and limits
applications[].policy.limits.argumentsinteger1000up to 10000Sets arguments.Modes and limits
applications[].policy.limits.module_budgetduration50msup to 5sSets module budget.Modes and limits
applications[].policy.block_responseobject——Group of settings: block response.Modes and limits
applications[].policy.block_response.statusinteger403400 to 599HTTP status code.Modes and limits
applications[].policy.block_response.pagesobject——Group of settings: pages.Modes and limits
applications[].policy.block_response.pages.blockedstring——the request was blockedModes and limits
applications[].policy.block_response.pages.rate_limitedstring——429: too many requestsModes and limits
applications[].policy.block_response.pages.unavailablestring——503: inspection failed (fail-closed)Modes and limits
applications[].policy.block_response.pages.errorstring——an upstream error page replaced (headers.errors)Modes and limits
applications[].policy.signaturesobject——Group of settings: signatures.Signatures
applications[].policy.signatures.enabledbooleantrue—default trueSignatures
applications[].policy.signatures.modestring—detect, blockempty: same as the applicationSignatures
applications[].policy.signatures.paranoia_levelinteger11 to 4Sets paranoia level.Paranoia and thresholds
applications[].policy.signatures.anomaly_thresholdobject——Group of settings: anomaly threshold.Signatures
applications[].policy.signatures.anomaly_threshold.inboundinteger5—Sets inbound.Signatures
applications[].policy.signatures.anomaly_threshold.outboundinteger4—Sets outbound.Signatures
applications[].policy.signatures.staged_rulesobject——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.untiltime (RFC 3339)——Date or time after which the setting ends.Staged rules
applications[].policy.signatures.response_bodybooleanthese 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_confirmationbooleantrue—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_hostslist 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.prefilterbooleantrue—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[].namestring——The name that identifies this entry.Rule exclusions
applications[].policy.exceptions[].commentstring——Free-text note kept with the entry.Rule exclusions
applications[].policy.exceptions[].whenobject——Group of settings: when.Rule exclusions
applications[].policy.exceptions[].when.pathslist of string——exact path, or a prefix ending in "*"Rule exclusions
applications[].policy.exceptions[].when.methodslist of string——uppercase methodsRule exclusions
applications[].policy.exceptions[].when.ip_listslist 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.ja4list of string——Sets ja4.Rule exclusions
applications[].policy.exceptions[].when.ja4hlist of string——Sets ja4h.Rule exclusions
applications[].policy.exceptions[].ignore_rules[]list of object——Group of settings: ignore rules.Rule exclusions
applications[].policy.exceptions[].inlist of string——fields the rules are ignored in; empty = whole requestRule exclusions
applications[].policy.exceptions[].limitsobject——Group of settings: limits.Rule exclusions
applications[].policy.exceptions[].limits.request_bodysize——Sets request body.Rule exclusions
applications[].policy.exceptions[].skip_inspectionboolean——Sets skip inspection.Rule exclusions
applications[].policy.traceobject——Group of settings: trace.Trace a request
applications[].policy.trace.client_ipslist of string——Sets client ips.Trace a request
applications[].policy.trace.pathslist of string——Request paths the setting applies to.Trace a request
applications[].policy.trace.untiltime (RFC 3339)——Date or time after which the setting ends.Trace a request
applications[].policy.loggingobject——logging says how values are kept in events, captures and exports.Logging and masking
applications[].policy.logging.maskstringoff—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.trafficstringinherit—traffic overrides traffic.mode for this application: inherit (default), all, sample or off.Logging and masking
applications[].policy.logging.response_bodyboolean——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}