Why a self-hosted PaaS shouldn't hold SSH keys
I have been designing the control plane and agent for Moonglass, a self-hosted deploy platform I am building for people who run their own servers. It is not released yet. This post is about one design choice, and the class of bugs I want it to make impossible.
Most self-hosted PaaS tools work like this: a web dashboard keeps a copy of your server's SSH key, or it sits on the host and builds shell commands on your behalf. That is a reasonable way to get from “I have a VPS” to “my app is running.” It is also a lot of power to put behind a web application.
Two incidents this fall made that trade-off feel less abstract to me.
What happened in October
On October 21, 2026, the PHP project published two critical remote code execution vulnerabilities in the language itself, tracked as CVE-2026-109618 and CVE-2026-109619, and widely discussed as PHP2Shell. They are interpreter bugs, not application logic in any one product. Any PHP installation serving web requests was in scope.
Coolify is a widely used self-hosted PaaS written in PHP. Because it runs that stack, it was affected. The Coolify team published an advisory the same day, backported patches across every v4 release line, and recommended v4.4.7. Until you could update, they told self-hosted users to stop the Coolify dashboard container, or to take the instance off the public internet and reach it over an SSH tunnel. Already deployed applications were supposed to keep running. That is a careful, responsible response, and it is also a clear picture of the cost: when the control plane is a large web runtime on the public internet, a language-level RCE becomes an emergency for every unpatched dashboard.
A few weeks earlier, on October 6, 2026, Versa Networks disclosed five vulnerabilities in Dokploy, each rated CVSS 9.9. They had been reported privately and fixed in v0.29.13 before the write-up was published. Four of the five were the same defect in different places: user-controlled input was interpolated into shell command strings and executed on the host, without validation or quoting. The fifth was a path-traversal write in certificate handling. None of them required administrator access. An authenticated organization member with a routine permission — deploy a service, restore a backup, edit a compose file, create a certificate — was enough.
I do not think this is a story about careless maintainers. Coolify and Dokploy are built by small teams, they patched quickly, and a lot of people run production workloads on them because those tools made self-hosting on a small VPS practical. The story is about what the architecture allows. If the dashboard can open an SSH session, or if it builds a shell string from form fields and runs it next to the Docker socket, then a bug in input handling is a path to the host.
The alternative I am building
Moonglass is planned around a different boundary. The design is written down in the repository. The product is still pre-alpha, and none of this is something you can install today.
The server runs a Moonglass agent that dials out to the control plane over a WebSocket. The control plane does not need an inbound port on the VPS, and it does not store an SSH key for that server. Enrollment is a one-time step on the box. After that, the dashboard talks to the agent, not to sshd.
I am not claiming that you should close SSH. Most servers still have it, and that is your choice. The point is that Moonglass does not need a key of yours, so a stolen control-plane database does not contain one.
The agent does not accept a shell string. The control plane can only send the typed messages in a public protobuf schema. A request to deploy, to stream logs, to take a backup, or to roll back is a structured message with named fields, not a command line assembled on the far side of the network. If a field is a repository URL or a backup object key, it stays a field. It never becomes part of /bin/sh -c.
Typed messages are not enough on their own. A deploy message still describes a container, and a container can be a privileged process with the host's Docker socket mounted. So the agent also checks each request against a local policy file, /etc/moonglass/agent.toml, which the control plane cannot change. Privileged containers, host namespaces, host bind mounts, added capabilities and Docker-socket mounts are refused unless that file allows them.
The control plane is also kept out of the request path. Routing, certificates, health checks, scheduled backups and automatic rollback are planned to run on the server. If the dashboard is down, or if you have taken it offline to patch it, the apps should keep serving.
Secrets, with an honest limit
The same instinct applies to secrets. The plan is that the control plane never stores a readable value. Each environment has an age key pair. Secret values and database backups are encrypted to the public half. The private half exists only as wrapped copies: one for each authorized agent, and one for the owner's recovery key, which is generated in the CLI and kept off the server. The database holds ciphertext and those wrapped copies.
A stolen backup of the control-plane database should therefore yield nothing an attacker can read. A takeover of the running control plane is a different matter, and the threat model says so. For an unprotected environment, a compromised control plane can still ask an online agent to re-wrap a key, or enroll a new server. For a protected environment, agents refuse that request. Granting access takes the recovery key, on the owner's machine, after a step-up prompt. I think that is the right split, but it is a split, not a magic property of encryption.
What this removes, and what it does not
This design is meant to remove a few bug classes by construction:
- There is no SSH private key in the dashboard to steal.
- The control plane has no API that interpolates user input into a host shell command, because it has no host shell API.
- You do not have to expose a privileged web UI to the internet in order for the agent to receive work. The agent is the one that connects.
It does not make the agent harmless. The agent still holds the Docker socket, and a bug in a typed handler is still a bug. It does not remove the need to update the agent, or to think about who is allowed to call which operation. It does not replace SSH for the work you still want to do by hand.
There is also a good design that keeps the privileged part off the web entirely. Kamal 2, which Rails 8 ships with, deploys over SSH from your own machine and hands traffic to a dedicated proxy after a health check. I like that model. It does not put SSH keys in a dashboard, because there is no dashboard. The gap I am trying to fill is the same reliability, for people who still want a UI, MCP access for a coding agent, and a restore that does not start with “SSH to the box.”
Other people have been moving toward outbound agents as well. Komodo v2, released in March 2026, added outbound connections from its Periphery agent to Komodo Core, with auto-generated key pairs. I read that as a sign that “the box dials out” is something operators actually want, not a novelty.
A question I would like help with
The part I am least sure about is workflow, not cryptography. If the dashboard cannot open a shell on the server, some habits have to move: one-off docker exec debugging, ad-hoc cleanup, the instinct to “just SSH in and fix it.” The plan is that logs, restore, rollback and disk cleanup work without a shell, and that a host shell is never in the protocol. Container exec, if it lands, would be later, CLI-only, and gated on a human with a fresh second factor.
I would like to hear from people who run one to ten servers in production. Are there cases where taking arbitrary shell access away from the dashboard actually breaks your day? I want those cases now, while the protocol is still being written, not after it ships.
I am building Moonglass in the open. If you want to follow along, there is a waitlist at moonglass.dev.