Repository navigation
fix(studio): harden the image supply chain and pin one Node major - #2133
Merged
Merged
Conversation
Run Studio on a single Node major, set by apps/package.json engines (>=26 <27): .node-version, the builder stage, the esbuild target, @types/node, and the Chainguard runtime all agree. Node 25+ ships a global Web Storage that shadows jsdom's, so the web Vitest workers run with --no-experimental-webstorage, and the builder installs corepack explicitly because Node 25+ no longer bundles it. Public Chainguard only serves `latest`, so the runtime digest cannot be version-constrained. The CI studio job now loads the built image and fails when its Node major falls outside engines, when it runs as root or can write its own code, or when it cannot boot against an offline mecated --mock. Renovate reviews that digest in its own PR and never proposes Node 27 for the builder, .node-version, or @types/node. The runtime moves to a root-owned /opt/studio: the base image's /app is world-writable, and WORKDIR inherits the base's non-root user. publish-studio pushes by digest, scans with Grype (critical, fixable only, as in SEP), signs, attests, verifies the signature and both attestations against release.yml at the release tag, and only then tags :<VERSION> and :latest, so a failed step can no longer leave an unsigned :latest. CI runs the same Grype gate and a pnpm audit of the production dependencies. The job also takes its version from the guard like its siblings, drops a provenance branch the checkout assertion already makes unreachable, and completes its OCI labels. The Studio deployment guide verifies against the release workflow at the pinned tag and documents deploying by digest with a read-only, non-root, capability-free security context. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JAORMX
approved these changes
Oct 6, 2026
shellcheck (SC2086) rejects the unquoted `set -- $want` that split the engines range into its bounds. Read the lower and upper bound separately instead; behavior is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JAORMX
approved these changes
Oct 6, 2026
rdimitrov
approved these changes
Oct 6, 2026
Merged
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the Mecatl Studio image supply chain and puts Studio on a single Node major. The comparison point is the SEP cloud-ui release pipeline.
Route: Routine. There is no product behavior change, and the base image stays Chainguard as ADR 0351 decides (decision 6), so no ADR amendment is needed.
One Node major everywhere
apps/package.jsonengines(>=26 <27) is now the source of truth..node-version, the builder stage (node:26-slim), the esbuild target (node26),@types/node, and the Chainguard runtime all match it.latest, so its digest cannot be version-constrained. Two guards cover that:studiojob rejects an image whose Node major falls outsideengines.studio node runtimePR for that digest. It never proposes Node 27 for the builder image,.node-version, or@types/node.localStorage, which broke 77 web tests. The web Vitest workers now run with--no-experimental-webstorage.[email protected]).Image
/opt/studio./appis world-writable, so the server process could replace its own code.WORKDIRalone was not enough: it creates the directory as the base image's user, 65532. The Dockerfile now switches to root for the copy steps.:latest@sha256:…, and the stale "Node v26.9.0" pin comment is replaced with the rule that governs it.CI (
studiojob)task studio:audit:pnpm audit --prod, which covers what the image ships.engines;mecated --mockthe integration step builds, using both listeners, and/api/v1/statusreportsreachable.Release (
publish-studio)The order is now: push by digest (no tags) → Grype (
critical,only-fixed, as in SEP) → cosign sign → SBOM attest → provenance → verify → tag. Details:cosign verifyplusverify-attestationfor bothspdxjsonandslsaprovenance1, against the exact identityrelease.yml@refs/tags/<VERSION>.:<VERSION>and:latestare applied only after verification, and the step then asserts that both tags resolve to the signed digest.:latestlive.needs: [guard, validate-release-ref]andVERSIONfromneeds.guard.outputs.version.BUILT != RUN_SHAbranch is gone. The checkout assertion directly before it already makes it unreachable.version,licenses,description, anddocumentation.Docs (
user-docs/building/deployment/studio.md)--certificate-identity-regexp '^https://github.com/stacklok/mecatl/'accepted a signature from any workflow on any ref.securityContext: documented as read-only root filesystem, non-root, no capabilities, and no privilege escalation.Verification
All local runs used Node 26.10.0 and pnpm 12.4.2.
Studio gates
task studio:check: Biome, typecheck, generated-contracts check, server 171/171, web 567/567.task studio:audit: no known vulnerabilities.task studio:test:integration: 8/8.task studio:browser: 42/42 Playwright journeys.Image (
task studio:image)mecated --mockand/api/v1/statusreportsreachable. Both/and/api/healthreturn 200.--read-only --cap-drop ALL --security-opt no-new-privileges./opt/studionot writable.v0.0.44image (/appwritable).host.docker.internalplus a static token, because Docker Desktop on macOS has no host networking. The CI step uses--network hoston Linux, the same as the existing Slack bot image validation.Grype (
--only-fixed --fail-on critical) passes on the new image. There are 4 fixable High findings, all in the npm that Chainguard bundles (/usr/lib/node_modules/npm, apknpm-12), not in Studio code. Newer Chainguard digests fix them, and the dedicated Renovate PR will bring them in.Signing commands
cosign verifyandverify-attestation(spdxjson,slsaprovenance1) with the exact tag identity pass against the publishedv0.0.44.gh attestation verify --signer-workflow … --source-ref refs/tags/v0.0.44passes, and a wrong--source-reffails.Tagging:
docker buildx imagetools createfrom a single index keeps the digest. I checked this against a local registry with a multi-arch push-by-digest image, and the job also asserts it.Repository checks
task lint:actions: actionlint is clean.microvm-ci-release_test.shfails on darwin-arm64 with "built-in microVM release defaults do not exactly match", identically on unmodifiedmain. It is unrelated to this change.renovate-config-validator --strictpasses.task lintpasses.task test:racepasses everywhere except four microVM tests on darwin-arm64, which this PR does not touch (it changes no Go code):microvmmanagerTestDevelopmentRelease*(×2): "release bundle omitted the platform manifest".gitexecTestRunInDirUsesDescriptorAndPassesArgumentsOpaquely.environment/microvmTestForkOperationPinEndsBeforeChildOwnerLifetime(git branch: signal: killedunder full-suite load).main. The fork test passes in isolation onmain.task docsandtask site:buildpass.Notes for reviewers
studioCI job (it moves the Playwright step after integration). Whichever PR lands second needs a trivial rebase.js-yamlvia@hey-api/openapi-ts,source-map-jsvia vitest/vite).pnpm audit --prodintentionally covers the shipped closure only..ko.yamlchainguard/staticdigest has no Renovate manager (mecated/mecak8s images).publish-slack-bothas the same "tags before signing" shape.resolve-brood-base(exec format erroron the arm64 digest helper), which skips the mecated and mecatui images. The Studio image is unaffected.latestmoves to Node 27 (~April 2027), the Renovate PR turns red. Moving to 27 then means bumpingengineson purpose, or changing the base.🤖 Generated with Claude Code