Skip to content

Response protection ​

These commands configure what Spalto adds to, removes from, and reads in application responses: security headers, the body scope that response inspection reads, and the custom pages shown instead of Spalto's built-in ones.

waap headers get ​

Prints the header protection settings: value, default, whether set, and range.

sh
waap headers get -app NAME [-json]

waap headers set ​

Changes the header protection settings and rolls them out as a new version. KEY= removes a setting, back to its default. The first set turns header protection on.

sh
waap headers set -app NAME [-m WHY] [-dry-run] KEY=VALUE...

Keys:

  • enabled, mode
  • preset: none, baseline or strict
  • csp_reports
  • hsts.enabled, hsts.max_age (8760h is a year), hsts.include_subdomains, hsts.preload
  • remove_banners
  • remove: header names, comma-separated
  • errors.enabled, errors.statuses (5xx, 4xx, 404, ...), errors.status (keep, 500, 502, 503), errors.skip (paths), errors.capture
sh
waap headers set -app shop -m "baseline headers" preset=baseline hsts.max_age=8760h

waap headers list get ​

Prints the header entries as YAML.

sh
waap headers list get -app NAME -list LIST

waap headers list set ​

Replaces the header entries with the records in FILE (YAML or JSON). Each record has name, value, when (missing, always or remove) and content_types. An empty list ([]) removes them.

sh
waap headers list set -app NAME -list LIST -f FILE [-m WHY] [-dry-run]

waap headers presets ​

Lists the built-in presets with their headers, when they apply and to which content types.

sh
waap headers presets

waap headers posture ​

Shows, per content family (html, json, other):

  • the answers counted, and each tracked security header's share of answers with an example value
  • what the policy does (added when missing, removed)
  • the recommended headers never sent to HTML
  • the CSP violation reports: count, directive, blocked origin, page and last seen

Counts are taken on every node while header protection is on, and flushed about every minute.

It then shows the unsafe CORS answers the upstream sent on paths without a CORS rule, from cors.backend.reflect events: path, count, last seen, what was allowed, and the newest event.

sh
waap headers posture -app NAME [-window 7d] [-json]

waap response get ​

Prints the response scope settings.

sh
waap response get -app NAME [-json]

waap response set ​

Changes the response scope as a new version.

sh
waap response set -app NAME [-m WHY] [-dry-run] KEY=VALUE...

Keys:

  • max_body: bytes read at most. Default 1MiB, at most 16MiB.
  • content_types: default text/html, text/plain, text/csv, application/json, application/xml, text/xml, +json, +xml.
  • skip: paths never read.
  • compress: the data plane compresses answers after inspection.

waap pages set ​

Uses FILE as the custom page of a kind. FILE is read from standard input when it is -. It is HTML, at most 64 KiB. It is rolled out as a new version (policy.block_response.pages).

sh
waap pages set -app NAME -kind KIND -f FILE [-m WHY] [-dry-run]

KIND is one of:

  • blocked
  • rate_limited
  • unavailable
  • error: replaces upstream errors.

Placeholders: , , , . Pages may style themselves and show data: images, but they run no scripts.

waap pages reset ​

Returns the custom page of a kind to the built-in page.

sh
waap pages reset -app NAME -kind KIND [-m WHY] [-dry-run]