Run the app as an unprivileged user and sign file links #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The app container ran everything as root, and workspace download links
put the access token in the URL, where it could end up in logs, browser
history and Referer headers.
A new entrypoint (scripts/docker-entrypoint.sh) starts as root only to
hand /data to the app user (uid 1000, or LUMINA_UID/LUMINA_GID), then
setprivs to it before starting tini, so nothing in the container stays
root. Compose adds no-new-privileges. dind's client key is 0644, so the
app can still reach the daemon.
Root never walks the workspace on a normal start: a sandbox could swap
a directory for a symlink mid-walk and redirect the chown. It does so
once, on the first start after an upgrade. Shell commands now run as
the app's uid so the file tools can edit what they write; a new
as_rootflag covers package installs, and root-owned files in/workspace are handed back from inside the sandbox (where symlinks only
reach the sandbox's own files) when a sandbox is created and after each
as_root command. When the app itself runs as root, nothing changes.
The API no longer accepts the token as a query parameter. Images and
links use URLs from POST /api/workspace/links: HMAC-signed for one path,
expiring after 60-70 minutes (rounded so the browser can cache them),
with a key derived from the token so changing it revokes every link.
The UI's useFileUrl() batches, caches and refreshes them.
The smoke test's MCP check had hung since tool approvals made MCP tools
ask by default; it now allows its test server. It also checks the app
runs as uid 1000, that as_root files stay editable, and that a
root-owned volume is handed over on restart.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com