Skip to content

feat: ship CVE-patched Dagger engine and Playwright MCP images, and scan third-party images nightly - #10529

Draft
joeyorlando wants to merge 7 commits into
mainfrom
joeyorlando/dagger-cve-gate-autoupdate
Draft

joeyorlando wants to merge 7 commits into
mainfrom
joeyorlando/dagger-cve-gate-autoupdate

Conversation

@joeyorlando

@joeyorlando joeyorlando commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • The backend runs one Dagger engine per organization, but the release CVE gate never scanned that image. A CRITICAL CVE in it shipped this way (fixed in fix(deps): update Dagger engine and SDK to 0.21.11 #10524).
  • Upstream's newest engine (v0.21.11) still has 39 fixable HIGH CVEs in its Go binaries: containerd, go-git, x/net, go-jose, go-archive and runc. No upstream release fixes them yet.
  • Dagger bumps were done by hand. One bump touches about 40 files (engine image, CLI build, vendored SDK, CI fixtures).
  • Six other third-party images a release runs unchanged were never scanned either: busybox (init and image pre-pull), the Cloud SQL Auth Proxy, the bundled Bitnami PostgreSQL and its exporter, and Playwright MCP. The pinned PostgreSQL alone had 114 fixable CRITICAL/HIGH findings.
  • The built-in browser ran Microsoft's Playwright MCP image unchanged: 4 CRITICAL / 19 HIGH fixable findings, all in Debian packages and in npm's bundled modules, which the server never runs.

Changes

Patched engine (platform/Dockerfile, new target dagger-engine)

  • Rebuilds every Go binary in upstream's engine image: dagger-engine, dagger, dagger-init, dial-stdio, dnsname and runc. It places them over the digest-pinned upstream image.
  • Uses the same CVE dependency floors as the existing CLI build. Those floors now live in platform/docker/dagger-deps.sh, so one change fixes both builds.
  • One guarded source patch is needed. Our dagger-dockercompat shim gives Docker's idtools.IDMap the field names of moby/sys/user, and only the engine compiles that mapping. The guard fails the build if upstream changes that code.
  • The Go toolchain moves from 1.26.9 to 1.26.10 for a stdlib HIGH CVE (CVE-2026-111943). This also applies to the platform image's other Go builds.

Shipped with each release, wired the same way as p4-shim

  • It is a release scan candidate. It is relayed and published as ghcr.io/archestra-ai/dagger-engine:<version> and pinned by the release digests. A dev image is published on main, and staging uses that image.
  • The backend uses the patched engine whenever the release digests include it. ARCHESTRA_DAGGER_RUNTIME_ENGINE_IMAGE overrides the choice.
  • When no digest is present, the backend uses the matching upstream image. That covers dev, CI e2e and the quickstart, which are unchanged.
  • New Validate Dagger Engine Image Build check: it builds the engine on PRs that change its inputs and smoke-tests that it runs a container.

Daily Dagger auto-update (.github/scripts/update-dagger.py, the dagger job in update-client-versions.yml)

  • Picks the newest stable Dagger release that has been public for at least 7 days.
  • Moves every Dagger pin together: engine base digest, CLI commit, CLI checksum, vendored SDK, and runc (following Dagger's own pin).
  • Checks each new value against upstream before writing. It stops without changing any file if the vendored SDK cannot carry over unchanged.
  • Opens a PR that needs review. Results go to the existing Slack notification.

Existing engines move to the current spec (dagger-environment-runtime/manager.ts)

  • Until now an engine StatefulSet kept its creation-time spec forever, so no Dagger bump or patched engine reached an existing organization.
  • Each engine's pod template now carries a hash of the template and its engine.json, and the StatefulSet records the platform version that wrote it. When the hash differs, a reconcile replaces only the pod template: the single engine pod restarts once and the cache PVC re-attaches.
  • An older platform never moves back an engine a newer one wrote, so a rolling upgrade's old replicas cannot downgrade it. A concurrent update is a conflict the next reconcile settles. A failed update is logged and never skips the engine's egress policy.
  • This replaces the "delete the StatefulSet" warnings, including the ones for the memory cap and scheduling.

Patched Playwright MCP (platform/Dockerfile, new target playwright-mcp)

  • Starts from the pinned upstream image, applies Debian's security updates, and removes npm, npx, corepack and yarn. The server starts with node /app/cli.js and never uses them.
  • Shipped like the Dagger engine. It is a release candidate, so it is scanned and holds a release on CRITICAL/HIGH. It is published as ghcr.io/archestra-ai/playwright-mcp:<version>, digest-pinned, with a dev image on main and staging.
  • The backend runs it whenever the release digests include it. The seed re-applies the image on every start, so existing browsers move to it on upgrade. ARCHESTRA_ORCHESTRATOR_PLAYWRIGHT_MCP_IMAGE overrides it. Without a digest (dev, e2e, quickstart) the backend uses the pinned upstream image.
  • The daily playwright-mcp updater now moves the Dockerfile base together with playwright-mcp-image.json. It refuses to run, and test_base_image_pins.py fails, when the two differ. Dependabot ignores that base.
  • New Validate Playwright MCP Image Build check: it builds the image on PRs and drives Chromium to a page through MCP.

Update notifications: the daily update workflow posts failures to #alerts (ci-release-image-scan-slack-webhook-url) and keeps proposed PRs in #approvals.

Third-party images in the nightly scan (upstream_matrix in release-image-policy.py)

  • Reads each pin where it is defined in the chart's values.yaml. The nightly release image scan checks each pinned reference and alerts in #alerts. These images never hold a release.
  • These infrastructure images (busybox, Cloud SQL Auth Proxy, PostgreSQL and its exporter) alert on fixable CRITICAL only. An image added later alerts on CRITICAL and HIGH unless listed.
  • A chart image default that is neither built here nor listed fails the policy tests, so a new image cannot ship unscanned.
  • Pin refreshes: Cloud SQL Auth Proxy 2.26.3 → 2.28.0 (clears a HIGH x/net finding), PostgreSQL 18.4.0 → 18.7.0 (114 → 1 finding), exporter to its current digest (101 → 12). 2.28.0 and both Bitnami digests are inside the 7-day cooldown (published Nov 11).
  • Dependabot now moves the Cloud SQL Auth Proxy pin (platform/helm/archestra, main only). Its digest now rides in the tag, because Dependabot ignores a separate digest: key. The Bitnami images stay manual: their only tag is latest, and a new digest can be a new PostgreSQL major.

Follows the recent release supply-chain PRs (#10711, #10734)

  • The engine base is a literal FROM image:version@sha256:… line. Dependabot ignores it, because it moves with DAGGER_VERSION and update-dagger.py owns it.
  • The engine's CI build jobs pass attestations: write, and the nightly release image scan includes dagger-engine.

Testing

  • Ran the dagger-engine target built from this branch (arm64): Trivy finds 0 fixable CRITICAL or HIGH CVEs, down from 39. The engine pulls alpine and runs a container through the rebuilt runc.
  • Release-policy tests pass, including the check that every candidate image is published by a release caller and the hold-on-failure check.
  • Backend tests: config.test.ts and manager.test.ts pass (566 tests). Backend type-check passes.
  • check-dagger-version-sync.sh passes, and fails as expected when a pin drifts.
  • The updater tests run against a local fake of every upstream service. Resolving v0.21.11 from the real upstream reproduces every pin in this branch.
  • Trivy (amd64) on every pinned third-party image, before and after the refresh: busybox ×2 clean, proxy 2.28.0 clean, PostgreSQL 18.7.0 1 HIGH, exporter 12 HIGH, Playwright MCP 4 CRITICAL / 19 HIGH.
  • PostgreSQL 18.7.0 starts with pgvector 0.8.7, and it starts on an 18.4.0 data directory and reads back its rows.
  • helm unittest: 631 passed. CI script tests: every new test passes, and the remaining failures are the same set main fails on macOS.
  • Patched Playwright MCP built from this branch (arm64): Trivy finds 0 fixable CRITICAL/HIGH, down from 23. The workflow's smoke script, run as written, lists 25 tools and renders a page in Chromium.
  • Backend: config.test.ts (524) passes, type-check passes, knip passes. Playwright updater tests: 14 pass, including the new drift check.
  • The new notify script, run locally with a stubbed curl, sends failures to #alerts and proposals to #approvals. A missing webhook skips only its own channel.
  • Engine updates, live on a Tilt dev stack (OrbStack): I stripped the new annotations from an engine and put it back on upstream v0.21.11, so it matched what an older release leaves behind. I wrote a marker file into its cache, then restarted the backend with the locally built patched engine. Results:
    • The engine moved to the patched image (engine v0.21.11, runc v1.4.2). The same PVC stayed attached and the marker survived.
    • run_command worked through the MCP gateway, including uv add from PyPI.
    • Restarting again with the same settings changed nothing (same generation, same pod).
    • A backend running as 1.5.0-rc.20 left an engine written by rc.33 alone and still applied its egress policy.
    • Two reconciles in parallel: one updated and one hit a 409 and backed off, giving one rollout.
    • A command running during the restart returned "engine unreachable"; the next command worked.
  • Unit tests against the real Kubernetes client and a fake API server cover: a legacy engine updating, an unchanged one left alone, a resource-only change, the version guard (including rc.9 < rc.10), and a failed or conflicting update. Disabling the update fails 4 of them; removing the version guard fails 1.
  • zizmor reports nothing. actionlint shows only the repo's $/ convention and a warning that was already there.

Not covered

  • Each engine restarts once on the first upgrade with this change, because existing engines have no spec hash yet. A sandbox command running at that moment fails with "engine unreachable", and the next command works.
  • Quickstart. It still bundles and runs the upstream engine.
  • amd64 build. Not built locally. It runs first in CI (Validate Dagger Engine Image Build).
  • Base-image signatures. Once the org's Dockerfile base-image signature policy is enforced, registry.dagger.io/engine needs an entry in its trust list.
  • Playwright MCP's amd64 build runs first in CI. Each release build pulls Debian's newest fixes, so its bytes differ between releases; the release still scans and publishes exactly what it built.
  • busybox is scanned but moves by hand: its chart keys are not image: keys Dependabot reads.

@joeyorlando
joeyorlando force-pushed the joeyorlando/dagger-cve-gate-autoupdate branch from e4d4742 to df14067 Compare November 13, 2026 23:28
@joeyorlando joeyorlando changed the title ci: gate releases on Dagger engine CVEs and propose Dagger updates daily feat(sandbox): ship a CVE-patched Dagger engine and propose Dagger updates daily Nov 13, 2026
The release scan only covered images built here, so the Dagger engine the
backend provisions for every organization shipped unscanned. Version-changing
merge groups now scan the pinned ENGINE_IMAGE reference on amd64 and arm64
under the same Critical/High fixable-CVE policy, and Release Image Security
requires those legs to pass.

A daily `dagger` job in update-client-versions.yml runs the new
.github/scripts/update-dagger.py, which moves every Dagger pin together once a
stable release is 7 days old. It resolves and verifies the tag commit, engine
index digest, CLI checksum and crate checksum, re-vendors the SDK sources, and
stops without edits when the vendored SDK cannot carry forward unchanged.
Replayed against the tree before #10524, it reproduces that PR byte for byte.
Upstream's Dagger engine v0.21.11 carries 39 fixable HIGH CVEs in its Go
binaries (containerd, go-git, x/net, go-jose, go-archive, runc), and no
upstream release fixes them yet.

The new `dagger-engine` target of platform/Dockerfile rebuilds every Go
binary in upstream's engine image (dagger-engine, dagger, dagger-init,
dial-stdio, dnsname and runc) with the dependency floors the CLI build
already uses, now shared through platform/docker/dagger-deps.sh, and lays them
over the upstream image. The Go toolchain moves to 1.26.10 for a stdlib HIGH.
Trivy finds no fixable CRITICAL or HIGH CVE in the result, and the engine runs
containers end to end.

The engine ships like p4-shim: it is a release scan candidate, relayed and
published as ghcr.io/archestra-ai/dagger-engine:<version>, and pinned by the
release digests. The backend runs it when the release digests include it
(ARCHESTRA_DAGGER_RUNTIME_ENGINE_IMAGE overrides) and otherwise falls back to
the matching upstream image, so dev, e2e and the quickstart are unchanged.
Existing engines keep their image; the backend now warns when one differs.

The separate upstream-image scan from the previous commit is removed: the
patched engine is scanned as a candidate, and the upstream image would fail it.
The updater also moves the engine base digest and follows the runc version
Dagger's own engine build pins.
…e Dagger engine

The patched engine's base sits on a literal versioned digest FROM line, like
every release-image base, and Dependabot leaves it to update-dagger.py because
it moves with DAGGER_VERSION and the vendored SDK. Its CI builds attest the
images they push, and the nightly release image scan covers it.
The release scan covered only images built here, so the busybox init and
pre-pull containers, the Cloud SQL Auth Proxy, the bundled PostgreSQL and its
exporter, and Playwright MCP shipped unscanned. upstream_matrix reads each pin
from where it is defined. Version-changing merge groups scan the pinned
references on both architectures, and the nightly release image scan covers
them too.

Postgres, its exporter and Playwright MCP have fixable Critical/High findings
that no newer upstream image removes yet, so ADVISORY_UPSTREAM_IMAGES keeps them
out of the gate and only the nightly scan reports them. A chart image default
that is neither built here nor listed fails the policy tests.

The Cloud SQL Auth Proxy carries its digest in the tag, so Dependabot moves the
tag and digest together on main; the Bitnami images stay manual. This moves the
proxy to 2.28.0 (clears a High golang.org/x/net finding), and the Bitnami
PostgreSQL pin from 18.4.0 to 18.7.0 and its exporter to current digests, which
drops their fixable findings from 114 and 101 to 1 and 12.
@joeyorlando
joeyorlando force-pushed the joeyorlando/dagger-cve-gate-autoupdate branch from df14067 to cab2247 Compare November 15, 2026 03:36
@joeyorlando joeyorlando changed the title feat(sandbox): ship a CVE-patched Dagger engine and propose Dagger updates daily feat(sandbox): ship a CVE-patched Dagger engine and scan every third-party image a release runs Nov 15, 2026
Third-party images the platform runs unchanged leave the release gate; only
the nightly release image scan covers them. Infrastructure images (busybox,
the Cloud SQL Auth Proxy, the bundled PostgreSQL and its exporter) alert on
fixable critical findings only, since less untrusted input reaches them.
Anything else, such as Playwright MCP, alerts on critical and high.
@joeyorlando joeyorlando changed the title feat(sandbox): ship a CVE-patched Dagger engine and scan every third-party image a release runs feat(sandbox): ship a CVE-patched Dagger engine and scan the third-party images a release runs Nov 15, 2026
…ease

The built-in browser ran Microsoft's Playwright MCP image unchanged, with 4
critical and 19 high fixable findings, all in Debian packages and in npm's own
bundled modules. The server never runs npm: it starts with `node /app/cli.js`.
The new `playwright-mcp` target of platform/Dockerfile starts from the pinned
upstream image, applies Debian's security updates and removes the package
managers. That leaves no fixable critical or high finding.

It ships like the Dagger engine. It is a release candidate, so it is scanned
and holds a release on critical and high findings. It is published as
ghcr.io/archestra-ai/playwright-mcp:<version> and pinned by the release
digests, with a dev image on main and staging. The backend runs it whenever
the release digests include it, and running browsers move to it on restart.
ARCHESTRA_ORCHESTRATOR_PLAYWRIGHT_MCP_IMAGE overrides it. Without a digest the
backend keeps the pinned upstream image. The daily playwright-mcp updater moves
the Dockerfile base together with playwright-mcp-image.json, and it fails, as
does test_base_image_pins.py, when the two disagree. Validate Playwright MCP
Image Build builds the image on PRs and drives a page with it.

The daily update workflow now posts failures to #alerts, and proposed updates
stay in #approvals.
@joeyorlando joeyorlando changed the title feat(sandbox): ship a CVE-patched Dagger engine and scan the third-party images a release runs feat: ship CVE-patched Dagger engine and Playwright MCP images, and scan third-party images nightly Nov 15, 2026
An engine StatefulSet kept the spec it was created with forever, so no Dagger
bump, patched engine, sandbox memory cap or scheduling change reached an
existing organization until someone deleted it by hand.

Each engine's pod template now carries a hash of the template and its
engine.json, and the StatefulSet records the platform version that wrote it.
When a reconcile finds a different hash, it replaces only the pod template:
Kubernetes restarts the single engine pod, and the cache PVC (an immutable
volumeClaimTemplate) re-attaches. A platform older than the one that last
wrote the engine leaves it alone, so the old replicas of a rolling upgrade
cannot move it back. A concurrent update by another replica is a conflict that
the next reconcile settles. A failed update is logged and never skips the
engine's egress policy. Engines created before this change carry no hash, so
each moves to the current spec once. This replaces the "delete the StatefulSet"
warnings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant