Skip to content

fix(security): stop giving the panel the container engine socket by default - #359

Merged
karutoil merged 1 commit into
mainfrom
fix/s1-7-decouple-panel-from-engine-socket
Nov 16, 2026
Merged

karutoil merged 1 commit into
mainfrom
fix/s1-7-decouple-panel-from-engine-socket

Conversation

@karutoil

Copy link
Copy Markdown
Collaborator

Closes #352.

The backend held /var/run/docker.sock unconditionally, while the only feature that needs it (in-panel self-update) defaults to disabled. A writable socket is equivalent to host root, and the backend is the most exposed process in the panel: it serves the admin API, loads plugins and renders operator-supplied data. Any code-execution primitive there therefore escalated from a panel compromise to a host compromise.

This is the S1-7 audit finding, introduced by the reporter of #352 as well.

What changed

  • Socket is opt-in. Removed from the default backend service in catalyst-docker/docker-compose.yml. Operators who want the Update button add docker-compose.auto-update.yml, which mounts the socket, enables the updater and applies the hardening the audit called for (no-new-privileges: true, cap_drop: ALL, with only CHOWN/SETUID/SETGID/DAC_OVERRIDE added back).
  • Honest degradation. The updater and the panel log export now report the deployment posture instead of surfacing a daemon connection error as if the install were broken.
  • Entrypoint tightened. The chmod o+x traversal walk no longer starts from / or /root, and only ever grants traverse, never read or list.
  • DOCKER_SOCKET_PATH is overridable and registered in the env registry (the registry test caught the omission).

Updating from the host is unchanged and needs no privilege change.

Verification

  • Backend lint, typecheck, build: clean.
  • Full backend suite: 11,446 passed, 1 skipped.
  • New tests fail without the service changes, confirmed by reverting them.
  • podman-compose config on the merged and base stacks: mount, cap_drop and no-new-privileges present in the merge; base file has zero socket occurrences.
  • Entrypoint block exercised in both states against a real unix socket: /root stays 0700, nested path gets o+x only.
  • openapi:check, i18n:hardcoded, frontend tsc, shellcheck on both scripts: clean.

…efault

Closes the S1-7 audit finding, also raised as issue #352. A writable
/var/run/docker.sock is equivalent to host root: whoever can talk to it
can run a privileged container with the host filesystem mounted. The
backend serves the admin API, loads plugins and renders operator data,
so any code-execution primitive there escalated from a panel compromise
to a host compromise. The mount was unconditional even though the only
feature that needs it, in-panel self-update, is disabled by default.

The default deployment no longer mounts the socket. Operators who want
the Update button opt in with docker-compose.auto-update.yml, which
mounts the socket, enables the updater and applies the hardening the
audit asked for (no-new-privileges, cap_drop ALL with only CHOWN/SETUID/
SETGID/DAC_OVERRIDE added back). Updating from the host keeps working
and needs no privilege change.

Both consumers now report the deployment posture instead of a confusing
daemon error:

- auto-updater refuses with an explanation when the socket is absent and
  points at the override, rather than blaming the CLI or compose file.
- panel log export distinguishes "socket not mounted, intentional" from
  "no container runtime found" in its existing unavailable fallback.

Also tightens the entrypoint: the traversal walk no longer starts from /
or /root, so a bad compose path cannot open the filesystem root, and it
only ever grants o+x, never read or list. The socket path is overridable
via DOCKER_SOCKET_PATH, registered in the env registry.

Tests fail without the service changes: the updater gate and the log
export posture. Verified the merge with podman-compose config (mount,
cap_drop and no-new-privileges present; base file has zero socket
occurrences) and exercised the entrypoint block in both states against a
real unix socket.
@catalystctl catalystctl deleted a comment from pullfrog Bot Nov 16, 2026
@karutoil
karutoil merged commit 9e7ff78 into main Nov 16, 2026
14 of 17 checks passed
@karutoil
karutoil deleted the fix/s1-7-decouple-panel-from-engine-socket branch November 16, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title: Reconsider native installation support and Docker coupling

1 participant