<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Samuel Mbabhazi</title>
    <description>The latest articles on DEV Community by Samuel Mbabhazi (@samuelmbabhazi).</description>
    <link>https://dev.to/samuelmbabhazi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F941522%2F43d79209-3fb8-4068-93b9-be55c162272e.jpg</url>
      <title>DEV Community: Samuel Mbabhazi</title>
      <link>https://dev.to/samuelmbabhazi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samuelmbabhazi"/>
    <language>en</language>
    <item>
      <title>My self-hosted PaaS reached beta. Here's what my lab can't test.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Thu, 03 Dec 2026 14:13:46 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/my-self-hosted-paas-reached-beta-heres-what-my-lab-cant-test-14mk</link>
      <guid>https://dev.to/samuelmbabhazi/my-self-hosted-paas-reached-beta-heres-what-my-lab-cant-test-14mk</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on servers you own: push to deploy, automatic HTTPS, rollbacks, secrets, logs and metrics, without Kubernetes. Its first beta, &lt;code&gt;v0.1.0-beta.2&lt;/code&gt;, came out this week.&lt;/p&gt;

&lt;p&gt;Everything in it has run end to end in my lab. Everything in my lab is Ubuntu 24.04 in containers, on one machine. That is the gap I can't close alone, and it's where you come in.&lt;/p&gt;

&lt;p&gt;If you only have ten seconds: &lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;a star on GitHub&lt;/a&gt; helps people who run their own servers find the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the beta does
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deploy&lt;/strong&gt; a container image, or a GitHub repository on every push.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build&lt;/strong&gt; on the application's own server, from a Dockerfile or with Railpack or Nixpacks, in a rootless BuildKit. The build output and the release command's output stream live to the browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run&lt;/strong&gt; behind Caddy with automatic HTTPS, with rollbacks, secrets, logs, metrics and a terminal into a container.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Back up&lt;/strong&gt; the whole control plane, encrypted, to a file or to S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drive it&lt;/strong&gt; from a web UI or a CLI. A server joins with one command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What makes it different: the control plane holds no SSH key. Each server runs an agent that connects out over mTLS and runs only a closed list of typed actions, and no shell command is ever built from a string.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the lab checked before the release
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every signature:&lt;/strong&gt; the bundle, the checksums, the agents and the image, plus the build provenance of the bundle and the agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An upgrade&lt;/strong&gt; from the previous prerelease, on a control plane with a separate server running an application. The application answered before, during and after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A new single machine&lt;/strong&gt;, with the control plane and the applications on the same server. It started its builder, and an application deployed on it answered through its Caddy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What my lab can't check
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. A real VM, with Ubuntu's defaults
&lt;/h3&gt;

&lt;p&gt;Ubuntu 24.04 restricts unprivileged user namespaces through AppArmor (&lt;code&gt;kernel.apparmor_restrict_unprivileged_userns&lt;/code&gt;). Rootless BuildKit relies on &lt;code&gt;rootlesskit&lt;/code&gt;'s AppArmor profile to work under that restriction. My lab hosts don't have it, so no build has ever run under it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do:&lt;/strong&gt; take a disposable Ubuntu 24.04 VM, x86_64 or arm64, at any provider or at home. Install a server with the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt;, deploy a repository that needs a build, and tell us whether the build ran.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The real GitHub
&lt;/h3&gt;

&lt;p&gt;Each organization creates its own GitHub App from Shipkeep's web UI, through GitHub's manifest flow. That flow and its webhooks were tested against a stand-in for GitHub's API, never against github.com.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do:&lt;/strong&gt; on an installation with a public domain name, create the GitHub App, connect a throwaway repository and push to it. Then change a setting in the UI, and check the commit or pull request Shipkeep sends back to the repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Your provider, and a reboot
&lt;/h3&gt;

&lt;p&gt;Provider firewalls, IPv6, a real DNS name and a public certificate: none of it exists in a lab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do:&lt;/strong&gt; install with a domain name, deploy an application, reboot the server, and deploy again.&lt;/p&gt;

&lt;p&gt;For any of the three, &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/new?template=bug.yml" rel="noopener noreferrer"&gt;open an issue&lt;/a&gt; saying what you ran and what you saw. "It worked, on this provider and this architecture" is a useful report too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four first issues, one evening each
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/shipkeepdev/shipkeep/issues/141" rel="noopener noreferrer"&gt;#141&lt;/a&gt;: declare the &lt;code&gt;X-Shipkeep-Truncated&lt;/code&gt; header of the audit export in the OpenAPI document. One decorator, then regenerate the API client.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/shipkeepdev/shipkeep/issues/144" rel="noopener noreferrer"&gt;#144&lt;/a&gt;: a typed helper in the API client that parses the audit export's JSON Lines, with its tests.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/shipkeepdev/shipkeep/issues/143" rel="noopener noreferrer"&gt;#143&lt;/a&gt;: a test that fails when a destructive action is missing from the spec's list of actions that need a confirmation.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/shipkeepdev/shipkeep/issues/212" rel="noopener noreferrer"&gt;#212&lt;/a&gt;: three integration tests that accept PostgreSQL 18's error code as well as 17's, while still checking that the deletion is refused.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each issue says what to change and how you'll know it's done. Comment on it first, so two people don't do the same work.&lt;/p&gt;

&lt;h2&gt;
  
  
  How contributing works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Async, in writing, in English.&lt;/strong&gt; Everything happens on GitHub. There are no meetings, and your English doesn't need to be perfect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apache-2.0, with a DCO.&lt;/strong&gt; Sign off your commits with &lt;code&gt;git commit -s&lt;/code&gt;. There is no CLA.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outside contributions get merged.&lt;/strong&gt; Four so far, two of them last week from first-time contributors: a placement explanation in the scheduler, and CLI identifiers on the environment page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reviews stick to what matters:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;architecture rules&lt;/a&gt; and the tests. We fix small style details ourselves after merging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What comes next
&lt;/h2&gt;

&lt;p&gt;A private network between servers, over WireGuard: an address for each server, a firewall closed by default, and a mesh that keeps working while the control plane is down. It is in review now, one pull request at a time. The &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/PLAN.md" rel="noopener noreferrer"&gt;roadmap&lt;/a&gt; has the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to start
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Star&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;repository&lt;/a&gt;, so the next person finds it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install it&lt;/strong&gt; on a real machine, then &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/new?template=bug.yml" rel="noopener noreferrer"&gt;tell us how it went&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write code:&lt;/strong&gt; take a &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Say hello&lt;/strong&gt; in &lt;a href="https://github.com/shipkeepdev/shipkeep/discussions" rel="noopener noreferrer"&gt;Discussions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: what would you deploy first on a server of your own, and where does it run today?&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>selfhosted</category>
      <category>devops</category>
      <category>contributorswanted</category>
    </item>
    <item>
      <title>I sandboxed my builds. A Dockerfile could still pick the program that reads it.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Thu, 03 Dec 2026 14:08:13 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/i-sandboxed-my-builds-a-dockerfile-could-still-pick-the-program-that-reads-it-5fao</link>
      <guid>https://dev.to/samuelmbabhazi/i-sandboxed-my-builds-a-dockerfile-could-still-pick-the-program-that-reads-it-5fao</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. Since last week it also builds them: push to a Git repository, and the server that runs the application builds its image, from a Dockerfile or with Railpack or Nixpacks.&lt;/p&gt;

&lt;p&gt;That means running a repository's build on a machine that also runs other applications, and on a single machine, the control plane itself. The repository is untrusted input, and so is everything in it.&lt;/p&gt;

&lt;p&gt;I planned the sandbox around one question: what can a build reach on the host? Rootless BuildKit, its own account, its own network rule. Then an audit asked a different question, about one line I had not thought of: who decides which program reads the Dockerfile?&lt;/p&gt;

&lt;h2&gt;
  
  
  The sandbox
&lt;/h2&gt;

&lt;p&gt;The server installer sets up a builder that has nothing to do with Docker:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BuildKit v0.35.1, rootless&lt;/strong&gt;, run by &lt;code&gt;rootlesskit&lt;/code&gt; as its own account, &lt;code&gt;shipkeep-build&lt;/code&gt;. That account is in no group that reaches Docker. Its socket can be used by the agent's account and nothing else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Its own user namespace&lt;/strong&gt;, with 65536 subordinate ids placed after every range already given. Ubuntu's cloud images give 100000–165535 to the &lt;code&gt;ubuntu&lt;/code&gt; account, which I found in the lab.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Its own resources:&lt;/strong&gt; a systemd slice capped at half the memory, and an OOM score that makes it the kernel's first choice when memory runs out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Its own network rule&lt;/strong&gt;, an nftables chain matched on the account's uid. A build reaches the internet, the name servers on port 53, and the server's own Caddy on 443, which a single machine needs to push to its registry. Everything else on the server and its private networks is refused.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the lab, a build reached the internet over plain HTTP. It did not reach &lt;code&gt;169.254.169.254&lt;/code&gt;, a private registry, or the server's own SSH port. BuildKit's own push to a private registry failed the same way: &lt;code&gt;dial tcp 192.168.64.3:5000: i/o timeout&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a Dockerfile can ask for
&lt;/h2&gt;

&lt;p&gt;A Dockerfile can ask BuildKit for more than the defaults. Three requests matter here, and CI now builds each of them on every pull request, against a real BuildKit:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dockerfile step&lt;/th&gt;
&lt;th&gt;BuildKit's answer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RUN --network=host&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;network.host is not allowed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RUN --security=insecure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;security.insecure is not allowed&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RUN --mount=type=bind,source=/var/run/docker.sock&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"/var/run/docker.sock": not found&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first two are entitlements, and the agent asks for none. The third one never reaches the host at all: a bind mount reads from the build's context, the repository, never from the server.&lt;/p&gt;

&lt;p&gt;Each step would print &lt;code&gt;reached the host&lt;/code&gt; if it ran, and the test checks that the phrase never appears. The words are split in the command, &lt;code&gt;echo "reached" "the host"&lt;/code&gt;, so BuildKit's echo of the command line cannot produce the phrase by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The line I had not thought of
&lt;/h2&gt;

&lt;p&gt;A Dockerfile can start with a comment like this one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# syntax=docker/dockerfile:1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It names an image, a frontend, and BuildKit runs it to interpret the rest of the file. Most people write that line to get the latest Dockerfile features. Nothing requires the image to be Docker's.&lt;/p&gt;

&lt;p&gt;The frontend runs inside BuildKit with the build's session. That session is where the build gets its secrets, such as the short-lived token that fetched the repository, and the credentials to push the image. A repository that names its own frontend chooses the program that sees those.&lt;/p&gt;

&lt;p&gt;The audit pointed at two ways in. The &lt;code&gt;# syntax=&lt;/code&gt; line itself, which BuildKit honors by default. And &lt;code&gt;BUILDKIT_SYNTAX&lt;/code&gt;, a build argument with the same effect: a repository could set it in its &lt;code&gt;shipkeep.yml&lt;/code&gt;. On the Nixpacks path, the agent removed &lt;code&gt;BUILDKIT_*&lt;/code&gt; names from the arguments it generated, then merged the repository's explicit arguments back in after that filter.&lt;/p&gt;

&lt;p&gt;The audit was careful about its limits. It showed that the setting was accepted and reached BuildKit. It did not run a hostile frontend, and it did not take any credential.&lt;/p&gt;

&lt;p&gt;There was already one mitigation: the Git token reaches BuildKit as a session secret under a random name. The issue asked for a fix that would not depend on that name staying hidden.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two fixes, one rule
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reserved arguments are refused.&lt;/strong&gt; The API rejects any build argument whose name starts with &lt;code&gt;BUILDKIT_&lt;/code&gt;, with a &lt;code&gt;reserved_build_arg&lt;/code&gt; error, before anything is deployed. The agent refuses them too, whatever the control plane sends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The builder only runs two frontends.&lt;/strong&gt; The installer writes them into BuildKit's own configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[frontend."dockerfile.v0"]&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="k"&gt;[frontend."gateway.v0"]&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;allowedRepositories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"docker.io/docker/dockerfile"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ghcr.io/railwayapp/railpack-frontend"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;# syntax=docker/dockerfile:1&lt;/code&gt; keeps working. Railpack's frontend, which the agent pins by digest, keeps working. Any other &lt;code&gt;# syntax=&lt;/code&gt; fails the build with BuildKit's own message: &lt;code&gt;… is not an allowed gateway source&lt;/code&gt;. An untrusted frontend never runs at all.&lt;/p&gt;

&lt;p&gt;CI's BuildKit reads these sections from the installer itself, so the tests run under the policy the servers get. A test Dockerfile that names &lt;code&gt;ghcr.io/shipkeepdev/not-a-frontend:1&lt;/code&gt; is refused there, on every pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  One more name a build could compute
&lt;/h2&gt;

&lt;p&gt;A review of the same build code found a smaller cousin of this problem. Build caches were isolated per application, by a namespace computed from the application's registry repository with a plain hash. A build that knew another application's identifiers could compute that name and write into its cache.&lt;/p&gt;

&lt;p&gt;The namespace is now an HMAC of the repository, under a 32-byte key that only the agent holds. Dockerfile builds had no namespace at all before; they have one now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What runs on every pull request
&lt;/h2&gt;

&lt;p&gt;Besides the hostile Dockerfiles, CI builds a Python, a Go and a PHP application, each with Railpack and with Nixpacks, from the commit under test, and checks that the registry holds each pushed digest. In a local run from a cold cache, the six builds took 3 min 36 s in parallel. Node, and a plain Dockerfile, are covered by other tests.&lt;/p&gt;

&lt;p&gt;Two things remain open:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ubuntu's restriction on unprivileged user namespaces&lt;/strong&gt; (&lt;code&gt;kernel.apparmor_restrict_unprivileged_userns&lt;/code&gt;). The lab hosts do not have it, so &lt;code&gt;rootlesskit&lt;/code&gt;'s AppArmor profile still has to be checked on a real Ubuntu 24.04 VM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upstream images by tag.&lt;/strong&gt; The builder and runtime images that the pinned Railpack and Nixpacks versions build from are referenced by tag upstream.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I take from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"What can the build reach?" was the wrong first question.&lt;/strong&gt; The better one is "who interprets the build?". It came from reading the input format, not the sandbox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn off what you don't use, in the component that enforces it.&lt;/strong&gt; Filtering arguments in the agent had a gap. BuildKit's own allowlist applies however the frontend is named.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A test that proves a refusal needs a phrase the refusal cannot print.&lt;/strong&gt; Otherwise the error message itself can make it pass.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Merged as &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/536" rel="noopener noreferrer"&gt;#536&lt;/a&gt;, &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/542" rel="noopener noreferrer"&gt;#542&lt;/a&gt;, &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/551" rel="noopener noreferrer"&gt;#551&lt;/a&gt; and &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/561" rel="noopener noreferrer"&gt;#561&lt;/a&gt;, and shipped in &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-beta.2" rel="noopener noreferrer"&gt;v0.1.0-beta.2&lt;/a&gt;. A server installed earlier gets the frontend policy with &lt;code&gt;install.sh --migrate yes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The design is in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/adr/0030-builds-and-registry-without-a-private-network.md" rel="noopener noreferrer"&gt;ADR 0030&lt;/a&gt;. The spec keeps an open question: should other frontends be allowed one day, and with which session capabilities?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM with the default AppArmor settings:&lt;/strong&gt; install a server and run a build. That is the one check the lab cannot do.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You know BuildKit's session or gateway API well:&lt;/strong&gt; read &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/deploy/install.sh" rel="noopener noreferrer"&gt;the builder's configuration in the installer&lt;/a&gt; and tell me what a frontend I allowed could still reach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: do the builders you use let a Dockerfile's &lt;code&gt;# syntax=&lt;/code&gt; line pick any image?&lt;/p&gt;

</description>
      <category>docker</category>
      <category>security</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>docker compose up -d left PostgreSQL holding dead sessions for two hours</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Thu, 03 Dec 2026 14:06:27 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/docker-compose-up-d-left-postgresql-holding-dead-sessions-for-two-hours-3lm2</link>
      <guid>https://dev.to/samuelmbabhazi/docker-compose-up-d-left-postgresql-holding-dead-sessions-for-two-hours-3lm2</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. Its control plane is one Docker Compose project: the control plane itself, PostgreSQL, Caddy and a few services around them. Upgrading it is the usual routine: set the new image, &lt;code&gt;docker compose pull&lt;/code&gt;, &lt;code&gt;docker compose up -d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In the lab, after one such upgrade, a restore failed at its very last step, the rename of the restored database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;database "shipkeep" is being accessed by other users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing should have been using it. The old control plane was gone, and the restore had stopped the new one. Yet PostgreSQL listed three sessions of the application's role, one of them the job queue's. All three were idle, and all three came from an address that no container had any more.&lt;/p&gt;

&lt;p&gt;Left alone, they would have stayed about two hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  A container that only holds the network
&lt;/h2&gt;

&lt;p&gt;The control plane and Caddy have no network namespace of their own. Both join the namespace of a small container called &lt;code&gt;net&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;net&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;*shipkeep&lt;/span&gt;   &lt;span class="c1"&gt;# the Shipkeep image, like the control plane
&lt;/span&gt;  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'node'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'-e'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'setInterval(() =&amp;gt; {}, 2147483647)'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'80:80'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'443:443'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'443:443/udp'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'7443:7443'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;control-plane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;network_mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service:net&lt;/span&gt;

&lt;span class="na"&gt;caddy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;network_mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service:net&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;net&lt;/code&gt; does nothing but hold the namespace and the published ports. A container that joins another one's namespace loses it when that one restarts. With a third container holding it, the control plane and Caddy can each restart, or crash, without cutting the other off.&lt;/p&gt;

&lt;p&gt;But &lt;code&gt;net&lt;/code&gt; runs the Shipkeep image. A new &lt;code&gt;SHIPKEEP_IMAGE&lt;/code&gt; changes it too, so &lt;code&gt;up -d&lt;/code&gt; recreates it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens during &lt;code&gt;up -d&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Compose recreates &lt;code&gt;net&lt;/code&gt; first, because the control plane depends on it. The old control plane is still running at that moment, in a namespace that has just lost the interface &lt;code&gt;net&lt;/code&gt; brought. When it stops a moment later, its process closes its connections properly. The kernel tries to send each FIN, and has nowhere to send it.&lt;/p&gt;

&lt;p&gt;PostgreSQL never hears anything. To the server, an idle session whose client has vanished looks exactly like an idle session that is fine.&lt;/p&gt;

&lt;p&gt;The clean fix would be to stop the old control plane while it still has its network. I watched Docker's events during &lt;code&gt;up -d&lt;/code&gt;: &lt;code&gt;net&lt;/code&gt; is killed, stopped and destroyed before the old control plane is touched. Compose handles the dependency first, and I found no way to change that order from the compose file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Only the server can notice
&lt;/h2&gt;

&lt;p&gt;The client is gone, so the only side left to notice is PostgreSQL. TCP keepalives exist for exactly this, and PostgreSQL can turn them on for its own sockets. Their defaults explain the two hours: Linux waits 7200 seconds of silence before the first probe.&lt;/p&gt;

&lt;p&gt;The fix is three settings on the &lt;code&gt;postgres&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tcp_keepalives_idle=60&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tcp_keepalives_interval=10&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tcp_keepalives_count=6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After 60 seconds of silence, PostgreSQL sends a probe. Six probes without an answer, 10 seconds apart, end the session. A half-open session now lasts at most 60 + 6 × 10 = 120 seconds. A healthy idle connection answers each probe and is not affected.&lt;/p&gt;

&lt;p&gt;PostgreSQL also has &lt;code&gt;idle_session_timeout&lt;/code&gt;, but it ends every idle session, healthy ones in the control plane's connection pool included. Keepalives only end a session whose other end no longer answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lab
&lt;/h2&gt;

&lt;p&gt;A small Compose project reproduces the mechanism without the rest of Shipkeep, on Docker 29 and Compose 2.40:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PostgreSQL 17, the image the control plane pins;&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;net&lt;/code&gt; container;&lt;/li&gt;
&lt;li&gt;a client in &lt;code&gt;net&lt;/code&gt;'s namespace (&lt;code&gt;network_mode: service:net&lt;/code&gt;), holding an idle &lt;code&gt;psql&lt;/code&gt; session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "upgrade" changes an environment variable on &lt;code&gt;net&lt;/code&gt; and on the client, as a new image does, then runs &lt;code&gt;up -d&lt;/code&gt;. &lt;code&gt;pg_stat_activity&lt;/code&gt; tells which sessions are left.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Keepalives&lt;/th&gt;
&lt;th&gt;Right after &lt;code&gt;up -d&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;Later&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;none (Linux default, 7200 s)&lt;/td&gt;
&lt;td&gt;old and new session&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;old one still there after 120 s&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60 / 10 / 6&lt;/td&gt;
&lt;td&gt;old and new session&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;old one gone after 49 s&lt;/strong&gt;, new one kept&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Why 49 seconds and not 120? In that run, the new &lt;code&gt;net&lt;/code&gt; got the old one's address. The first probe reached a namespace that knew nothing of that connection, which answered with a reset, and the session ended at once. The session had been idle since before &lt;code&gt;up -d&lt;/code&gt;, so that first probe came less than 60 seconds after the upgrade. When the address differs, nothing answers at all, and the session ends at the bound: 120 seconds.&lt;/p&gt;

&lt;p&gt;Then the real compose file. &lt;code&gt;docker compose config&lt;/code&gt; shows the command, and the &lt;code&gt;postgres&lt;/code&gt; service started from it is healthy and reports 60, 10 and 6. Check those over TCP: on a Unix socket, PostgreSQL ignores these settings and reports 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  The case keepalives do not cover
&lt;/h2&gt;

&lt;p&gt;The fix went to review, and the reviewer, CodeRabbit, found the hole in my two minutes: Linux sends no keepalive probe while data is waiting to be acknowledged.&lt;/p&gt;

&lt;p&gt;If the namespace disappears while PostgreSQL is in the middle of sending a result, retransmissions govern the connection, not keepalives. With the default &lt;code&gt;tcp_retries2&lt;/code&gt; of 15, that takes about 15 minutes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tcp_user_timeout&lt;/code&gt; covers that case: the connection closes when transmitted data stays unacknowledged for that long. One more setting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;-c&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;tcp_user_timeout=120000&lt;/span&gt;   &lt;span class="c1"&gt;# milliseconds
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I checked that the pinned PostgreSQL 17 image applies all four: over a TCP session, &lt;code&gt;pg_settings&lt;/code&gt; shows 120000 ms, and the keepalives at 60, 10 and 6. I did not reproduce the in-flight case in the lab. That bound rests on the kernel's documented behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A connection that ends without a FIN is invisible to the server.&lt;/strong&gt; When a client can lose its network before its process exits, as in a shared namespace, the server needs its own way to find out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The defaults are measured in hours.&lt;/strong&gt; 7200 seconds is fine for a database whose clients rarely vanish. Here they vanished at every upgrade.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keepalives cover the idle case only.&lt;/strong&gt; A connection with data in flight needs &lt;code&gt;tcp_user_timeout&lt;/code&gt; as well.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The restore only revealed it.&lt;/strong&gt; The leftover sessions also held connection slots after every upgrade, which no test was looking at.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Merged as &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/564" rel="noopener noreferrer"&gt;#564&lt;/a&gt;, closing &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/429" rel="noopener noreferrer"&gt;#429&lt;/a&gt;, and shipped in &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-beta.2" rel="noopener noreferrer"&gt;v0.1.0-beta.2&lt;/a&gt;. Moving to it recreates the &lt;code&gt;postgres&lt;/code&gt; container once, since its command changed. &lt;code&gt;up -d&lt;/code&gt; restarts the control plane at the same time anyway.&lt;/li&gt;
&lt;li&gt;The restore no longer depends on it: it ends any session left on the database before the rename, since the control plane is stopped at that point.&lt;/li&gt;
&lt;li&gt;The &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; says, under "Upgrade", why old sessions can stay open for up to two minutes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You run PostgreSQL behind Docker, Compose or Kubernetes:&lt;/strong&gt; have you seen half-open sessions pile up after deploys, and what settings did you choose?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You know Compose's recreate order better than I do:&lt;/strong&gt; is there a way to stop a service before the container whose namespace it shares is recreated?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: what does &lt;code&gt;SHOW tcp_keepalives_idle;&lt;/code&gt; return on your production database, over TCP?&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>docker</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>Looking for contributors worldwide: an open-source PaaS for your own servers (Go, TypeScript, Angular, DevOps)</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Sun, 29 Nov 2026 20:57:14 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/-117g</link>
      <guid>https://dev.to/samuelmbabhazi/-117g</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5" class="crayons-story__hidden-navigation-link"&gt;Looking for contributors worldwide: an open-source PaaS for your own servers (Go, TypeScript, Angular, DevOps)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/samuelmbabhazi" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F941522%2F43d79209-3fb8-4068-93b9-be55c162272e.jpg" alt="samuelmbabhazi profile" class="crayons-avatar__image" width="800" height="723"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/samuelmbabhazi" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Samuel Mbabhazi
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Samuel Mbabhazi
                
                
              
              &lt;div id="story-author-preview-content-5139141" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/samuelmbabhazi" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F941522%2F43d79209-3fb8-4068-93b9-be55c162272e.jpg" class="crayons-avatar__image" alt="" width="800" height="723"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Samuel Mbabhazi&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 28&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5" id="article-link-5139141"&gt;
          Looking for contributors worldwide: an open-source PaaS for your own servers (Go, TypeScript, Angular, DevOps)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/go"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;go&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/typescript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;typescript&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
          
          &lt;div class="only-sidebar-menu-item trusted-visible-block print-hidden align-center"&gt;
                
                    
                
          &lt;/div&gt;

        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;/div&gt;


</description>
      <category>go</category>
      <category>opensource</category>
      <category>typescript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Looking for contributors worldwide: an open-source PaaS for your own servers (Go, TypeScript, Angular, DevOps)</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Sat, 28 Nov 2026 12:56:36 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5</link>
      <guid>https://dev.to/samuelmbabhazi/looking-for-contributors-worldwide-an-open-source-paas-for-your-own-servers-go-typescript-43f5</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on servers you own: push to deploy, automatic HTTPS, rollbacks, secrets, logs and metrics, all without Kubernetes. It is built in the open under Apache-2.0, and I'm looking for people to build it with me, wherever you are.&lt;/p&gt;

&lt;p&gt;If you only have ten seconds, &lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;a star on GitHub&lt;/a&gt; helps people who run their own servers find the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes it different
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No SSH key in the control plane.&lt;/strong&gt; An agent on each server connects out over mTLS and runs only a closed list of typed actions. No shell command is ever built from a string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration in your repository.&lt;/strong&gt; Each application is described by a versioned &lt;code&gt;shipkeep.yml&lt;/code&gt;. The UI writes its changes back to that file, as a commit or a pull request, instead of hiding them in a database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Several servers, without Kubernetes.&lt;/strong&gt; You run one control plane, plus an agent, Docker and Caddy on each server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe by default.&lt;/strong&gt; Anything destructive asks for an explicit confirmation, and every change lands in an audit log.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;p&gt;The current prerelease is &lt;code&gt;v0.1.0-alpha.7&lt;/code&gt;. It installs with one command and deploys an image with HTTPS, rollback, secrets, logs and metrics, from the web UI or the CLI.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;main&lt;/code&gt; adds deployment from Git on every push. The build runs on the application's own server, from a Dockerfile or with Railpack or Nixpacks.&lt;/p&gt;

&lt;p&gt;The first stable version is in progress, and &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/413" rel="noopener noreferrer"&gt;its scope is public&lt;/a&gt;. It runs end to end in our test lab. The next step is real servers at real providers, and that is where help matters most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who we're looking for
&lt;/h2&gt;

&lt;h3&gt;
  
  
  DevOps engineers, sysadmins and SREs
&lt;/h3&gt;

&lt;p&gt;Do you have a spare Ubuntu 24.04 machine, x86_64 or arm64, at a provider or at home, and a domain name? Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Shipkeep with the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Deploy an app, reboot the server, and deploy again.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/shipkeepdev/shipkeep/issues/new?template=bug.yml" rel="noopener noreferrer"&gt;Open an issue&lt;/a&gt; saying what you ran and what you saw.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You'll be among the first to run it on your provider, and your report shapes the first stable version.&lt;/p&gt;

&lt;p&gt;If you know one layer well, read the part that uses it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the systemd units and nftables rules in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/deploy/install.sh" rel="noopener noreferrer"&gt;&lt;code&gt;deploy/install.sh&lt;/code&gt;&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;rootless BuildKit;&lt;/li&gt;
&lt;li&gt;Caddy's admin API;&lt;/li&gt;
&lt;li&gt;the Docker Engine API.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Go developers
&lt;/h3&gt;

&lt;p&gt;The agent is a single static binary on each server. It connects out to the control plane and runs typed actions. Each action is journaled before it runs, so the agent picks up where it left off after a restart. Every action is tested with malicious input: path traversal, injection characters, oversized values. The CLI is in Go too.&lt;/p&gt;

&lt;p&gt;There are &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Aagent" rel="noopener noreferrer"&gt;21 open issues on the agent track&lt;/a&gt;. One of them is &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/18" rel="noopener noreferrer"&gt;self-reconciliation&lt;/a&gt;: when a container is killed, it comes back and routing keeps serving, even while the control plane is down.&lt;/p&gt;

&lt;h3&gt;
  
  
  TypeScript developers
&lt;/h3&gt;

&lt;p&gt;The control plane is NestJS and Prisma on PostgreSQL. Domain code is pure. Tenant data is filtered twice: in each repository, and again by PostgreSQL row-level security. Every state change writes an audit event.&lt;/p&gt;

&lt;p&gt;There are &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Acontrol-plane" rel="noopener noreferrer"&gt;42 open issues on the control plane track&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Angular developers and designers
&lt;/h3&gt;

&lt;p&gt;The web UI uses Angular with standalone components and signals, under a strict Content Security Policy. There are &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Aweb" rel="noopener noreferrer"&gt;24 open issues on the web track&lt;/a&gt;. The one marked help wanted is the &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/265" rel="noopener noreferrer"&gt;deployment detail page with its full log&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you design rather than code, pick a screen and propose a better one. The design system is in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/apps/web/DESIGN.md" rel="noopener noreferrer"&gt;&lt;code&gt;apps/web/DESIGN.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security researchers
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/THREAT_MODEL.md" rel="noopener noreferrer"&gt;threat model&lt;/a&gt; lists each threat, how it is mitigated and how that is tested. Every review so far has made Shipkeep stronger, so tell us where it's wrong.&lt;/p&gt;

&lt;p&gt;To report a vulnerability, use GitHub's private reporting, as &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/SECURITY.md" rel="noopener noreferrer"&gt;SECURITY.md&lt;/a&gt; explains.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical writers
&lt;/h3&gt;

&lt;p&gt;A &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/246" rel="noopener noreferrer"&gt;documentation site&lt;/a&gt; is part of the first stable version. The simplest review helps too: follow the installation guide from the top, and mark every place where you had to guess.&lt;/p&gt;

&lt;h3&gt;
  
  
  Translators
&lt;/h3&gt;

&lt;p&gt;The interface is in English and French. If you want to bring your language, open a discussion, and we'll add it to the language switch together.&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility testers
&lt;/h3&gt;

&lt;p&gt;The browser tests run automated WCAG checks. A person testing with a keyboard and a screen reader finds what those checks miss.&lt;/p&gt;

&lt;h3&gt;
  
  
  Future users
&lt;/h3&gt;

&lt;p&gt;Tell us what you would deploy with Shipkeep and what you'd need first, in &lt;a href="https://github.com/shipkeepdev/shipkeep/discussions/categories/ideas" rel="noopener noreferrer"&gt;Ideas&lt;/a&gt; or &lt;a href="https://github.com/shipkeepdev/shipkeep/discussions/categories/q-a" rel="noopener noreferrer"&gt;Q&amp;amp;A&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  From anywhere in the world
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Async, in writing.&lt;/strong&gt; Everything happens on GitHub, in writing. There are no meetings, so any time zone works.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In English.&lt;/strong&gt; Code, issues and discussions are in English, and yours doesn't need to be perfect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outside contributions are already merged.&lt;/strong&gt; There are three so far: a retry for the installer's Docker downloads, a shared test helper, and a web UI feature merged the day it was opened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open licence.&lt;/strong&gt; Apache-2.0. Sign off your commits with &lt;code&gt;git commit -s&lt;/code&gt; (DCO). There is no CLA.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A clear first step.&lt;/strong&gt; Each &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt; says what to change and how you'll know it's done. Comment on the issue first, so we agree on the approach.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focused reviews.&lt;/strong&gt; Reviews stick to what matters: the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;architecture rules&lt;/a&gt; and the tests. We fix small style details ourselves after merging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where to start
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Star&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;repository&lt;/a&gt;, so the next person finds it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install it&lt;/strong&gt; with the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;guide&lt;/a&gt;, then &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/new?template=bug.yml" rel="noopener noreferrer"&gt;tell us how it went&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write code:&lt;/strong&gt; take a &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt;, or pick a track: &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Aagent" rel="noopener noreferrer"&gt;agent&lt;/a&gt;, &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Acontrol-plane" rel="noopener noreferrer"&gt;control plane&lt;/a&gt; or &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/track%3Aweb" rel="noopener noreferrer"&gt;web&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Say hello&lt;/strong&gt; in &lt;a href="https://github.com/shipkeepdev/shipkeep/discussions" rel="noopener noreferrer"&gt;Discussions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: which provider, or which homelab box, would you try it on first?&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>devops</category>
      <category>go</category>
      <category>typescript</category>
    </item>
    <item>
      <title>I reserved a disk for builds. The first build still took 4.9 GB from the server.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Sat, 28 Nov 2026 12:43:12 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/i-reserved-a-disk-for-builds-the-first-build-still-took-49-gb-from-the-server-5cfk</link>
      <guid>https://dev.to/samuelmbabhazi/i-reserved-a-disk-for-builds-the-first-build-still-took-49-gb-from-the-server-5cfk</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. It now builds images too, on the server that runs the application, with a rootless BuildKit.&lt;/p&gt;

&lt;p&gt;A build is bounded in time and in memory. It was not bounded in disk. BuildKit cleans its cache between builds, not during one, so a single large build could fill the disk it shares with the applications. On a single machine, that disk also holds the control plane's database. The spec listed it as an open question, and an audit asked for it to be closed.&lt;/p&gt;

&lt;p&gt;The plan was simple: give builds a filesystem of their own, with its space reserved up front. The first build in the lab filled it, failed exactly as planned, and still took 4.9 GB from the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  The plan
&lt;/h2&gt;

&lt;p&gt;The installer makes one file and mounts it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/var/lib/shipkeep-build.img&lt;/code&gt;, an ext4 image of a fifth of the disk that holds &lt;code&gt;/var/lib&lt;/code&gt;, between 10 and 100 GiB;&lt;/li&gt;
&lt;li&gt;made with &lt;code&gt;fallocate&lt;/code&gt;, so that its blocks are reserved on the server's disk the moment it exists;&lt;/li&gt;
&lt;li&gt;loop-mounted on &lt;code&gt;/var/lib/shipkeep-build&lt;/code&gt;, where BuildKit keeps its state and where the agent writes what a build reads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The builder's systemd unit requires that mount. BuildKit's cleanup thresholds become relative to that filesystem: 70 % used at most, 20 % kept free.&lt;/p&gt;

&lt;p&gt;The expected behavior: a build that writes too much fails with "No space left on device" inside its own filesystem, and the server does not notice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lab
&lt;/h2&gt;

&lt;p&gt;The lab is a privileged Ubuntu 24.04 container running systemd, where the installer's own functions set everything up. The real rootless BuildKit v0.35.1 is driven by &lt;code&gt;buildctl&lt;/code&gt; as the agent's account. The build that matters is one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;RUN&lt;/span&gt; dd &lt;span class="nv"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/zero &lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/big &lt;span class="nv"&gt;bs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1M &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;7000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is 7 GB written into a 5 GiB filesystem. The lab checks the build's exit, and also the server's own free space before and after.&lt;/p&gt;

&lt;p&gt;First run: the build failed with "No space left on device", as planned. The server's free space had dropped by 4.9 GB.&lt;/p&gt;

&lt;p&gt;The build had filled its filesystem. Every block it wrote had been allocated on the server's disk, as if nothing had been reserved at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the reservation went
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;fallocate&lt;/code&gt; did reserve the blocks: the file used its full size right after it was created. Something between &lt;code&gt;fallocate&lt;/code&gt; and the build gave them back.&lt;/p&gt;

&lt;p&gt;It was &lt;code&gt;mkfs.ext4&lt;/code&gt;. Before it writes a filesystem, &lt;code&gt;mke2fs&lt;/code&gt; discards the whole device, which tells the storage that every block is free. On a regular file, or on a loop device backed by one, a discard becomes a hole punched in the file. The reservation is gone before the filesystem exists.&lt;/p&gt;

&lt;p&gt;You can see it on any Linux machine, without root, on a plain file. I ran this today with mke2fs 1.47.0:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ fallocate -l 1G a.img &amp;amp;&amp;amp; du -m a.img
1025    a.img
$ mkfs.ext4 -q -F a.img &amp;amp;&amp;amp; du -m a.img
33      a.img

$ fallocate -l 1G b.img &amp;amp;&amp;amp; mkfs.ext4 -q -F -E nodiscard b.img &amp;amp;&amp;amp; du -m b.img
1025    b.img
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ls -l&lt;/code&gt; shows 1024M for both files. Only &lt;code&gt;du&lt;/code&gt; shows that one of them holds 33 MiB on disk. The other 991 MiB will be taken from the server when something writes there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The second hole
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;-E nodiscard&lt;/code&gt;, the second run lost 80 MB instead of 4.9 GB. Much better, and still not zero.&lt;/p&gt;

&lt;p&gt;By default, &lt;code&gt;mke2fs&lt;/code&gt; does not write the inode tables either. It leaves them for the kernel, which zeroes them in the background after the first mount. On a loop device, zeroing a range can be done by deallocating it, and that is what happened. On a 2 GiB image, 32 MiB were lost that way. With &lt;code&gt;lazy_itable_init=0&lt;/code&gt;, none were.&lt;/p&gt;

&lt;p&gt;The final command formats everything up front:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fallocate -l &lt;span class="s2"&gt;"${size}G"&lt;/span&gt; &lt;span class="s2"&gt;"$image.new"&lt;/span&gt;
mkfs.ext4 -q -F -m 0 -E nodiscard,lazy_itable_init=0,lazy_journal_init=0 \
  -L shipkeep-build &lt;span class="s2"&gt;"$image.new"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The mount unit says &lt;code&gt;nodiscard&lt;/code&gt; too, so that files deleted inside the filesystem never punch holes in the image either:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="k"&gt;[Mount]&lt;/span&gt;
&lt;span class="na"&gt;What&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;shipkeep&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;
&lt;span class="na"&gt;Where&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;shipkeep&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ext4&lt;/span&gt;
&lt;span class="na"&gt;Options&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;nodev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;noatime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;nodiscard&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Formatting takes longer, because the tables are actually written. It runs once, at installation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The run that passed
&lt;/h2&gt;

&lt;p&gt;Third run, from a fresh container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OK   the image's blocks are all taken (5.1G)
== a build larger than the filesystem
22.29 dd: error writing '/big': No space left on device
OK   it fails with no space left
OK   the server's own disk did not fill (0 MiB less)
/dev/loop8      4.9G  4.9G  536K 100% /var/lib/shipkeep-build
OK   the image still has all its blocks (5.1G)
== an ordinary build after it
OK   the builder still builds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;BuildKit also read the thresholds from that filesystem: 4 GB used at most and 1 GB kept free on 5.2 GB. It rounds percentages to the gigabyte.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the review added
&lt;/h2&gt;

&lt;p&gt;The automated review on the pull request found two ways to lose the guarantee without anyone noticing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A builder running on the bare directory.&lt;/strong&gt; &lt;code&gt;RequiresMountsFor=&lt;/code&gt; orders the mount before the service. It does not by itself stop the builder from running on the plain directory under the mount point, if the mount is gone. A builder running there would write to the server's disk again, and nothing would look wrong. The unit now refuses to start without its mount:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c1"&gt;# RequiresMountsFor orders the mount; this refuses to start on the bare directory under it.
&lt;/span&gt;&lt;span class="na"&gt;ExecStartPre&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mountpoint&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;shipkeep&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lab unmounts the filesystem, starts the builder, and expects a refusal. The journal shows the check failing with status 32.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An interrupted installation.&lt;/strong&gt; The installer checks for the image's size plus 5 GiB of free space before it stops anything. An image left half-made by an interrupted run is removed before that check, or it would count against the free space and block every later attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The test that mattered measured the server, not the build.&lt;/strong&gt; The build failed with the same message in all three runs. Only the free space of the host told them apart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Reserved" is a property every layer can undo.&lt;/strong&gt; &lt;code&gt;fallocate&lt;/code&gt; reserved, &lt;code&gt;mkfs&lt;/code&gt; gave back, and the kernel gave back a little more. The check that catches it is &lt;code&gt;du&lt;/code&gt;, after each step, not &lt;code&gt;ls -l&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fix the cause, then measure again.&lt;/strong&gt; The second run looked good until it was compared with zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Merged on &lt;code&gt;main&lt;/code&gt; (&lt;a href="https://github.com/shipkeepdev/shipkeep/pull/554" rel="noopener noreferrer"&gt;#554&lt;/a&gt;, closing &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/548" rel="noopener noreferrer"&gt;#548&lt;/a&gt;). Builds, and this filesystem, ship in the next release.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--build-disk&lt;/code&gt; sets another size, from 5 to 4096 GiB. A filesystem you mount on &lt;code&gt;/var/lib/shipkeep-build&lt;/code&gt; yourself before installing is used as it is.&lt;/li&gt;
&lt;li&gt;The design is in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/adr/0030-builds-and-registry-without-a-private-network.md" rel="noopener noreferrer"&gt;ADR 0030&lt;/a&gt;, and the operator's side in the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You know ext4, loop devices or systemd mounts better than I do:&lt;/strong&gt; read &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/deploy/install.sh" rel="noopener noreferrer"&gt;&lt;code&gt;prepare_build_disk&lt;/code&gt; in the installer&lt;/a&gt; and tell me what I missed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM:&lt;/strong&gt; install a server, run a build that is far too large, and check your free space before and after.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: when you reserve space with a file, what do you check afterwards, &lt;code&gt;ls&lt;/code&gt; or &lt;code&gt;du&lt;/code&gt;?&lt;/p&gt;

</description>
      <category>linux</category>
      <category>docker</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>The HMAC said my backup was genuine. It was also the wrong one.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Sat, 28 Nov 2026 12:41:38 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/the-hmac-said-my-backup-was-genuine-it-was-also-the-wrong-one-2bi2</link>
      <guid>https://dev.to/samuelmbabhazi/the-hmac-said-my-backup-was-genuine-it-was-also-the-wrong-one-2bi2</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. Its control plane keeps everything that matters in one PostgreSQL database, plus one key that encrypts the secrets in it. An instance backup holds both. A restore brings the whole installation back as it was when the backup was made.&lt;/p&gt;

&lt;p&gt;The restore checks the archive carefully before it touches anything. A forged archive is refused, and so are a changed one and a cut one. All of that has tests, and they pass.&lt;/p&gt;

&lt;p&gt;Then backups gained an S3 destination, and I filed a question I could not answer yet: which archive is the restore checking? Not whether it is genuine: whether it is &lt;em&gt;the one you asked for&lt;/em&gt;. The restore could not tell.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the archive proved
&lt;/h2&gt;

&lt;p&gt;A backup is an &lt;a href="https://age-encryption.org" rel="noopener noreferrer"&gt;age&lt;/a&gt; file, encrypted to a public key. The identity that opens it stays off the server. So creating a backup needs nothing secret, and only whoever holds the identity can read one.&lt;/p&gt;

&lt;p&gt;age authenticates every chunk of the file and its end: a changed or truncated archive fails to decrypt. But age says nothing about who wrote it. Anyone who knows the public key can encrypt to it, and the public key sits on the server. A forged archive would reach &lt;code&gt;pg_restore&lt;/code&gt;, which runs its statements as the database owner.&lt;/p&gt;

&lt;p&gt;So the first line of the plaintext is a manifest: the format, a version, the creation time, the newest database migration, and the key. It ends with a tag, an HMAC-SHA256 of those fields under a key derived from the identity with HKDF. The server keeps that derived key, but not the identity. A restore derives the same key from the identity it is given, and refuses an archive whose tag does not match, before a byte of it reaches &lt;code&gt;pg_restore&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Forged, changed, truncated: all refused. It felt complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it did not prove
&lt;/h2&gt;

&lt;p&gt;The issue was one paragraph long. The tag proves that a server holding this installation's backup key made the archive. It does not prove that the archive is the one the operator asked for.&lt;/p&gt;

&lt;p&gt;Backups go to an S3 bucket, or to files you keep somewhere. Anyone who can write there can copy an older, perfectly genuine archive of the same installation under the name you are about to restore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the storage provider, or anyone who gets the bucket's credentials;&lt;/li&gt;
&lt;li&gt;anyone on the path, when the storage is reached over plain HTTP. That is allowed for a storage on the same machine, with a setting that says so.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every check passes, because the archive is genuine. It is just older. The restore then brings back the installation as it was then:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A password changed since works again.&lt;/li&gt;
&lt;li&gt;An API token revoked since is valid again.&lt;/li&gt;
&lt;li&gt;A member removed since is back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is a rollback attack, signed by your own server.&lt;/p&gt;

&lt;p&gt;The only defense was in the guide. The restore printed the archive's creation time, and the guide asked you to check it. I went back to see where that line was printed: by the last step, the one that restores the key. By then the database had already been replaced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Binding the name
&lt;/h2&gt;

&lt;p&gt;The fix is the same idea as an audience claim in a token. The signature has to cover what the thing is &lt;em&gt;for&lt;/em&gt;, not only who made it.&lt;/p&gt;

&lt;p&gt;Version 2 of the manifest carries the name the archive was created under: the S3 object's name, or the file's name. The tag covers it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;migration&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kek&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;createHmac&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sha256'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'\n'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'base64'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The restore is told which name it was asked for, and compares:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;This archive was created as shipkeep-20261101-100000-0badc0de.age,
not shipkeep-20261123-100000-3f9a1c2e.age: it is not restored.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The version is one of the tagged fields, and that matters. Without it, someone could take the name out of a version 2 manifest, call it version 1, and keep the tag. With it, the tag no longer matches. A test does exactly that and expects a refusal.&lt;/p&gt;

&lt;p&gt;Archives made by earlier releases have no name. They still restore, because refusing them would make every existing backup useless. The restore says that it cannot tell which archive it is, and prints the creation time.&lt;/p&gt;

&lt;p&gt;The tests serve an archive created as A under the name B. Both restore steps refuse it, and the key file stays as it was. Turning the comparison off makes two tests fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  The review found three more
&lt;/h2&gt;

&lt;p&gt;I opened the pull request, and the automated review came back with three findings. All three were right.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bash ate a newline
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;backup.sh&lt;/code&gt; took the archive's name from its path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;basename -- &lt;span class="s2"&gt;"$2"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Command substitution strips trailing newlines. A file named &lt;code&gt;A.age&lt;/code&gt; followed by a newline became &lt;code&gt;A.age&lt;/code&gt;, which passes the name check. Two different files then share one authenticated name. The script now uses a parameter expansion, which keeps every byte:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;${2##*/}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The newline stays in the name, and the name check refuses it. My first check of this fix passed for the wrong reason: I built the test path with &lt;code&gt;$(printf ...)&lt;/code&gt;, which strips the newline too. Checked again with &lt;code&gt;$'A.age\n'&lt;/code&gt;, the old line gives &lt;code&gt;A.age&lt;/code&gt; and the new one keeps the newline.&lt;/p&gt;

&lt;h3&gt;
  
  
  The check came too late
&lt;/h3&gt;

&lt;p&gt;The name was checked when the database step opened the archive. By then, the script had already stopped the control plane and prepared an empty database to restore into. A refused archive left the service stopped, which is exactly what you do not want while someone is playing with your bucket.&lt;/p&gt;

&lt;p&gt;There is now a separate step, &lt;code&gt;backup.js verify NAME&lt;/code&gt;. It reads the whole archive: manifest, tag, name, and every chunk to the end. It runs before the confirmation prompt, before anything stops:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetch the archive.&lt;/li&gt;
&lt;li&gt;Verify it, whole. A refusal says "nothing was changed".&lt;/li&gt;
&lt;li&gt;Ask you to type &lt;code&gt;replace&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Stop the control plane, restore the database into a new one, swap it, then the key.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Reading the archive twice costs one more decryption pass, made before anything has changed. A test damages the last bytes of an archive and expects &lt;code&gt;verify&lt;/code&gt; to refuse it; without the full read, that test fails.&lt;/p&gt;

&lt;h3&gt;
  
  
  The docs promised too much
&lt;/h3&gt;

&lt;p&gt;My new paragraph in the guide said that someone who can write where archives are kept can no longer swap one. The review pointed out two holes in that sentence.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Versions:&lt;/strong&gt; archives from earlier releases have no name, so they are not covered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Names:&lt;/strong&gt; a name says which archive it is, not how old it is. If you reuse a name, an older archive under that same name still passes. Archives sent to S3 get the time and four random bytes in their name. For local files, the guide shows a name with the date in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The guide now says both, in those words. An honest limit is more useful than a broad claim.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take from it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authenticity is not identity.&lt;/strong&gt; "Who made this?" and "Is this the one I asked for?" are different questions. If the second matters, put the answer under the signature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check before you change anything.&lt;/strong&gt; A refusal that arrives after the first destructive step still costs you something. Here, it left the control plane down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write the limits down.&lt;/strong&gt; The first version of my docs claimed more than the code did. Nobody had to attack anything for that to be a bug.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Merged on &lt;code&gt;main&lt;/code&gt; (&lt;a href="https://github.com/shipkeepdev/shipkeep/pull/565" rel="noopener noreferrer"&gt;#565&lt;/a&gt;, closing &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/439" rel="noopener noreferrer"&gt;#439&lt;/a&gt;), in the next release. Backups made by &lt;code&gt;v0.1.0-alpha.7&lt;/code&gt; and earlier still restore, with a warning.&lt;/li&gt;
&lt;li&gt;The design is in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/adr/0026-instance-backup-as-an-encrypted-export.md" rel="noopener noreferrer"&gt;ADR 0026&lt;/a&gt;, and the operator's side in the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; under "Back up and restore".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You know backup formats or applied crypto:&lt;/strong&gt; read the ADR and tell me what else the tag should cover.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM:&lt;/strong&gt; install, back up, restore into a fresh install, and tell me where it breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: how do your backups prove they are the one you asked for, and not just one of yours?&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>devops</category>
      <category>backup</category>
    </item>
    <item>
      <title>The registry said 127.0.0.1. Docker went.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Wed, 25 Nov 2026 20:57:06 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/the-registry-said-127001-docker-went-4gpf</link>
      <guid>https://dev.to/samuelmbabhazi/the-registry-said-127001-docker-went-4gpf</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. You give it an image reference, and an agent on the server asks the Docker daemon to pull it.&lt;/p&gt;

&lt;p&gt;The control plane refuses a registry whose host is, or resolves to, an address that is not public: no loopback, no private ranges, no &lt;code&gt;169.254.169.254&lt;/code&gt;. That check has tests, and they pass.&lt;/p&gt;

&lt;p&gt;Then a security review asked a simple question: who actually makes the connection? Not the control plane. It checks a name, then sends the server a reference that still names that host. The Docker daemon on the server does the pull, with none of those checks.&lt;/p&gt;

&lt;p&gt;So I built a lab to see what the daemon does when the registry is the attacker.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lab
&lt;/h2&gt;

&lt;p&gt;One real node: Docker Engine 29.10.0, containerd image store, Ubuntu 24.04. A small HTTPS registry with a valid certificate for its name, the kind anyone can get for a domain they own. Plain HTTP servers on &lt;code&gt;127.0.0.1&lt;/code&gt; and on the node's private address, logging whatever reached them. Every pull went through &lt;code&gt;POST /images/create&lt;/code&gt;, the call the agent makes.&lt;/p&gt;

&lt;p&gt;Four things reached places the control plane would never allow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The name is resolved again, on the node.&lt;/strong&gt; I pointed the node's answer for the registry name at a private address. The daemon pulled from it. A name that passed the control plane's check can answer differently a minute later: DNS rebinding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redirects are followed anywhere, in plain HTTP.&lt;/strong&gt; A blob request answered &lt;code&gt;307 Location: http://127.0.0.1:8099/…&lt;/code&gt;. The daemon sent the &lt;code&gt;GET&lt;/code&gt; there. Same with the node's private address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The token service is called anywhere, in plain HTTP.&lt;/strong&gt; A &lt;code&gt;401&lt;/code&gt; with &lt;code&gt;Bearer realm="http://127.0.0.1:8099/…"&lt;/code&gt;. The daemon called it, with the repository scope in the query string.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A name that resolves to loopback, on any port.&lt;/strong&gt; Docker treats &lt;code&gt;127.0.0.0/8&lt;/code&gt; as an insecure registry by default. Version 29 does not fall back to HTTP, but it still opened the TCP connection and sent its TLS handshake to the port I chose.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is not a Docker bug. The daemon is a client, and it trusts the registry you name. That is fine on a laptop. It is not fine when "the registry you name" can be typed by any user who can deploy an image.&lt;/p&gt;

&lt;p&gt;These requests are blind: the response never reaches the user, and the pull fails on the digest or the token. But the path, the query and the port are the attacker's choice, and a closed port fails differently from an open one. That is enough to map the node's network, and to send a &lt;code&gt;GET&lt;/code&gt; with side effects to an internal service: a cloud metadata endpoint, an admin page, a database's HTTP port. On a single-machine installation, the control plane itself is on that loopback.&lt;/p&gt;

&lt;h2&gt;
  
  
  An egress proxy, and why it is not enough
&lt;/h2&gt;

&lt;p&gt;Docker reads &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; for its registry traffic. Point them at a proxy you control, and every connection goes through something that can say no.&lt;/p&gt;

&lt;p&gt;So each server now runs &lt;code&gt;shipkeep-egress&lt;/code&gt;, a small mode of the agent binary, as its own systemd service and its own user, on &lt;code&gt;127.0.0.1:7480&lt;/code&gt;. It does very little:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;CONNECT&lt;/code&gt; only.&lt;/strong&gt; Registry traffic stays HTTPS end to end, and the proxy never sees a path, a header or a token. A plain HTTP request, which is what cases 2 and 3 become, is refused.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public addresses only.&lt;/strong&gt; It resolves the name itself and refuses if any answer is not public, using the same list as the control plane. A test reads both lists, the Go one and the TypeScript one, and fails if they differ.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The check runs in the dialer.&lt;/strong&gt; Not on the DNS answer, but in &lt;code&gt;net.Dialer.Control&lt;/code&gt;, on the address the socket is about to connect to. A second answer, a cache or a retry cannot change what is reached.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;guard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;syscall&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RawConn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;netip&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ParseAddrPort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nc"&gt;Public&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;errNotPublic&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bounded.&lt;/strong&gt; 64 tunnels, 10 seconds to connect, one hour per tunnel. Each tunnel logs its host, its port and its outcome.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With the proxy in place, cases 1, 2 and 3 to a private address were refused. Cases 2 and 3 to &lt;code&gt;127.0.0.1&lt;/code&gt; still reached the probe.&lt;/p&gt;

&lt;p&gt;Go's proxy support never sends a request for &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;127.0.0.0/8&lt;/code&gt; or &lt;code&gt;::1&lt;/code&gt; to a proxy, whatever &lt;code&gt;NO_PROXY&lt;/code&gt; says. The daemon is written in Go. A redirect to a loopback literal bypasses any proxy you configure.&lt;/p&gt;

&lt;h2&gt;
  
  
  A firewall rule for one process
&lt;/h2&gt;

&lt;p&gt;Loopback had to be closed in the kernel, for the daemon only. Other services on the host must keep talking to each other, and containers have their own network namespace anyway.&lt;/p&gt;

&lt;p&gt;nftables can match the cgroup of the process that owns a socket. So: reject new connections from the Docker daemon to loopback, except the proxy and the local DNS resolver.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;table inet shipkeep_egress {
  chain output {
    type filter hook output priority filter; policy accept;
    socket cgroupv2 level 1 "shipkeep.slice" ct state new jump docker
  }
  chain docker {
    ip daddr 127.0.0.1 tcp dport 7480 return
    meta l4proto { tcp, udp } ct original ip daddr 127.0.0.53 ct original proto-dst 53 return
    ip daddr 127.0.0.0/8 reject
    ip6 daddr ::1 reject
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ct state new&lt;/code&gt; matters. &lt;code&gt;docker-proxy&lt;/code&gt;, which serves published ports, runs in the daemon's cgroup too, and its replies to local clients must still get through.&lt;/p&gt;

&lt;p&gt;That rule is not what I wrote first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first design broke in the lab
&lt;/h2&gt;

&lt;p&gt;The first version matched &lt;code&gt;system.slice/docker.service&lt;/code&gt; and was loaded by an &lt;code&gt;ExecStartPre&lt;/code&gt; of the Docker unit. It worked, and it survived two restarts of Docker. Then the lab kept going.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;nftables resolves a cgroup path to a numeric ID when the rule is loaded.&lt;/strong&gt; The path must exist at that moment. The cgroup of &lt;code&gt;docker.service&lt;/code&gt; is created at each start and is gone while Docker is stopped, at boot in particular. Restarting Docker gives a new ID, and a rule loaded earlier matches nothing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;nftables.service&lt;/code&gt; starts by flushing the whole ruleset.&lt;/strong&gt; Ubuntu's &lt;code&gt;/etc/nftables.conf&lt;/code&gt; begins with &lt;code&gt;flush ruleset&lt;/code&gt;. A restart of that service removes the guard while Docker keeps running. It removes Docker's own NAT rules too, which is a separate surprise.&lt;/p&gt;

&lt;p&gt;The fix is a slice. The Docker unit gets &lt;code&gt;Slice=shipkeep.slice&lt;/code&gt;, a slice that holds the daemon and nothing else. It starts at boot, before nftables and Docker, and its cgroup exists whether Docker runs or not. Its ID does not change when Docker restarts.&lt;/p&gt;

&lt;p&gt;The guard is then loaded in the same transaction as anything that could remove it. A drop-in for &lt;code&gt;nftables.service&lt;/code&gt; replaces its start and its reload with one file that includes &lt;code&gt;/etc/nftables.conf&lt;/code&gt;, then the guard. Its stop flushes, then loads the guard again. One &lt;code&gt;nft&lt;/code&gt; transaction, so there is never a moment without the rule.&lt;/p&gt;

&lt;p&gt;Two smaller ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The DNS exception failed when the node itself ran in a container.&lt;/strong&gt; Docker's embedded resolver answers on &lt;code&gt;127.0.0.11:53&lt;/code&gt;, then DNATs to a random port. The rule saw the translated port. Matching &lt;code&gt;ct original&lt;/code&gt;, the destination before translation, fixed it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The proxy could not run, and the installer did not notice.&lt;/strong&gt; The egress service could not execute the binary inside the agent's private directory. The daemon reports its proxy settings whether or not anything listens there, so every check looked green. The service now runs from a root-owned copy, and the installer waits until the proxy answers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Settings drift
&lt;/h2&gt;

&lt;p&gt;The proxy settings can change after the installation: someone edits &lt;code&gt;daemon.json&lt;/code&gt;, which Docker applies before its environment, or adds a drop-in. So the installer refuses to continue when &lt;code&gt;daemon.json&lt;/code&gt; sets a proxy, and the agent reads the daemon's settings (&lt;code&gt;GET /info&lt;/code&gt;) before every pull. If they are not exactly the proxy's, it refuses with a cause of its own, &lt;code&gt;egress_unguarded&lt;/code&gt;, and the deployment says why.&lt;/p&gt;

&lt;p&gt;I checked that too: with &lt;code&gt;NO_PROXY=*&lt;/code&gt; added later, the next deployment stopped before any download.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A registry that redirects to plain HTTP stops working. Docker Hub, GHCR, ECR and GCR redirect to HTTPS, so they keep working.&lt;/li&gt;
&lt;li&gt;A registry on a private network is unsupported. It already was. When it is supported, its exception will be an explicit server setting.&lt;/li&gt;
&lt;li&gt;Every pull of that daemon goes through the proxy, including &lt;code&gt;docker compose pull&lt;/code&gt; for the control plane on a single machine. The guide says so.&lt;/li&gt;
&lt;li&gt;Servers installed before this change need to run the installer again, and Docker restarts with it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;On the lab node, after the change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A pull from Docker Hub went through the proxy, including the redirect to its CDN.&lt;/li&gt;
&lt;li&gt;The four attack registries were refused, and the probes received nothing.&lt;/li&gt;
&lt;li&gt;A deployment from the control plane succeeded.&lt;/li&gt;
&lt;li&gt;Loopback stayed refused for the daemon after Docker restarts, after every start, reload, restart and stop of nftables, and after reboots.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The design, the alternatives and the lab are in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/adr/0023-registry-egress-at-the-pull.md" rel="noopener noreferrer"&gt;ADR 0023&lt;/a&gt;. The proxy is under 400 lines of Go, comments included, with nothing outside the standard library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Released in &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-alpha.5" rel="noopener noreferrer"&gt;&lt;code&gt;v0.1.0-alpha.5&lt;/code&gt;&lt;/a&gt;. It has run in test containers with systemd, not on a real server yet.&lt;/li&gt;
&lt;li&gt;If you installed an earlier release, run the server installer again on each server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You know nftables or systemd better than I do:&lt;/strong&gt; read the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/deploy/install.sh" rel="noopener noreferrer"&gt;guard and its drop-ins&lt;/a&gt; and tell me what I missed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM and a domain name:&lt;/strong&gt; follow the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; and tell me where it breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: what does the Docker daemon on your servers reach when a registry tells it to go somewhere else?&lt;/p&gt;

</description>
      <category>docker</category>
      <category>security</category>
      <category>go</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>A security audit found 11 issues. Five of my fixes had bugs of their own.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Wed, 25 Nov 2026 20:54:24 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/a-security-audit-found-11-issues-five-of-my-fixes-had-bugs-of-their-own-3anj</link>
      <guid>https://dev.to/samuelmbabhazi/a-security-audit-found-11-issues-five-of-my-fixes-had-bugs-of-their-own-3anj</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. An agent on each server runs containers and routes, and a control plane tells it what to do. Last week the agent learned to ship container logs, and the browser learned to open a shell in a container.&lt;/p&gt;

&lt;p&gt;Then a security audit of &lt;code&gt;main&lt;/code&gt; filed eleven issues. Three were P1:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;secret values could reach the log store unredacted, in two different ways;&lt;/li&gt;
&lt;li&gt;one WebSocket message, under 64 KiB, could crash the API process. I had written that code the same day, while answering review comments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I fixed each issue with a test that failed on the old code first. Then I reviewed each fix the way I would review someone else's pull request. Five of the eight fixes had a real bug of their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Absence is not "no secrets"
&lt;/h2&gt;

&lt;p&gt;The agent removes secret values from log lines before shipping them. To know which environment variables are secrets, it reads a container label, &lt;code&gt;sk.secret_env&lt;/code&gt;, which lists their names. The agent writes that label when it creates a container.&lt;/p&gt;

&lt;p&gt;Containers created before the label existed have no label, and the shipper read "no label" as "no secrets". After an agent upgrade, an application that printed its token got that token stored as written.&lt;/p&gt;

&lt;p&gt;Worse, a new container with no secrets also had no label: the agent only set it when there was something to list. Missing and empty meant the same thing, so the shipper could not tell an old container from one with nothing to hide.&lt;/p&gt;

&lt;p&gt;The fix:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The label is now always set, empty when there are no secrets.&lt;/li&gt;
&lt;li&gt;A container without the label is treated as one whose secret names are unknown: every environment value of 8 bytes or more is redacted, &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;NODE_ENV=production&lt;/code&gt; included, until the application is redeployed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Over-redacting is ugly in logs. Leaking a token is worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logs come one line at a time
&lt;/h2&gt;

&lt;p&gt;The second P1: a secret containing a newline, like a PEM key, was never redacted. Docker output is split into lines before redaction, and the redactor searched each line for the whole value. No single line ever contains a multiline value.&lt;/p&gt;

&lt;p&gt;Each line of a multiline value is now a value of its own. Then a related case: lines are cut at 16 KiB. A line cut in the middle of a secret ends with its first half, which no whole-value match finds. So for a cut line, the redactor also masks the longest start of a secret that the line ends with.&lt;/p&gt;

&lt;p&gt;My first version ran that cut-start redaction before the normal one. The review found the hole:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TOKEN=abcdefgh_abcdefgh
cut line:          ... abcdefgh_abcdefgh
cut-start first:   ... abcdefgh_[redacted]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last 8 bytes of the secret are also its first 8 bytes. The cut-start pass masked them, and the whole-value pass then had nothing left to match. Half the secret shipped.&lt;/p&gt;

&lt;p&gt;Running the passes the other way round fails too: a shorter secret inside the cut start hides the rest of it. The version that holds does not chain replacements at all. For each secret, one pass over the line with the Knuth-Morris-Pratt failure function finds every occurrence, overlapping ones included, plus the start the line ends with. Then the union of those spans is redacted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;found&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// every occurrence, and the cut start&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// sort, merge overlapping spans, replace each with [redacted]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also makes the cost linear. Secrets can be 64 KiB, and a naive suffix scan of a crafted 16 KiB line is quadratic. A randomized test compares the spans with a byte-by-byte scan on 20,000 cases over a two-letter alphabet, where values overlap themselves and each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  64 KiB of braces
&lt;/h2&gt;

&lt;p&gt;The browser terminal sends control messages over a WebSocket: &lt;code&gt;{"type":"resize","cols":80,"rows":24}&lt;/code&gt;. My code turned each message into a class-validator DTO with &lt;code&gt;plainToInstance&lt;/code&gt;, and only then validated its fields.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;plainToInstance&lt;/code&gt; walks the whole object recursively. A resize message with an extra field nested 3,000 levels deep fits in 64 KiB, and it overflows the stack. A WebSocket &lt;code&gt;message&lt;/code&gt; listener runs outside the framework's exception handling, so that &lt;code&gt;RangeError&lt;/code&gt; could take down the process, and every session in it.&lt;/p&gt;

&lt;p&gt;The fix checks the message's shape before anything transforms it: exactly the expected keys, each a primitive. Each message is also handled inside its own &lt;code&gt;try&lt;/code&gt;, so a failure ends only that session.&lt;/p&gt;

&lt;p&gt;The review of that fix found a weakness, not one of the five bugs: my &lt;code&gt;try&lt;/code&gt; also wrapped the shape check. If the check itself ever threw, the message would be silently dropped instead of ending the session as the spec says. Worse, the tests still passed with the shape check deleted, because the broad &lt;code&gt;catch&lt;/code&gt; hid the overflow. Now only &lt;code&gt;JSON.parse&lt;/code&gt; is caught there. I checked that deleting the shape check makes three tests fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read, compare, write
&lt;/h2&gt;

&lt;p&gt;GitHub tells Shipkeep when the GitHub App is installed, suspended or removed. An event applies only if it is newer than the last one applied. Two problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Two deliveries at once.&lt;/strong&gt; Both read the same row, both pass the time check, and the older one can write last. An older &lt;code&gt;unsuspend&lt;/code&gt; undid a newer &lt;code&gt;suspend&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A delayed event after a removal.&lt;/strong&gt; The removal deleted the row, and with it the time of the last event. A delayed &lt;code&gt;unsuspend&lt;/code&gt; then recreated the installation, active.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each delivery now takes a transaction-level advisory lock per installation before reading. A removal keeps the row as a tombstone. GitHub gives a reinstalled App a new installation id, so nothing legitimate ever follows a removal.&lt;/p&gt;

&lt;p&gt;The test forces the interleaving. A third PostgreSQL connection holds the installation's row while both deliveries start, and releases it once both are waiting. The old code lets the older &lt;code&gt;unsuspend&lt;/code&gt; win, and with the fix the newer state stays, in both orders.&lt;/p&gt;

&lt;p&gt;The review found what the lock broke. Before the lock, each delivery purged expired delivery records, locking those rows. A delivery waiting for one busy installation kept them locked, so a delivery for any other installation blocked behind it. The purge now uses &lt;code&gt;FOR UPDATE SKIP LOCKED&lt;/code&gt;. With the old purge, the new test hangs until its timeout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refuse, and ask
&lt;/h2&gt;

&lt;p&gt;Deleting an application after a failed first deployment could free its domain while a server still routed it. The cleanup of the failed deployment was queued but had not run yet. Another application could then claim the hostname.&lt;/p&gt;

&lt;p&gt;The first fix refused the deletion until every server had confirmed the cleanup. The review found the dead end. A creation that failed after reaching the server gets no cleanup at all. A cleanup that expires can never be queued again under the same key. Either way, the application could never be deleted.&lt;/p&gt;

&lt;p&gt;So a refused deletion now asks: it queues a removal for each container or route a server may still hold, audits that, and answers 409. Once the servers confirm, the next attempt goes through.&lt;/p&gt;

&lt;p&gt;Then the automated review on the pull request caught what that change broke. The deletion queued those removals before it looked at the confirmation token. Deleting an application requires a confirmation, and any token, valid or not, could now make a server remove containers. The token is now checked first, without being spent, so it stays usable for the deletion that follows.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the reviews were for
&lt;/h2&gt;

&lt;p&gt;None of these bugs were in code I hadn't touched. Every one was in a fix: a fix makes an assumption about the bug, and the review checks that assumption. Each fix started with a test that failed on the old code, and that test passed every time. It just did not cover what the fix itself broke.&lt;/p&gt;

&lt;p&gt;Reviewing my own fixes cold, a few hours later, caught five of them before merge. The automated review on the pull request caught the sixth: the confirmation token.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Released: &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-alpha.5" rel="noopener noreferrer"&gt;&lt;code&gt;v0.1.0-alpha.5&lt;/code&gt;&lt;/a&gt;, with all of the above, on refreshed base images. The release scan, which stops on any high or critical finding that has a fix, passed on both architectures with no exception.&lt;/li&gt;
&lt;li&gt;Not &lt;code&gt;v0.1.0-alpha.4&lt;/code&gt;. That release stopped halfway. The workflow pins the image of the tool that copies the control plane image by digest, and quay.io no longer served that digest. The binaries were published, the image and the installer bundle were not. Pinning by digest protects you from an image that changes, not from one that disappears. A published release is never replaced, so alpha.4 now says so at the top, and alpha.5 is the same code plus a one-line fix.&lt;/li&gt;
&lt;li&gt;The control plane image still has high findings in Debian packages with no fix yet. The triage checked what the process actually loads: Node carries its own zlib and zstd, and nothing in the container uses PAM, util-linux or Perl. Each one is recorded in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/security/image-triage-2026-11.md" rel="noopener noreferrer"&gt;&lt;code&gt;docs/security/image-triage-2026-11.md&lt;/code&gt;&lt;/a&gt;, with the pinned PostgreSQL image's one high finding, accepted until December 18.&lt;/li&gt;
&lt;li&gt;Installing the published alpha.5 from scratch, the way the guide says, still found three things no test had: a documented command without a terminal that stops at a question it did not expect, a misleading error when the agent starts before the control plane is ready, and a restore that leaves a container running. They are &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/499" rel="noopener noreferrer"&gt;#499&lt;/a&gt;, &lt;a href="https://github.com/shipkeepdev/shipkeep/pull/500" rel="noopener noreferrer"&gt;#500&lt;/a&gt; and &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/501" rel="noopener noreferrer"&gt;#501&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;One more thing from the release day: GitHub squash-merged a pull request during an API incident, never marked it merged, and never ran CI on the commit. I did not tag that commit. I waited for the next merge, and tagged once CI was green on it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You run self-hosted apps:&lt;/strong&gt; follow the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; on a disposable Ubuntu 24.04 VM and tell me where it breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You like breaking things:&lt;/strong&gt; the exec WebSocket, the log shipper and the GitHub webhook endpoint are all new. Issues are welcome, and the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/SECURITY.md" rel="noopener noreferrer"&gt;security policy&lt;/a&gt; says how to report privately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: when you fix a security bug, who reviews the fix?&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>testing</category>
      <category>devops</category>
    </item>
    <item>
      <title>I pinned every image by digest. That froze 97 vulnerabilities in place.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Wed, 18 Nov 2026 21:33:24 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/i-pinned-every-image-by-digest-that-froze-97-vulnerabilities-in-place-459d</link>
      <guid>https://dev.to/samuelmbabhazi/i-pinned-every-image-by-digest-that-froze-97-vulnerabilities-in-place-459d</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers. The control plane runs as a Docker Compose stack: the control plane image, PostgreSQL and Caddy.&lt;/p&gt;

&lt;p&gt;Every image in that stack is pinned by digest. Every GitHub Action is pinned to a commit. CI runs CodeQL, Semgrep, gosec, gitleaks, and a Trivy scan of the repository. All green, every day.&lt;/p&gt;

&lt;p&gt;This week I pointed Trivy at what an installation actually runs, the images, instead of at the repository. The PostgreSQL image alone had 97 fixable high or critical findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pinning freezes the fixes out
&lt;/h2&gt;

&lt;p&gt;Pinning by digest is the right call for a supply chain: a tag can be moved to anything, a digest cannot. But a digest also means the image never changes. Not when someone pushes something malicious to the tag, and not when Debian or the PostgreSQL project ships a fix.&lt;/p&gt;

&lt;p&gt;The pin was set when the stack was written. The world kept patching. My compose file did not.&lt;/p&gt;

&lt;p&gt;Here is what the first scan found, counting only vulnerabilities with a published fix (&lt;code&gt;--ignore-unfixed&lt;/code&gt;, high and critical):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Image&lt;/th&gt;
&lt;th&gt;Findings&lt;/th&gt;
&lt;th&gt;What they were&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;postgres:17&lt;/code&gt; (17.11)&lt;/td&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;td&gt;62 distinct CVEs: 34 in PostgreSQL itself (reported once for the server package, once for the client), 26 in the Go standard library compiled into &lt;code&gt;gosu&lt;/code&gt;, plus apt and zlib&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;node:22-bookworm-slim&lt;/code&gt;, base of the control plane image&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;all in the npm that ships with Node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;caddy:2.11.9-alpine&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;golang.org/x/net&lt;/code&gt;, compiled into Caddy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The repository scan had nothing to say about any of this. It reads lockfiles. None of these packages is in a lockfile of mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bot that was configured and never ran
&lt;/h2&gt;

&lt;p&gt;The repository has a &lt;code&gt;renovate.json&lt;/code&gt;. It pins Docker digests (&lt;code&gt;docker:pinDigests&lt;/code&gt;), groups updates, and opens security updates at any time. It is a good config.&lt;/p&gt;

&lt;p&gt;Renovate never opened a single pull request. The Renovate app had never been installed on the GitHub organization. A config file in a repository does nothing on its own, and nothing ever told me it was being ignored.&lt;/p&gt;

&lt;p&gt;That is the whole story of how a pinned image ages: the pin works, the update mechanism is silently off.&lt;/p&gt;

&lt;h2&gt;
  
  
  What each finding turned into
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PostgreSQL.&lt;/strong&gt; The same major version had a new image: 17.12. Moving the pin removed all 34 PostgreSQL CVEs, apt and most of the rest: 97 findings went down to 27. I tested the upgrade on an installed server, not only in CI: data kept, migrations applied, an account created before the upgrade still signs in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npm.&lt;/strong&gt; The Node base image was already the newest one, so there was nothing to update. But nothing in the image runs npm: dependencies are installed with pnpm through corepack, and the app starts with &lt;code&gt;node main.js&lt;/code&gt;. So npm is removed after the install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;RUN&lt;/span&gt; corepack &lt;span class="nb"&gt;enable&lt;/span&gt; \
  &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; corepack prepare &lt;span class="s2"&gt;"pnpm@${PNPM_VERSION}"&lt;/span&gt; --activate \
  &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; pnpm install --prod --frozen-lockfile \
  &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf /root/.local/share/pnpm /root/.cache \
    /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;10 findings, gone, and less to ship. The control plane image now scans clean: no fixable high or critical vulnerability and no secret, with no exception.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What nobody has fixed yet.&lt;/strong&gt; The remaining 27 PostgreSQL findings and the Caddy one have no fixed image upstream. Debian has fixed zlib, but the official image has not picked it up. &lt;code&gt;golang.org/x/net&lt;/code&gt; is fixed, but not in a Caddy release. The 26 Go findings live in &lt;code&gt;gosu&lt;/code&gt;, a tiny binary that switches from root to the &lt;code&gt;postgres&lt;/code&gt; user when the container starts and reads no input.&lt;/p&gt;

&lt;p&gt;Those are accepted, but not forever. Trivy's ignore file supports an expiry date:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;vulnerabilities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CVE-2026-78661&lt;/span&gt;
    &lt;span class="na"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="s"&gt;-&lt;/span&gt;
      &lt;span class="s"&gt;golang.org/x/net in the Caddy binary (caddy 2.11.9). Fixed in x/net 0.62.0,&lt;/span&gt;
      &lt;span class="s"&gt;not yet in a Caddy release.&lt;/span&gt;
    &lt;span class="na"&gt;expired_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2026-12-18&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On December 18 the scan fails again, and someone has to look. I checked that it does, by moving a date to yesterday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scanning what ships, in CI
&lt;/h2&gt;

&lt;p&gt;The image scans now run on every pull request and every week:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The control plane image is built from the branch and scanned for vulnerabilities and secrets, with no exception. That check is required to merge.&lt;/li&gt;
&lt;li&gt;The PostgreSQL and Caddy images that &lt;code&gt;compose.yml&lt;/code&gt; pins are scanned with the ignore file above. Those checks are not required, on purpose: a flaw disclosed upstream would otherwise block every pull request until a new image exists. The weekly run reports it instead.&lt;/li&gt;
&lt;li&gt;The release workflow scans the pushed image, for amd64 and arm64, before it signs it. A finding stops the release before anything points to that image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing the secret scanner flagged in the PostgreSQL image: a private key, &lt;code&gt;/etc/ssl/private/ssl-cert-snakeoil.key&lt;/code&gt;, generated when the image is built. PostgreSQL TLS is off in this stack and the database only listens on the private Compose network, so third-party images are scanned for vulnerabilities only. The image I build is still scanned for secrets.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same week, licenses
&lt;/h2&gt;

&lt;p&gt;The project's rules allow MIT, Apache-2.0, BSD, ISC and MPL-2.0 for dependencies, with exceptions approved one by one. Nothing enforced that. So a new required job runs Trivy's license scanner on the production dependencies and checks the result against an allow-list.&lt;/p&gt;

&lt;p&gt;Two things I did not know about Trivy's license scan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It does not read licenses from lockfiles. For npm it reads &lt;code&gt;node_modules&lt;/code&gt;, for Go the module cache. CI installs dependencies (&lt;code&gt;--ignore-scripts&lt;/code&gt;, so no package code runs) and downloads the Go modules before scanning.&lt;/li&gt;
&lt;li&gt;A package with no detected license simply has no entry. The check treats "no license found" as a failure, not a pass.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first run found four production dependencies outside the list: &lt;code&gt;tslib&lt;/code&gt; (0BSD), &lt;code&gt;postgres&lt;/code&gt; and &lt;code&gt;robust-predicates&lt;/code&gt; (Unlicense), and &lt;code&gt;elkjs&lt;/code&gt; under EPL-2.0, a weak copyleft. That last one comes from Prisma Studio, which is part of the Prisma CLI, which ships in the image because migrations run with &lt;code&gt;prisma migrate deploy&lt;/code&gt;. I would never have guessed that a migration tool brings a graph layout library into production. They are approved now, with the path that pulls each one in written down.&lt;/p&gt;

&lt;p&gt;It also found two packages it could not classify, &lt;code&gt;busboy&lt;/code&gt; and &lt;code&gt;streamsearch&lt;/code&gt;. Both are MIT, declared in the old &lt;code&gt;"licenses": [...]&lt;/code&gt; array of &lt;code&gt;package.json&lt;/code&gt;, which Trivy does not read. They are listed as checked by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first diagnosis was wrong
&lt;/h2&gt;

&lt;p&gt;The license job then failed in CI on one Go dependency, &lt;code&gt;golang.org/x/text&lt;/code&gt; in the CLI module, while it passed on my machine.&lt;/p&gt;

&lt;p&gt;The first explanation, written into a commit message, was that CI restored a Go module cache from other jobs. Reasonable, and wrong. Rerunning the job with an empty cache, the same Trivy version and the same commands failed the same way.&lt;/p&gt;

&lt;p&gt;The real cause: the CLI's &lt;code&gt;go.mod&lt;/code&gt; still named &lt;code&gt;x/text v0.42.0&lt;/code&gt;, while the module it depends on needs &lt;code&gt;v0.43.0&lt;/code&gt;, so every build used &lt;code&gt;v0.43.0&lt;/code&gt;. Trivy reads the version from &lt;code&gt;go.mod&lt;/code&gt; and looked for the license of a copy that no build ever downloads. &lt;code&gt;go mod tidy&lt;/code&gt; was the fix. The license check had found a stale &lt;code&gt;go.mod&lt;/code&gt; that the compiler never complained about.&lt;/p&gt;

&lt;p&gt;The check now prints the version it looked for, which would have made that obvious in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Published prerelease: &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-alpha.2" rel="noopener noreferrer"&gt;&lt;code&gt;v0.1.0-alpha.2&lt;/code&gt;&lt;/a&gt;. It still uses the old PostgreSQL pin and asks for an SMTP account at install.&lt;/li&gt;
&lt;li&gt;On &lt;code&gt;main&lt;/code&gt;, not released yet: these scans and the updated images, and an installation that needs no email at all. The installer creates the first account on the server, and the sign-in screens stop offering sign-up and password reset when no mail can be sent.&lt;/li&gt;
&lt;li&gt;Renovate is installed now. The first update pull requests should show up on Monday.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM and a domain name:&lt;/strong&gt; follow the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; and tell me where it breaks. Nothing has run on a real server with a public certificate yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question for the comments: when did you last scan the images you deploy, rather than the code you wrote?&lt;/p&gt;

</description>
      <category>security</category>
      <category>docker</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>All my tests were green. The first real install found five blocking bugs.</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Fri, 13 Nov 2026 22:03:48 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/all-my-tests-were-green-the-first-real-install-found-five-blocking-bugs-3l7e</link>
      <guid>https://dev.to/samuelmbabhazi/all-my-tests-were-green-the-first-real-install-found-five-blocking-bugs-3l7e</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt; is an open-source platform to deploy apps on your own servers, where the web panel never holds an SSH key. Each server runs an agent that connects out over mTLS and only accepts a closed list of typed actions.&lt;/p&gt;

&lt;p&gt;Until this week, no deployment had ever gone past &lt;code&gt;queued&lt;/code&gt; outside of tests. Then I ran the whole thing end to end for the first time: &lt;code&gt;docker compose up&lt;/code&gt; for the control plane, the agent installer on Ubuntu 24.04, then a deployment.&lt;/p&gt;

&lt;p&gt;About 600 unit tests were green. It took five fixes before one container served one request.&lt;/p&gt;

&lt;p&gt;None of the five was reachable by the tests I had, and for the same reason each time: &lt;strong&gt;each side was tested against a stand-in for the other.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The agent said "done" before it said what it had done
&lt;/h2&gt;

&lt;p&gt;The agent journals every action and reports each state change. The control plane closes an action on the first final update it receives.&lt;/p&gt;

&lt;p&gt;The agent sent "succeeded" from its journal notification, without the result. Then it sent a second "succeeded", this time with the container id. That second message arrived for an action that was already closed, and was dropped.&lt;/p&gt;

&lt;p&gt;So the container was created, the control plane concluded &lt;code&gt;The agent returned no container id&lt;/code&gt;, failed the deployment and removed the container. Every deployment, every time.&lt;/p&gt;

&lt;p&gt;The agent's test checked its &lt;em&gt;last&lt;/em&gt; update. The control plane's test fed it a single update. Both were right about their own side. The test I should have had from the start:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// The control plane closes the action on the first final update: it must hold the result.&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;updates&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="no"&gt;SUCCEEDED&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;GetContainerId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Fatalf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"a succeeded update was sent without its result: %v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. My fake Caddy was more polite than Caddy
&lt;/h2&gt;

&lt;p&gt;The agent creates its HTTP server in Caddy when it is missing, by walking up the config path until it finds something that exists. It expected &lt;code&gt;404&lt;/code&gt; for a missing path.&lt;/p&gt;

&lt;p&gt;Real Caddy answers a read below a missing parent with &lt;code&gt;400 invalid traversal path&lt;/code&gt;. My test fake answered &lt;code&gt;404&lt;/code&gt;, because that is what I assumed Caddy did.&lt;/p&gt;

&lt;p&gt;On a freshly installed server, Caddy's config holds nothing but its admin endpoint. So the walk failed on the first step, and no route could ever be added.&lt;/p&gt;

&lt;p&gt;The fix is small: a &lt;code&gt;400&lt;/code&gt; on a read counts as "missing", only during that walk. The more useful fix is that the fake now answers the way Caddy does.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Restarting the control plane took the site down
&lt;/h2&gt;

&lt;p&gt;In the compose file, Caddy shared the control plane's network namespace, so that it could reach the API on loopback:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;caddy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;network_mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service:control-plane&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A container that joins another one's namespace loses it when that one restarts. One restart of the API and the site answered nothing, until someone restarted Caddy by hand.&lt;/p&gt;

&lt;p&gt;Now both join a third service that only holds the namespace and the published ports, and has no reason to restart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;net&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'node'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'-e'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'setInterval(() =&amp;gt; {}, 2147483647)'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'80:80'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'443:443'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'7443:7443'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;control-plane&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;network_mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service:net&lt;/span&gt;
&lt;span class="na"&gt;caddy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;network_mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service:net&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No unit test finds this one. Restarting things on a running install does.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. An empty variable is not an unset variable
&lt;/h2&gt;

&lt;p&gt;SMTP credentials are optional. A compose file cannot omit a variable, it can only leave it empty, so I made the config schema read "empty" as "unset". With a unit test, which passed.&lt;/p&gt;

&lt;p&gt;In the running app, NestJS's &lt;code&gt;ConfigService&lt;/code&gt; falls back to the raw environment for a key that validation left undefined. It handed back the empty string. Every email then failed with &lt;code&gt;expose is not a function&lt;/code&gt;, inside a handler that hides SMTP errors on purpose, so that server responses and credentials are never stored.&lt;/p&gt;

&lt;p&gt;Sign-up needs a confirmation email. Nobody could create an account, and nothing said why.&lt;/p&gt;

&lt;p&gt;The unit test called the parser. The app calls the service.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;code&gt;docker.io/traefik/whoami&lt;/code&gt; is not &lt;code&gt;traefik/whoami&lt;/code&gt;. Except when it is.
&lt;/h2&gt;

&lt;p&gt;Two bugs behind one symptom.&lt;/p&gt;

&lt;p&gt;First, &lt;code&gt;docker.io&lt;/code&gt; does not serve the registry API: it redirects, and the API lives on &lt;code&gt;registry-1.docker.io&lt;/code&gt;. Resolving the image digest failed.&lt;/p&gt;

&lt;p&gt;Second, once resolved, the agent pulled &lt;code&gt;docker.io/traefik/whoami@sha256:…&lt;/code&gt; and checked that the local image carried exactly that name. Docker records it as &lt;code&gt;traefik/whoami&lt;/code&gt;. The pull succeeded and was reported as failed.&lt;/p&gt;

&lt;p&gt;Then the fix had a hole of its own, which a code review caught. Dropping the host from &lt;code&gt;docker.io/127.0.0.1/app&lt;/code&gt; gives &lt;code&gt;127.0.0.1/app&lt;/code&gt;, and Docker reads that as a registry on localhost. That goes straight past the check that keeps image pulls away from private addresses. Those references are now refused.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shortcut that cost a day
&lt;/h2&gt;

&lt;p&gt;When bug 5 first showed up, the run switched to the short name, &lt;code&gt;traefik/whoami&lt;/code&gt;, to keep going. A fix was written with unit tests, and merged. Nobody redeployed the &lt;code&gt;docker.io/…&lt;/code&gt; form that had actually failed.&lt;/p&gt;

&lt;p&gt;The next day, on a clean run from scratch, it failed again, one step further.&lt;/p&gt;

&lt;p&gt;I build Shipkeep with an AI coding assistant, and that shortcut was its call. It is also the most human shortcut there is: swap in the input that works, and promise to come back. The rule is now written down for both of us:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When something fails, fix the cause, then rerun the exact case that failed, in the place where it failed, before anything else moves.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Where it stands
&lt;/h2&gt;

&lt;p&gt;A first prerelease is out: &lt;a href="https://github.com/shipkeepdev/shipkeep/releases/tag/v0.1.0-alpha.1" rel="noopener noreferrer"&gt;&lt;code&gt;v0.1.0-alpha.1&lt;/code&gt;&lt;/a&gt;. The control plane image is signed and built for amd64 and arm64, next to the agent and CLI binaries.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ran with the published release, on one machine with Docker&lt;/td&gt;
&lt;td&gt;Control plane, sign-up, a server installed with the command from the Servers page, deployments, a rollback, a restart of the server's container&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not run yet&lt;/td&gt;
&lt;td&gt;A real server or VM and its reboot, a publicly trusted certificate, a real mail provider, arm64 at run time, an upgrade between two releases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not built yet&lt;/td&gt;
&lt;td&gt;Git providers and builds, multi-server networking and failover, managed databases, backups&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The "server" in that run was a privileged Ubuntu 24.04 container with systemd, not a real machine. The &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; lists exactly what was tested, and what was not.&lt;/p&gt;

&lt;p&gt;A security review of the code also found five issues. Three are fixed, one of them only in part: a quota on agent enrollment is still missing. Two are open because they need a decision: &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/301" rel="noopener noreferrer"&gt;no CPU or memory limit by default&lt;/a&gt;, and &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/302" rel="noopener noreferrer"&gt;a removed domain released while its route still serves&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM, a domain name and an SMTP account:&lt;/strong&gt; follow the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;installation guide&lt;/a&gt; and tell me where it breaks. After this week, I expect it to break somewhere. That report is the most useful contribution right now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You have an opinion on defaults:&lt;/strong&gt; the two open issues above need one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; the &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; each say what to change and when it is done.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use the prerelease on servers you can afford to lose.&lt;/p&gt;

&lt;p&gt;And a question for the comments: what is the bug your test doubles hid from you the longest?&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>devops</category>
      <category>selfhosted</category>
      <category>testing</category>
    </item>
    <item>
      <title>I'm building a self-hosted PaaS whose control plane never holds your SSH keys</title>
      <dc:creator>Samuel Mbabhazi</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:54:49 +0000</pubDate>
      <link>https://dev.to/samuelmbabhazi/im-building-a-self-hosted-paas-whose-control-plane-never-holds-your-ssh-keys-3996</link>
      <guid>https://dev.to/samuelmbabhazi/im-building-a-self-hosted-paas-whose-control-plane-never-holds-your-ssh-keys-3996</guid>
      <description>&lt;p&gt;Most ways of managing your own servers from a web panel start the same way: you hand the panel an SSH key, usually with root behind it. From then on, whoever compromises the panel has a shell on every server you own.&lt;/p&gt;

&lt;p&gt;I wanted to see how far you could get without that key, so I started &lt;a href="https://github.com/shipkeepdev/shipkeep" rel="noopener noreferrer"&gt;Shipkeep&lt;/a&gt;: an open-source (Apache-2.0) platform to deploy apps on your own servers, without Kubernetes, in TypeScript and Go.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It can't be installed yet&lt;/strong&gt;, and I'll be precise about that below. I'm writing this because the next step needs people other than me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: the server calls out
&lt;/h2&gt;

&lt;p&gt;The control plane never connects to your servers. Each server runs an agent, and the agent opens the connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You (web UI, CLI) ------------------&amp;gt; Control plane
Agent on server A --outbound mTLS---&amp;gt; Control plane
Agent on server B --outbound mTLS---&amp;gt; Control plane
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To add a server, an admin generates a join token that works once and expires after 15 minutes. The agent generates its own Ed25519 key pair and sends a certificate request with that token. It gets back a 30-day client certificate that only identifies that node.&lt;/p&gt;

&lt;p&gt;So there is no SSH key to steal from the control plane, and your servers don't need an inbound port for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agent only knows a closed list of actions
&lt;/h2&gt;

&lt;p&gt;An outbound connection isn't enough if the control plane can then send &lt;code&gt;sh -c "whatever"&lt;/code&gt;. So the agent has no generic command. Everything it can do is a typed message in one protobuf file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight protobuf"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Anything not defined here does not exist: there is no generic&lt;/span&gt;
&lt;span class="c1"&gt;// exec, shell or file-write action.&lt;/span&gt;

&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="nc"&gt;PullImage&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Must contain `@sha256:`.&lt;/span&gt;
  &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;image_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nc"&gt;RegistryCredentials&lt;/span&gt; &lt;span class="n"&gt;registry_credentials&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="nc"&gt;RemoveRoute&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;route_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;protobuf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="n"&gt;drain_timeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent talks to Docker through the Engine API and to Caddy through its admin API. Commands are argv arrays, never shell strings. Interactive exec exists, but only inside managed containers. There is no shell on the host.&lt;/p&gt;

&lt;p&gt;Adding an action to that list requires agent-side validation and tests with malicious input: path traversal, injection characters, oversized values.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this doesn't solve
&lt;/h2&gt;

&lt;p&gt;A compromised control plane is still a serious incident. It can't open a shell on your hosts, but it could ask agents to run a malicious container, and Docker access is powerful. This design shrinks what an attacker gets and makes it auditable. It doesn't make the problem disappear.&lt;/p&gt;

&lt;p&gt;If you see a hole in that reasoning, the &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/docs/THREAT_MODEL.md" rel="noopener noreferrer"&gt;threat model&lt;/a&gt; is public, and telling me what it misses is a real contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it actually stands
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;State&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Built and tested&lt;/td&gt;
&lt;td&gt;Accounts, 2FA, roles, audit log, CLI, most of the web UI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unit tested, &lt;strong&gt;never run on a real server&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Agent, deployment pipeline, rollback, Caddy routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Draft&lt;/td&gt;
&lt;td&gt;Installer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not built yet&lt;/td&gt;
&lt;td&gt;Git providers, builds, WireGuard network, failover, managed databases, backups, logs and metrics, previews&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No deployment has gone past &lt;code&gt;queued&lt;/code&gt; with the real worker and agent yet. That's the milestone I'm working toward.&lt;/p&gt;

&lt;p&gt;I'm the only maintainer for now, and I use AI coding assistants a lot. That's one more reason I want other people reading this code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where you can help
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You have a disposable Ubuntu 24.04 VM:&lt;/strong&gt; &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/171" rel="noopener noreferrer"&gt;run the installer draft&lt;/a&gt; or &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/216" rel="noopener noreferrer"&gt;try the first real deployment&lt;/a&gt;. A report saying "it broke at this step" is exactly what I need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Go:&lt;/strong&gt; &lt;a href="https://github.com/shipkeepdev/shipkeep/issues/244" rel="noopener noreferrer"&gt;fuzz the agent's action validators&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; read the threat model and try to break the reasoning. Please report vulnerabilities privately, as described in &lt;a href="https://github.com/shipkeepdev/shipkeep/blob/main/SECURITY.md" rel="noopener noreferrer"&gt;SECURITY.md&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First contribution:&lt;/strong&gt; six small &lt;a href="https://github.com/shipkeepdev/shipkeep/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; are ready.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://github.com/shipkeepdev/shipkeep/discussions/285" rel="noopener noreferrer"&gt;call for contributors&lt;/a&gt; lists everything else, including TypeScript and Angular work. There's no CLA, just &lt;code&gt;git commit -s&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And if you've run your own servers from a panel: what would you need to see before trusting one? I'd really like to know in the comments.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>go</category>
      <category>selfhosted</category>
      <category>security</category>
    </item>
  </channel>
</rss>
