fix: unblock the release PR - real production image, reviewed audit ignores
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Canceled after 28s
PR Check / Typecheck (pull_request) Canceled after 0s
PR Check / Secret scan (gitleaks) (pull_request) Canceled after 0s
PR Check / Dependency audit (pull_request) Canceled after 0s
PR Check / Dockerfile lint (droast) (pull_request) Canceled after 0s
PR Check / AI code review (opencode) (pull_request) Canceled after 0s

The release PR (chore: release main) failed two checks, both verified
locally before pushing:

- droast: the empty production Dockerfile failed DF071 (no
  instructions). The new Dockerfile is a runnable Node server (SSR):
  multi-stage, manifests-first layers, digest-pinned node:26-slim (same
  digest as the dev container), non-root uid 1000, node-fetch
  HEALTHCHECK. Measured: docker build succeeds in-image, container
  serves HTTP 200 and reports healthy; droast reports 0 errors.
- audit: two high advisories with NO patched release anywhere
  (node-forge <=1.4.0 and braces <=3.0.3 are the newest npm versions;
  both build-time-only paths under nitropack). Recorded as
  auditConfig.ignoreGhsas in pnpm-workspace.yaml with the reason and
  removal condition - the audit output still names what it skipped.
  pnpm 11 ignores the pnpm field in package.json (caught locally via
  the WARN before pushing); settings live in pnpm-workspace.yaml.

OKF_Nuxt: recorded the production-image and audit-policy decisions,
updated log, indexes and open questions.
This commit is contained in:
Noel Sabia committed 2026-10-18 21:14:12 +02:00
1 parent 0e5ddda59d
commit f32ad07648
8 files changed
+201 -2

No files matched your search

+2
View File
@@ -2,10 +2,12 @@
* [PR pipeline layering](pr-pipeline-layering.md) - What runs pre-commit, what runs in Gitea Actions, what the AI review does, and the cost rule that decides.
* [AI review setup](ai-review-setup.md) - Plan model, env-only auth against prompt injection, read-only agent, and the verdict line as the posting gate.
* [Vulnerability audit policy](vulnerability-audit-policy.md) - Blocking audit, reviewed ignore-list for unfixable advisories, and the pnpm-11 settings home.
* [Release engineering](release-engineering.md) - release-please in manifest mode, conventional commits as input, message format enforced at commit time.
* [Snyk paused and secrets policy](snyk-paused-and-secrets-policy.md) - Why the job is skipped rather than deleted, and the token scopes every workflow secret needs.
* [Dev container shape](dev-container-shape.md) - The source is bind-mounted into a container that already holds the dependencies, and the dev server runs as the image's `node` user.
* [Build layer order](build-layer-order.md) - Why the manifests are copied before the source, and what invalidates what.
* [Build context filter](build-context-filter.md) - What `.dockerignore` may exclude, and the one thing it must never exclude.
* [Production image shape](production-image.md) - Multi-stage, digest-pinned, non-root runnable Node server; measured build and serve.
* [Repository and compose layout](repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
* [Mockup layout](mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
+57
View File
@@ -0,0 +1,57 @@
---
type: Decision
title: Production image shape
description: The production Dockerfile is a runnable Node server for the SSR app - multi-stage, digest-pinned base, non-root, healthchecked.
tags: [decision, docker, nuxt, production]
status: stable
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T19:10:00Z }
verified: { by: human:noel, at: not yet }
sources:
- id: dockerfile
resource: Dockerfile
title: Production Dockerfile
- id: droast
resource: .gitea/workflows/pr-checker.yml
title: Dockerfile lint job (droast)
---
# Decision
`Dockerfile` builds the production image as a **runnable Node server**:
* Stage `build`: manifests first, `pnpm install --frozen-lockfile
--ignore-scripts`, then the full source, then `pnpm build` - Nitro emits a
self-contained `.output/server/index.mjs` with its traced dependencies.
* Stage runtime: only `.output` is copied (chowned to `node`), the process
runs as the image's non-root `node` user, the base image is the same
digest-pinned `node:26-slim` as the dev container, and a `HEALTHCHECK`
(node's own fetch, no curl in slim) polls the root path.
This answers the previously open question "runnable Node server, or static
files embedded in the gateway". The static-in-gateway plan recorded in the
sibling `OKF_CV_Website` bundle predates the SSR reality of this repository:
the gateway must now **proxy to this server** instead of embedding
`.output/public/`. That sibling decision needs updating; the compose wiring
is still open.
# Why `--ignore-scripts`
The `postinstall` script (`nuxt prepare`) runs before the source is copied
and would fail. `nuxt build` prepares everything it needs itself. Native
binaries (esbuild, unrs-resolver) come from platform-specific optional
packages, not install scripts, so skipping scripts loses nothing.
# Verified (measured, 2026-10-18)
* `docker build` on x86_64: full build succeeds in-image ("Build complete").
* `docker run`: HTTP 200 on `/` (28 KB page), process runs as
`uid=1000(node)`, healthcheck reports `healthy`.
* droast 1.7.0 (sha-verified): 0 errors; one accepted DF007 warning on
`COPY . .` - that line *is* the source-last layer design.
* arm64 correctness rests on the multi-arch digest pin (proven in CI for
the dev container); the image build itself has only run on x86_64.
# Revisit when
* The gateway/compose stack is assembled (proxy target, port, network).
* A `go` preset or full-static `nuxt generate` becomes preferable.
@@ -0,0 +1,58 @@
---
type: Decision
title: Vulnerability audit policy
description: The dependency audit blocks the pipeline, with an explicit reviewed ignore-list for advisories that have no patched release - the list lives in pnpm-workspace.yaml, because pnpm 11 no longer reads the pnpm field in package.json.
tags: [decision, security, ci, audit, pnpm]
status: draft
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T19:10:00Z }
verified: { by: human:noel, at: not yet }
sources:
- id: workspace
resource: pnpm-workspace.yaml
title: auditConfig.ignoreGhsas
- id: audit-job
resource: .gitea/workflows/pr-checker.yml
title: Dependency audit job
---
# Decision
`pnpm audit --prod --audit-level moderate` stays **blocking** (no
`continue-on-error`). Advisories that cannot be fixed by upgrading are not
silenced but **reviewed and recorded**: `auditConfig.ignoreGhsas` in
`pnpm-workspace.yaml`, each entry with the date and reason, removed when a
patched version ships.
Currently ignored (both verified against the advisory database and the npm
registries on 2026-10-18 - the newest published versions are the vulnerable
ones):
* `GHSA-86w9-cpqp-85rv` - node-forge <= 1.4.0, high. Path:
`nuxt > @nuxt/nitro-server > nitropack > listhen > node-forge` - listhen
generates dev certificates; build/dev-time only, not in the server bundle.
* `GHSA-vfj7-8cjw-p6xm` - braces <= 3.0.3, high. Path:
`nitropack > globby > micromatch > braces` - globbing during build, no
attacker-controlled patterns at runtime.
# Why
A red job that can never go green trains everyone to ignore red - the same
silent-failure outcome "nothing fails silently" exists to prevent. The
ignore list is the opposite of silence: the audit still names what it
skipped ("2 ignored: 2 high") and the decision lives in a reviewable file.
# The pnpm 11 lesson
The first attempt put `auditConfig` under the `pnpm` field in
`package.json`. pnpm 11 warned and **ignored it** - settings moved to
`pnpm-workspace.yaml` (same reason the config-only workspace file needed
pnpm 11 in the first place). The warning was caught locally before pushing
by running the exact CI command.
# Revisit when
* A patched version ships for either package - remove the entry.
* A new advisory appears with a real patch - fix it by upgrading; the audit
gate does the enforcement.
* Snyk is re-enabled (its SAST/DAST scope is different; see
[snyk-paused-and-secrets-policy](snyk-paused-and-secrets-policy.md)).