Appearance
Response protection
Symptoms of response protection: security headers, error page cloaking, CSP reporting and answer compression.
Security headers or HSTS are missing from answers
- Cause: header protection is in detect mode (the application's or the module's setting; detect wins). The upstream sends the header itself: entries and presets apply only when a header is missing, unless the entry says
when: always. HSTS is sent on HTTPS answers only.X-Frame-Optionsis left out when the page's CSP hasframe-ancestors. Or the entry is limited to other content types. - Check: an event's trace (the
headersstep showswould changein detect mode andchangedin block mode);waap headers get -app NAME(mode and preset);waap headers posture. - Fix: run
waap headers set -app NAME mode=block, or add an entry withwhen: always.
A page broke after enforcing headers (frames, popups, scripts)
- Cause:
X-Frame-Options: SAMEORIGINstops other sites from framing the page.Cross-Origin-Opener-Policyseparates popups opened across sites. Thestrictpreset'sCross-Origin-Resource-Policy: same-originstops other sites from loading images or scripts. - Check: the browser console names the header; the trace lists which headers were added.
- Fix: add an entry for that header with the value the application needs (it replaces the preset's value), or use
when: removefor it. For embedding, sendframe-ancestorsin the CSP.
Users see "Something went wrong" with a reference instead of the application's error
- Cause: error pages are replaced (
errors.enabled) for that status. - Check: find the event by its reference (
waap events show ID): ruleheaders.error.cloaked, the upstream status and, witherrors.capture=true, a redacted excerpt of the upstream's error. One event per path and status per minute is recorded. - Fix: add the path to
errors.skip, narrowerrors.statuses, or turn onerrors.captureto keep the excerpt.
Error excerpt missing from cloaked-error events
- Cause:
errors.captureis off; or the error's content type is not in the response scope (waap response get,content_types); or its path is inskip; or the request is a HEAD. The page is still replaced, without an excerpt. Bodies compressed with br or zstd are not read (seewaap_response_bodies_total{result="encoded"}). - Fix: add the content type to
content_types. For br or zstd upstreams, turn onresponse.compress; the data plane then compresses after inspection.
CSP reports are not collected
- Cause:
csp_reportsis off. The page has no Content-Security-Policy header: reports point only at policies that exist, so usepreset=strictfor a report-only one. The CSP already names its ownreport-uriorreport-to, which is left as it is. More than 30 reports per minute from one client are refused with 429, and a report over 16 KiB with 413. - Check: the answer's CSP ends with
report-uri /.waap/csp-report;waap headers posture -app NAME.
Answers are no longer compressed, or compressed twice
- Cause: with
response.compress, the data plane compresses answers of common text types over 256 bytes that the upstream did not compress. Answers the upstream already encoded are left alone. Clients that send noAccept-Encodingget plain answers. - Check: the answer's
Content-Encoding;waap response get -app NAME.