Просмотр исходного кода

docs: JWT public key rotation and upgrade note (GHSA-v863-wq24-xg2x)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamesread 1 день назад
Родитель
Сommit
4c3c6208aa

+ 1 - 1
docs/modules/ROOT/pages/config.adoc

@@ -89,7 +89,7 @@ All configuration options are covered in the solution sections
 | `authJwtClaimUsername` | The claim to use for the username. | `sub` | Requires restart | xref:security/jwt_hmac.adoc[JWT with HMAC], xref:security/jwt_keys.adoc[JWT with Keys]
 | `authJwtClaimUserGroup` | The claim to use for the usergroup. | `sub` | Requires restart | xref:security/jwt_hmac.adoc[JWT with HMAC], xref:security/jwt_keys.adoc[JWT with Keys]
 | `authJwtHeader` | The HTTP header to use for JWT authentication. | `` | Requires restart | xref:security/jwt_keys.adoc[JWT with Keys]
-| `authJwtPubKeyPath` | The path to the public key to use for JWT authentication. | `` | Requires restart | xref:security/jwt_keys.adoc[JWT with Keys]
+| `authJwtPubKeyPath` | The path to the public key to use for JWT authentication. | `` | Live reloadable. The key file is read on every request, so replacing it takes effect without a restart. | xref:security/jwt_keys.adoc#rotating-public-keys-on-disk[JWT with Keys]
 | `authHttpHeaderUsername` | The HTTP header to use for the username. | `` | Requires restart | xref:security/trusted_header.adoc[Trusted Headers]
 | `authHttpHeaderUserGroup` | The HTTP header to use for the usergroup. | `` | Requires restart | xref:security/trusted_header.adoc[Trusted Headers]
 | `authLocalUsers` | The list of local users. | `[]` | Requires restart | xref:security/local.adoc[Local Users]

+ 7 - 0
docs/modules/ROOT/pages/security/jwt_keys.adoc

@@ -46,6 +46,13 @@ authJwtClaimUsername: email
 authJwtCookieName: "CF_Authorization"
 ----
 
+[#rotating-public-keys-on-disk]
+=== Rotating public keys on disk
+
+OliveTin reads the key file on every request, so you can rotate the key by replacing the file at the same path, for example by updating a Kubernetes or Docker secret, without restarting OliveTin. As soon as the file changes, tokens signed by the old key are rejected and tokens signed by the new key are accepted.
+
+If the key file is missing or cannot be parsed, OliveTin rejects every JWT until the file is fixed. When you replace the file, write the new key to a temporary file and rename it over the old one, so that OliveTin never reads a half-written key.
+
 == See Also
 
 * xref:solutions/cloudflare_access_tunnel/index.adoc[Cloudflare Access & Tunnels Solution]

+ 7 - 0
docs/modules/ROOT/pages/upgrade/upgrade_notes.adoc

@@ -19,6 +19,13 @@ A webhook in `execOnWebhook` without an `authType` used to accept every request
 
 If you have webhooks without an `authType`, add one. Use `authType: bearer`, `hmac-sha256`, `hmac-sha1` or `basic` with a `secret`, or set `authType: none` if the webhook should accept requests from anyone who can reach `/webhooks`. See xref:action_execution/onwebhook.adoc#every-webhook-needs-an-authtype[Webhook Authentication].
 
+[#jwt-local-key-reloaded]
+=== JWT public keys on disk are read on every request
+
+When `authJwtPubKeyPath` is set, OliveTin used to load the key file once and keep using that key until it restarted, even if the file was replaced, deleted or broken. It now reads the file on every request. Replacing the file takes effect straight away, so tokens signed by the old key stop working without a restart.
+
+If the key file is missing or cannot be parsed, every JWT is now rejected, instead of the previously loaded key staying in use. If you remove or move the key file while OliveTin is running, make sure the file at `authJwtPubKeyPath` is always present and valid. See xref:security/jwt_keys.adoc#rotating-public-keys-on-disk[Rotating public keys on disk].
+
 [#whoami-session-fingerprint]
 === `WhoAmI` no longer returns the session ID