|
|
@@ -271,13 +271,15 @@ the QuickJS engine and pool, the runner service (`ctx.*`, `/run`, `/validate`,
|
|
|
`/health`, the binary), functions CRUD, HTTP dispatch at `/fn/{project}/*`,
|
|
|
manual invoke, and run logs.
|
|
|
|
|
|
-**Deferred, and the only piece of slice 1 that did not ship: `ctx.env`.** The
|
|
|
-field exists and is always empty. Nothing in the design decides where a
|
|
|
-project's secrets are stored or who may read them, and an empty env is the only
|
|
|
-answer that cannot leak one. Two independent implementations arrived at the same
|
|
|
-refusal to guess. A function therefore cannot hold a credential, which also
|
|
|
-means `ctx.fetch` can currently only reach endpoints that need none. This wants
|
|
|
-its own cycle, next to the per-project embedding key that already exists.
|
|
|
+`ctx.env` shipped after the first pass, once secrets had somewhere to live:
|
|
|
+the runner's own environment, loaded by systemd from runner.env, with the
|
|
|
+project encoded in each variable name (`SVAPI_FN_<project>__<NAME>`). A flat
|
|
|
+namespace was the thing to avoid - one runner serves every project.
|
|
|
+
|
|
|
+The runner now authenticates a shared bearer token and refuses to start
|
|
|
+unauthenticated on any address but loopback, which closes the "newly open"
|
|
|
+item below that mattered most. Packaging ships it as a third deb with its own
|
|
|
+system user, so a sandbox escape inherits none of the server's credentials.
|
|
|
|
|
|
### Resolved from "Still open"
|
|
|
|
|
|
@@ -298,10 +300,6 @@ its own cycle, next to the per-project embedding key that already exists.
|
|
|
|
|
|
### Newly open
|
|
|
|
|
|
-- **The runner has no authentication** and binds `127.0.0.1`. `RunnerPool` sends
|
|
|
- no credential, so none was invented. This needs deciding before runners ever
|
|
|
- sit on a shared network - which was the stated reason for making the runner a
|
|
|
- separate service.
|
|
|
- `listProjects()` runs on every `/fn/*` request: a database round trip on the
|
|
|
hot path, and the first thing to cache once anyone measures this.
|
|
|
- `JsLimits` is fixed at construction, unlike every other setting in this
|
|
|
@@ -309,3 +307,16 @@ its own cycle, next to the per-project embedding key that already exists.
|
|
|
- Repeated query keys (`?tag=a&tag=b`) collapse to the last value, because the
|
|
|
trigger's `query` is an object. Widening it is a protocol change on both sides.
|
|
|
- `HEAD` on `/fn/*` is unroutable: cpp-httplib has no `Server::Head` registrar.
|
|
|
+
|
|
|
+### Still open after packaging
|
|
|
+
|
|
|
+- **A QuickJS memory-safety bug is a cross-tenant compromise**, not a crashed
|
|
|
+ run: every function in a project shares one runner process and one engine
|
|
|
+ pool, and after a native escape the Principal/KeyOp mapping that separates
|
|
|
+ tenants is gone. The unit hardening bounds the blast radius; it does not make
|
|
|
+ an escape harmless. Per-project runner processes would, at a cost.
|
|
|
+- `MemoryMax=1G` is a cgroup backstop behind the in-engine limits, so if those
|
|
|
+ ever fail to fire the kernel OOM kill takes every concurrent tenant's run with
|
|
|
+ it. Bounded damage over an unbounded host, but a shared-fate failure mode.
|
|
|
+- The runner unit has not been checked with `systemd-analyze verify`; Void has
|
|
|
+ no systemd. Run it on the first Debian target.
|