Skip to content

Cookie protection ​

Symptoms of cookie protection: sealed cookies, key rotation, grace periods and cookie attributes.

  • Cause: after grace_until, unsealed copies of protected cookies count as tampered and are removed (on_tamper: remove). The grace period was empty (set by hand in the past) or too short for the cookie's lifetime. Or a key was rotated more than keys.keep times since the cookie was sealed (cookie.expired_key).
  • Check: events with rule cookie.unprotected or cookie.expired_key and the cookie name; waap cookies get -app NAME (grace_until, keys); the inventory's lifetime and "outlives its keys" note.
  • Fix: run waap cookies set -app NAME grace_until=168h; raise keys.keep or keys.rotation above the cookie's lifetime; or set on_tamper=log while you investigate.
  • Cause: the cookies section was removed while clients still hold sealed cookies. Only the section's presence makes inspection open them; enabled=false still opens them. Or the request did not go through inspection (fail-open after an inspection error).
  • Check: waap cookies get -app NAME (is the section configured?); the event's trace has a cookies step with "opened".
  • Fix: put the section back (waap cookies set -app NAME enabled=false keeps opening cookies without protecting them), and remove it only after the cookies have expired.
  • Cause: detect mode (the application's or the module's setting). No key yet: the trace says "no cookie key yet"; the active node creates one within about 10 seconds, and inspection loads it within 2 more. The cookie is being deleted (empty value or Max-Age=0). Sealed, it would exceed 4,096 bytes (cookie.too_large). The name does not match (remember_* does not match remember). Or more than 64 Set-Cookie headers in one answer.
  • Check: the trace's cookies step on the answer; waap cookies keys list -app NAME; waap_cookie_verdicts_total{result="no_key"|"too_large"}.
  • Cause: HttpOnly was added (names containing csrf or xsrf are left readable). Secure was added on HTTPS, so the cookie is no longer sent over plain HTTP. SameSite was added to a cookie that had none; a cross-site POST back from an identity provider needs None.
  • Check: the inventory (attributes as the upstream sets them) and the trace's set-cookie <name>: +HttpOnly ... notes.
  • Fix: add the cookie to attributes.except, or have the application set SameSite=None; Secure on the single sign-on cookie (an existing value is never overridden).
  • Cause: a data plane that ignores append_action in ext_proc header mutations. Envoy 1.39 reads the deprecated append flag, and the product's adapter sets both. This is seen only with a different or modified Envoy build.
  • Check: in a source checkout, the end-to-end test TestCookieProtection and the Envoy version check (make check-envoy).