Repository navigation
fix(security): stop giving the panel the container engine socket by default - #359
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #352.
The backend held
/var/run/docker.sockunconditionally, 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
catalyst-docker/docker-compose.yml. Operators who want the Update button adddocker-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 onlyCHOWN/SETUID/SETGID/DAC_OVERRIDEadded back).chmod o+xtraversal walk no longer starts from/or/root, and only ever grants traverse, never read or list.DOCKER_SOCKET_PATHis 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
podman-compose configon the merged and base stacks: mount,cap_dropandno-new-privilegespresent in the merge; base file has zero socket occurrences./rootstays0700, nested path getso+xonly.openapi:check,i18n:hardcoded, frontendtsc, shellcheck on both scripts: clean.