v0.39.1
This commit is contained in:
1 parent
08d1608ef5
commit
d455028de3
16 files changed
+191
-48
No files matched your search
+4
-4
@@ -11,7 +11,7 @@ The **Static & diagnostics** subtab provides **Ignore request cookies for static
|
||||
|
||||
### Ready-made quick rules library
|
||||
|
||||
The **Add from template** dropdown is grouped by scenario. **Browse scenarios** opens a searchable panel with descriptions and one-click **Add** buttons for ready-made request, response and delivery rules. The library includes common application sessions, WordPress/WooCommerce, Django, Laravel, Auth.js, API and private routes, SSE/webhooks, TTL for verified public content and defensive headers. Some scenarios add multiple rules. Templates with a risk of unexpected shared-cache reuse are **disabled until reviewed**. The CDN and exact-name parent-domain cookie templates stay separate. See [Quick rules template library](CACHE_TEMPLATE_LIBRARY.md) for categories, order, defaults and tests. Adding rules changes the draft; save settings before relying on them.
|
||||
The **Add from template** dropdown is grouped by scenario. **Browse scenarios** opens a searchable panel with descriptions and one-click **Add** buttons for ready-made request, response and delivery rules. The library includes common application sessions, WordPress/WooCommerce, Django, Laravel, Auth.js, API and private routes, SSE/webhooks, TTL for verified public content and defensive headers. Some scenarios add multiple rules. Templates with a risk of unexpected shared-cache reuse are **disabled until reviewed**. The CDN and selective parent-domain cookie templates stay separate. See [Quick rules template library](CACHE_TEMPLATE_LIBRARY.md) for categories, order, defaults and tests. Adding rules changes the draft; save settings before relying on them.
|
||||
|
||||
### CDN security cookies (opt-in VCL template)
|
||||
|
||||
@@ -23,14 +23,14 @@ A parent domain may set `Set-Cookie: name=value; Domain=.example.test`, making b
|
||||
|
||||
Two **separate** opt-in templates remain available in the Vhost cache-rule editor:
|
||||
|
||||
1. **Vhost: remove selected parent-domain cookies** (inserted **disabled**): the operator supplies an exact comma-separated list of **non-session** cookie names in the `Remove only named cookies` action, replacing `REPLACE_WITH_VERIFIED_PARENT_COOKIE_NAME`. Only those names are removed from incoming GET/HEAD requests; every other cookie, including the application's session, stays intact. The rule has **no** `return(hash)` and **does not stop** subsequent cache rules. It excludes Authorization and example private paths; review the path list for your application. The example is [`examples/vcl/public-vhost-remove-parent-cookies.vcl`](../examples/vcl/public-vhost-remove-parent-cookies.vcl).
|
||||
1. **Vhost: remove selected parent-domain cookies** (inserted **disabled**): the operator supplies verified comma-separated cookie names or trailing-`*` prefixes in the `Remove selected cookies` action, replacing `REPLACE_WITH_VERIFIED_PARENT_COOKIE_NAME`. Only matching names are removed from incoming GET/HEAD requests; every other cookie, including the application's session, stays intact. The rule has **no** `return(hash)` and **does not stop** subsequent cache rules. It excludes Authorization and example private paths; review the path list for your application. The example is [`examples/vcl/public-vhost-remove-parent-cookies.vcl`](../examples/vcl/public-vhost-remove-parent-cookies.vcl).
|
||||
2. **CDN technical cookies** (independent, unchanged): its safe-method/private-path/Authorization guards, its anchored whole-header CDN cookie allowlist and **CDN: bypass remaining cookies** continue to run after parent cookie removal. It never treats a remaining session cookie as a CDN cookie. See [`examples/vcl/cdn-technical-cookies.vcl`](../examples/vcl/cdn-technical-cookies.vcl).
|
||||
|
||||
**Order:** place the parent-name rule **above** `CDN: remove ONLY technical cookies` and especially **above** `CDN: bypass remaining cookies`; leave the CDN guard rules active at the top. **Delete/disable any old `Public vhost: ignore inherited cookies` rule that uses `strip_cookies: keep=[]` + `lookup`**. Updating the binary does not remove existing saved rules. Never add an application session cookie, login token, CSRF token, locale/personalization cookie or sticky-session identifier to the parent-name list. Do not wildcard cookie names. If the same cookie name can belong to the parent **and** this application, use host-only cookies at the issuer instead of the removal rule.
|
||||
**Order:** place the parent-cookie rule **above** `CDN: remove ONLY technical cookies` and especially **above** `CDN: bypass remaining cookies`; leave the CDN guard rules active at the top. **Delete/disable any old `Public vhost: ignore inherited cookies` rule that uses `strip_cookies: keep=[]` + `lookup`**. Updating the binary does not remove existing saved rules. Never add an application session cookie, login token, CSRF token, locale/personalization cookie or sticky-session identifier to the parent-name list. The only supported wildcard is a **single trailing `*`** (a case-sensitive prefix). For example, `SESS*` or `SSESS*` can discard Drupal 6 cookies from an unrelated parent application, but **only if this Vhost never relies on that cookie family**. Interior wildcards, `*` alone, prefixes shorter than 3 characters and arbitrary regexes are rejected. If the same cookie name or prefix can belong to the parent **and** this application, use host-only cookies at the issuer instead of the removal rule.
|
||||
|
||||
Resulting request behavior on public pages: `Cookie: parent_marketing=1` (listed) → stripped → cache eligible; `Cookie: parent_marketing=1; __cf_bm=2` → parent removed by this rule, then CDN removed by its separate template → eligible; `Cookie: parent_marketing=1; app_session=abc` → only parent removed, session retained → CDN remaining-cookie rule **BYPASS**; POST, Authorization and private paths are not rewritten by the new template. Verify each using **Cache rule tester** and live `X-Cache-Reason` headers. Responses with `Set-Cookie`, `private` or `no-store` still cannot enter shared storage. The origin's `Vary: Cookie` stays intact and is evaluated against the **remaining** Cookie value. Configure logged-in origin responses as `private, no-store` as defense in depth.
|
||||
|
||||
The import syntax `remove_req_cookies("name1", "name2");` is a **RustProxy-specific VCL extension**, not stock Varnish syntax. It performs exact, case-sensitive name matching, preserves other cookies, and refuses to rewrite malformed Cookie fields. A graphical `Remove only named cookies` action uses the same implementation. This new action is not the dangerous `Strip cookies` / "keep" operation, which can remove other cookies.
|
||||
The import syntax `remove_req_cookies("name1", "name2");` is a **RustProxy-specific VCL extension**, not stock Varnish syntax. It performs exact, case-sensitive name matching or a case-sensitive prefix match for a **single trailing `*`**, preserves other cookies, and refuses to rewrite malformed Cookie fields. The graphical `Remove selected cookies` action uses the same implementation. For a Drupal 6 parent domain with local `session` cookies, see [`examples/vcl/drupal6-parent-session-cookies.vcl`](../examples/vcl/drupal6-parent-session-cookies.vcl). This new action is not the dangerous `Strip cookies` / "keep" operation, which can remove other cookies.
|
||||
|
||||
**Do not extend** `Ignore Vary: Cookie for public static assets` to a general "Ignore Vary" control. `Accept-Encoding`, `Accept-Language`, `Accept`, `Origin`, `User-Agent` and custom response-specific dimensions can change bytes, permissions or CORS headers. Keep the response's actual dimensions and use the existing safe normalization of recognized list fields below, or remove an unnecessary `Vary` at the origin only after proving the response is invariant. A VCL `unset beresp.http.Vary` is *possible*, but it is not the equivalent of a guarded static-file optimization.
|
||||
|
||||
|
||||
Reference in new issue
Block a user