DevOps by Default Blog

GoatFlow 0.11.0: Plugins That Sign Themselves, a Sandbox the Kernel Enforces, and a Helpdesk That Refuses Root


GoatFlow 0.11.0 is a minor release, not a patch, and that was the decision: six breaking changes (signed plugins by default, a network permission for plugins that connect directly, internal hosts named per plugin, Go 1.25+ for the plugin SDK, a refusal to run as root, and the Landlock sandbox) did not fit in a patch number. It is 19 commits, 277 files and 40 changelog entries against 0.10.0. The changelog carries the user-facing detail, including the upgrade notes. This post covers the engineering underneath, and the thread running through all of it is the same: a security property that existed as a convention, or as a claim on a website, turned into something the platform enforces — or the claim came down.

Plugins That Sign Themselves

A wax seal on an old letter

The Problem

Plugin signing existed in 0.10.0 as an opt-in: set GOATFLOW_REQUIRE_SIGNATURES=1 and the loader checked .sig files. Turning that flag on stopped every plugin from loading, for two reasons that had nothing to do with signatures being a bad idea. The loader had no trusted keys at all — there was no built-in publisher key to check against — and release packages signed only the ZIP, never the binary inside it. The marketplace index carried a public key per entry, but the platform treated a key from the index itself as trustworthy, which is the same as not checking it.

So the honest state of 0.10.0 was: plugins unsigned, signatures untestable, and a website that said otherwise in one place. We had the choice of softening the claim or making it true.

The Solution

Signatures are required by default. Every gRPC binary and every WASM module needs a .sig from a trusted publisher, checked on every start, and before a marketplace install or upload replaces anything — a refused upload is a 400, a refused install a 422. The GoatKit publisher key is built in; GOATFLOW_TRUSTED_KEYS and GOATFLOW_TRUSTED_KEYS_FILE add others, and a key named in a marketplace entry is no longer trusted by itself.

The release pipeline now signs at both levels: the plugin binary inside the package, and the package itself, with the ed25519 key whose public half is published in the marketplace index. Release images ship the bundled plugins already signed — a release build without the signing key fails, so an unsigned bundle cannot be produced by accident. For development systems that run plugins built from source, GOATFLOW_REQUIRE_SIGNATURES=0 loads unsigned plugins with a warning at start-up; the Helm chart exposes config.plugins.requireSignatures and trustedKeys, and Admin → Plugins → Upload takes the signature file alongside a .wasm.

The Benefits

The supply chain now closes at the plugin boundary: an attacker who swaps a plugin binary in a volume gets a signature check, not a plugin. The first-party plugins carry binary signatures — Knowledge Base from 0.2.2, Kanban from 0.1.2 — and Knowledge Base 0.2.3 shipped alongside GoatFlow 0.11.0. The cost is real and stated in the upgrade notes: a third-party plugin from a publisher whose key you haven’t added stops loading, and a development stack that builds plugins from source needs the override. That is the intended trade — a default that is safe, with a loud, local way to be unsafe.

A Sandbox the Kernel Enforces

An empty birdcage

The Problem

gRPC plugins run as the same user as goats, the backend. That is fine for everything the sandbox was meant to control, and fatal for the one thing it never controlled: because the plugin process ran as the same user, it could read /proc/<pid>/environ of the backend — the database password, GOATFLOW_SECURE_KEY, the JWT signing secret — and it could signal the backend’s processes. The plugin’s own environment never carried those values; the kernel’s procfs did.

The isolation that was supposed to cover this had a quieter problem. The mount and PID namespaces were applied only when GoatFlow ran as root outside a container, and standard containers refuse unprivileged user namespaces, so in every normal deployment the namespaces were silently off. The feature existed, the claim existed, and the enforcement did not.

The Solution

Two changes, both unprivileged, both working in standard containers.

goats marks itself non-dumpable at start-up (PR_SET_DUMPABLE=0). Its /proc files — environment, memory, open files — then belong to root, and no process running as the same user can read them, on any kernel. The backend’s own access to /proc/self is unaffected; the launcher starts plugins before it needs anything from its own procfs.

The new goatflow-plugin-exec launcher, shipped next to goats, confines every gRPC plugin with Landlock before the plugin runs:

goatflow-plugin-exec, in order
  1. heap cap     GOMEMLIMIT from memory_mb (default 512 MB)
  2. CPU share    GOMAXPROCS from cpu_millis (default 1000), nice down
  3. seccomp       only the Unix socket back to goats; TCP bind/connect
                   only with the `network` permission
  4. Landlock      read its own directory and system paths, write only
                   its temp dir, no /proc at all — other processes are
                   invisible: no process list, command lines, status.
                   Linux 6.7+: no TCP without `network`.
                   Linux 6.12+: no signals outside the sandbox.
  5. exec          the plugin runs confined; if a limit can't be
                   applied, the plugin is not started

The namespace setup is gone rather than kept “for bare metal”: GoatFlow no longer runs as root, so the root-only path that applied them had no caller, and container profiles refuse them anyway.

The Benefits

A plugin can no longer read GoatFlow’s secrets or signal it, on kernels from 5.13 up — which is every kernel this project runs on. On an older kernel the plugin starts with a warning, and Admin → Plugins → Limits shows exactly what the kernel enforces and which version enables the rest, instead of the platform pretending. The cost is for plugin authors: a plugin that writes outside its TMPDIR, reads outside its own directory, or reads /proc (including os.Executable) now gets “permission denied”, and data goes through the HostAPI. The upgrade notes name the five first-party plugins that had to declare the access they actually use before this release: goatkit-llm, goatkit-memory and goatkit-tts for network, goatkit-rag (Tika) and goatkit-chat (Browserless) for localhost.

Limits the Host Actually Enforces

The Problem

Per-plugin policy values existed since the plugin manager arrived — memory, CPU, timeouts, rate limits — and were stored in the database. Of those, only the rate limits and the permissions were applied. WASM plugins ran at a fixed 16 MB and 30 seconds no matter what the policy said. gRPC plugins had no memory limit, no CPU limit and no time limit at all: one plugin’s runaway loop or leaked buffer was the host’s outage.

The Solution

The launcher above is also the enforcement point for gRPC plugins: memory_mb becomes a heap cap (default 512 MB, raised per plugin on the Limits page when a plugin genuinely needs more — an image-generation plugin talking to an LLM is the example that came up), cpu_millis becomes GOMAXPROCS, and where the host delegates a writable cgroup v2 each plugin also gets hard cpu.max and memory.max. A plugin whose limits can’t be applied is not started. call_timeout bounds every call; init_timeout (default 10 s) bounds Init, and a plugin that doesn’t finish initialising is not registered. WASM plugins get memory_mb as their limit, and a call past its timeout is now stopped instead of running on.

Network access got the same treatment. A gRPC plugin can’t open connections unless it declares the network permission — the seccomp filter allows only the Unix socket it uses to talk to GoatFlow. Plugin HTTP requests through the host refuse loopback, private, link-local and other reserved addresses unless the plugin’s http scope names that host exactly (wildcards never reach them), checked on every resolved address when connecting; cloud metadata addresses are always refused. Redirects are limited to five, each re-checked, with credential headers dropped when the host changes. Responses over the plugin’s max_http_response_mb (1–1024 MB, 32 by default) are an error, and proxy environment variables are no longer consulted for plugin requests.

The Benefits

Admin → Plugins → Limits shows and edits each plugin’s memory, CPU, call and start-up timeouts, rate limits, network access, response size and allowed internal hosts, and says which parts the kernel and the cgroup actually enforce for that plugin — the same honesty pattern as the Landlock note. Start-time limits restart the plugin; timeouts apply at once; every change is audited. An admin can now name the Tika or Browserless sidecar at a custom address for the one plugin that needs it, without opening the network to every plugin.

Every Container Runs as Non-Root

The Problem

This one has been a founding principle of the project for longer than the code has: nothing in the stack runs as root. The GoatFlow images did. Everything around them didn’t. MariaDB, PostgreSQL and Valkey started as root in every compose file — their entrypoints only dropped to the service user after starting, which is too late for the principle. Caddy ran as root in the deploy compose. smtp4dev, the plugin-init container that chowned the plugins volume, and the PostgreSQL pod in the Helm chart ran as root. The Makefile’s tooling containers ran as root too, and CI had a root cache-chown step and a root chmod container.

The Solution

Every service now starts as its image’s service user: MariaDB 999, PostgreSQL 70, Valkey 999. Caddy and smtp4dev are rebuilt from their images with their data directories handed to UID 1000 — Caddy keeps ports 80 and 443 through its binary’s cap_net_bind_service, not through root. plugin-init is removed, because a new plugins volume already belongs to the app user. The Helm PostgreSQL pod runs as UID 70 with a read-only root filesystem and all capabilities dropped, like the MariaDB pod. Makefile tooling containers (Trivy, Gitleaks, Dive, curl) run as the calling user, and the release demo smoke test runs as the runner user.

And goats itself refuses: the backend, runner and customer frontend exit at start-up when their user id is 0, with “GoatFlow must not run as root”. The image was tested with --user 0:0 before the tag: it exits, loudly.

The Benefits

The founding principle is now true of the whole stack, verified per container by host process UID rather than by trusting an entrypoint. One upgrade step is documented and one-off: volumes written by root are handed over once (docker compose run --rm --no-deps --user 0 --entrypoint chown caddy -R 1000:1000 /data /config in deploy/), and the release workflow now performs that handover automatically on the demo before docker compose pull. The one honest exception is documented rather than hidden: TrueNAS’s own permissions helper still runs as root, without network, to set dataset ownership — it is TrueNAS’s code, not ours.

One Audit Log

The Problem

Before 0.11.0, the platform stored admin 2FA overrides, and wrote 2FA events to the application log. Sign-ins, password changes, API token issuance and admin configuration changes were not recorded anywhere. An operator asking “who changed this queue’s permissions, and when” had no answer, and the admin guide’s compliance story was a claim without events behind it.

The Solution

Security-relevant events now land in one table, gk_audit_event, listed at Admin → Audit Log with filters and CSV export:

  • Sign-in: success and failure for password, LDAP, OIDC, SAML and passkey, with the reason for a failure; rate-limited attempts; the 2FA step including locks, recovery-code use and IP mismatch; sign-out.
  • Credentials: 2FA and passkey changes, password changes, reset requests and resets, admin password resets, API tokens created and revoked, sessions ended by an administrator.
  • Admin changes: every write through an admin page or admin API, and every admin request refused to a signed-in user, recording which fields changed across users, groups, roles, permissions, queues, customers, organisations, identity providers, webhooks, plugins, PostMaster filters and the dynamic-module pages.
  • Read access (opt-in): with “Record read access” on, ticket views, attachment downloads and statistics exports. Exports of the audit log itself are always recorded.

Secrets are never stored: a changed password, token, key or client secret shows as [redacted]. Events are kept 365 days by default and purged daily by the runner’s audit-retention job; each event is also written to the application log as an audit line. Migration 000035 copies the existing admin_action_log rows into the new table and drops the old tables, so the upgrade keeps history instead of starting empty.

The Benefits

The admin guide can now describe what is actually recorded, at event level, and the Recent Activity dashboard reads from the same table. The scope decision is stated too: tamper evidence — hash chaining, so a rewritten history is detectable — is left to the goatkit-audit plugin rather than half-built into the core. A log you can’t prove hasn’t been edited is a log of behaviour, not of evidence, and the release says which one you’re getting.

Provenance You Can Check

The Problem

The 0.10.0 release notes claimed the container images were signed, and gave a cosign verify command. The command reported “no signatures found”: the images had a signed SLSA build-provenance attestation and an SBOM, but no signature. Only the two images had provenance; the Helm chart and the air-gapped bundle had none. And the vulnerability story was manual: govulncheck was a Makefile target run by hand, and Go 1.25 — the version everything was built on — no longer receives security fixes.

The Solution

The release workflow now signs the main and runner images keylessly with Sigstore cosign: the certificate identity is build.yml at the release tag, so no signing key is stored anywhere. Every release artifact carries a signed SLSA v1.0 provenance attestation — both images, the Helm chart in the OCI registry and as the .tgz, and the air-gapped bundle — which is SLSA v1.0 Build Level 2 on GitHub-hosted runners. Plugin releases carry the ed25519 signature of the previous section, verified against the marketplace index key.

govulncheck runs in CI and fails the build when GoatFlow or the plugin SDK calls code with a known vulnerability. Running it was the argument for the Go bump: on Go 1.25.12 it found 25 vulnerabilities reachable from GoatFlow code, most in the standard library — HTTP/2 and the HTTP servers, TLS, html/template, x509 certificate distrust, XML and ASN.1 decoding — the rest in golang.org/x/net and excelize. On Go 1.26.10 it finds none. The excelize case is pinned honestly: six high-severity advisories in .xlsx parsing are fixed only on excelize’s main branch, so GoatFlow pins that commit until v2.11.1 is tagged, rather than claiming a fixed version that doesn’t exist.

Dependency updates are proposed automatically now: .github/dependabot.yml opens weekly update PRs against dev for Go modules, the Bun lockfile, GitHub Actions, Dockerfile and Compose base images and the Helm chart, grouped per ecosystem, with nothing merged automatically. The stale package-lock.json — untouched since July while the image is built from bun.lock, so Dependabot reported on versions that were not shipped and missed ones that were — is removed, along with the unused wrangler dev dependency that pulled in 19 advisories.

The Benefits

On v0.11.0 the commands in the release notes work: cosign verify against the release identity, and gh attestation verify for provenance on the images, the chart and the bundle — all checked during the release, not after. 0.10.0 and earlier images remain unsigned, and the notes say so, rather than implying the whole release history is verifiable. And a scheduled govulncheck run that fails with no code change is now a triaged event — a new vulndb entry, checked against upstream fixes — instead of a mystery red CI.

Also in This Release

Shorter items, each in the changelog: inbound mail can be classified by a decision model (goatkit-llm’s llm_decide picks queue, priority and type in one request, off by default, fails open, and skips anything an explicit rule already routed); plugins can be an app for the agents in their groups, with per-group branding and landing (GKRegistration.AppMode); agents can set their time zone, carried into every plugin call as _user_timezone so “today” means the person’s day; plugins can read article attachment bytes and set Content-Disposition on binary responses; GenerateThumbnail rasterises PDFs; marketplace installs pull in the plugins a plugin depends; the Knowledge Base screens are translated in all 15 languages; and PostMaster filter rules that set a priority by name, a ticket type or a state now actually apply.

Lessons

The 0.10.0 post ended with the observation that the dangerous failures were the quiet ones. This release is the same lesson applied to ourselves: the quiet failures were the claims. A website that said images were signed, when they weren’t. A sandbox feature that was off in every real deployment. Limits that were stored and never applied. “Every container runs as non-root”, true of our images and false of everything around them. None of these crashed; each one produced a system that looked secure and wasn’t. The fix in every case was the same shape: make the property true at a boundary the code can’t skip — a signature check in the loader, a Landlock rule in the kernel, a refusal to start as root — and where the property can’t be made true everywhere, say which part isn’t (the TrueNAS helper, the pre-5.13 kernel, the unsigned 0.10.0 images).

The second lesson is that the kernel is an unprivileged ally. The sandbox this release ships needed no privileges, no user namespaces and no root: Landlock and one prctl call close, in standard containers, exactly the hole that the root-only namespace setup was supposed to close and silently didn’t. The hardening that works is the hardening that runs everywhere.

The third is about verification as a habit. Every security line on the website was audited against code or live output before this release shipped, and two claims that failed the audit were implemented instead of reworded. The release notes now contain only commands that were run, and the run that found them is this one.


GoatFlow on GitHub · Changelog

Photos: CC0 from Wikimedia Commons. Birdcage, The Metropolitan Museum of Art, open access. Wax seal from Loudoun Castle, photo by Rosser1954 (Roger Griffith).