sec: non-root + healthchecks for stateless sidecars (control-plane, worker, panel)#25
Merged
Merged
Conversation
…e, worker, panel) trivy DS-0002 (image runs as root) on the three stateless services. Each is a pure network client — no root, no docker socket, no local writes: - control-plane provisions via the Coolify HTTP API (not a mounted docker.sock), connects to Postgres, and runs pg_dump/pg_restore for cutover. - worker is a pg-boss consumer + GitHub API + HMAC HTTP callbacks. - panel is a Next standalone server that only reads its own bundle. Add `USER node` (uid 1000, ships in node:22-alpine) after chowning the app tree so pnpm/tsx can read deps and write their transpile cache. Also add HEALTHCHECK to the two with an HTTP endpoint (control-plane /health, panel /) — DS-0026. Scoped to the stateless three on purpose: postgres + garage (non-root has a data-volume UID risk; garage image has no shell for a healthcheck; worker has no HTTP endpoint) are deferred to the stateful-services runbook so this batch never recreates the shared DB. Deploy = targeted recreate of these 3 containers only. Findings: trivy DS-0002 (control-plane/worker/panel), DS-0026 (control-plane/panel). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
trivy DS-0002 (root) nos 3 serviços stateless + DS-0026 (healthcheck) nos 2 com endpoint.
USER node(uid 1000) +chown -R node:node /appno control-plane, worker, panel. Cada um é cliente de rede puro (control-plane provisiona via Coolify HTTP API, não docker.sock; worker = pg-boss + GitHub API + HTTP; panel = Next standalone read-only)./health) e panel (/).Verificado na surtr antes do merge: as 3 imagens buildam, sobem como
uid=1000(node), e opnpm bootstrapdo control-plane rodou como node contra o DB real (migrations/project-zero/orgs/jobs OK).Escopo proposital: postgres + garage ficam de fora (non-root = risco de UID/volume; garage sem shell p/ healthcheck; worker sem endpoint) → vão no runbook stateful.
Deploy: rebuild do app
hauldrna janela (blip do DB pg16 aceito). DS-0002 ×3 + DS-0026 ×2.🤖 Generated with Claude Code