Skip to content

fix(docker): réduire les CVE de l’image (base slim, paquets et overlay) - #444

Merged
jencryzthers merged 16 commits into
mainfrom
cursor/docker-image-cves-5d72
Oct 14, 2026
Merged

jencryzthers merged 16 commits into
mainfrom
cursor/docker-image-cves-5d72

Conversation

@jencryzthers

@jencryzthers jencryzthers commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Ce qui change

L'image du serveur reste sur Debian slim (distroless incompatible : git, venv Python, Chrome, curl).

  • apt-get upgrade au build ; overlay npm et pip de dépendances corrigées. L'overlay pip utilise pip --require-hashes avec des sha256 épinglés, et le script échoue si aucun venv n'est trouvé.
  • Option A : .trivyignore nomme explicitement chaque exception restante (sans joker, sans doublon), avec une raison et une date de revue.
  • Porte CI : Trivy --ignorefile .trivyignore --severity HIGH,CRITICAL, puis node scripts/trivy-ignore-guard.mjs --gated.
  • Garde-fou fail-closed : un scan vide ou nul, une FixedVersion vide, une date invalide ou en double, un .trivyignore vide, une sévérité UNKNOWN, une entrée sans identifiant (y compris LOW en --gated) ou une exception absente du scan font tous échouer la porte.

Preuve

L'inventaire détaillé des vulnérabilités n'est pas publié dans ce dépôt public ; il est conservé en interne. La porte CI sur linux/amd64 doit lire 0 CRITICAL et 0 HIGH hors exceptions, et le garde-fou doit confirmer qu'aucune exception n'a de correctif disponible. La preuve finale est la CI entièrement verte à la tête fusionnée.

Checklist

  • Aucun inventaire CVE ni JSON de scan dans le dépôt.
  • Pas d'édition de dist-server/, pas de secrets.
  • Pas de tag, pas de publication d'image, pas de force push. Brouillon.
  • Branche à jour avec main, CI entièrement verte.
  • Fusion en squash obligatoire, puis suppression de la branche.

Keep node:24-trixie-slim (distroless cannot host git, Chrome, Python, or
the engine CLIs). Upgrade Debian packages at build, overlay piscina, sharp,
PyJWT, httpx2 and httpcore2 when a fix exists, and drop npm after install.
The Node slim image ships Yarn; engines and the bundled server never
call it. Removing it after install matches the npm cleanup.
List each remaining CRITICAL/HIGH OS CVE in .trivyignore (no wildcards).
CI scans with that file (HIGH/CRITICAL must be 0) and again without it,
failing when a listed id grows a FixedVersion or the 2026-11-13 review
date passes.
Vitest collects scripts/**/*.test.mjs, so the node:test runner-guard file
failed shard 2 with "No test suite found". Rename it to *.node-test.mjs
(same convention as electron/) and assert no scripts/*.test.* import
node:test.
The parking e2e sent while the assigning turn was still live, so the
message was steered (queued undefined) instead of parked. Wait for
busy=false and waitingForTeammates=true, as the sibling steer case does.
The previous head never received a CI workflow run. Empty commit so the
synchronize event fires ci.yml again.
Take main's vitest runner-label tests and runner-guard script invocation.
Keep the Docker ignore-list work and the parking e2e wait. Resolves the
conflict that blocked GitHub from forming the pull_request merge ref.
Bring in #438 and #443 so the draft is not behind main again.
The ignore guard now exits non-zero on an unusable scan ({} or
Results:null, including --gated), a whitespace FixedVersion, an invalid
or duplicate Review date, an empty .trivyignore, UNKNOWN severity, or a
listed CVE missing from the scan. httpx2 and httpcore2 stay in the
Hermes overlay and install through pip --require-hashes with pinned
wheel and sdist sha256s.
Store the ungated HIGH/CRITICAL reports in the repo so the 108 HIGH
package rows on amd64 after can be checked against the 36 unique CVE
ids in .trivyignore. Arm64 after is the same 36 plus three Chromium
OS packages. No CI run URLs.
Remove the raw scan JSON and the per-CVE table from the preuve so the
public repo does not publish unfixed CVE inventory. Revert the unrelated
direct-coordination and CI glob tests. Duplicate ignore ids and a LOW
finding without VulnerabilityID fail the guard. The pip overlay exits
non-zero when no venv is found.
Trim .trivyignore to the 34 ids still present in the scan. Keep PyJWT
2.15.1 in the Hermes venv (Hermes asks for 2.13.0; 2.15.1 is the patched
compatible release) and round-trip a JWT with that interpreter. Guard
tests use fictional ids only.
The overlay smoke now RS256-encodes and decodes (PyJWT crypto extra) and
calls Hermes verify_nas_fire_token in the image venv at PyJWT 2.15.1.
Refresh HIGH line counts in the preuve to the current scan.
Add two negative Chronos verify cases: an RS256 token with one signature
byte flipped, and a token signed by a second RSA key. Both must return
None.
cursor Bot pushed a commit that referenced this pull request Oct 14, 2026
Commit 221a905 left '<REGION>' and '<VM_SIZE>' as OpenTofu defaults,
which are not valid Azure values. Make location, system_vm_size and
azure_vm_size required, validate region as ^[a-z]+[a-z0-9]*$ and SKU as
^Standard_[A-Za-z0-9_]+$, derive the core pool output from the variable,
and restore the AKS sandbox-pool SKU regex (not length > 0).

Also add docs/history-rewrite-plan.md: rewrite scope includes
cursor/docker-image-cves-5d72 (commit 1b3bbe5, Trivy JSON from PR #444)
and an explicit GitHub Support purge of refs/pull/444.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
@jencryzthers
jencryzthers marked this pull request as ready for review October 14, 2026 11:23
@jencryzthers
jencryzthers merged commit 029f7c2 into main Oct 14, 2026
35 checks passed
@jencryzthers
jencryzthers deleted the cursor/docker-image-cves-5d72 branch October 14, 2026 11:24
jencryzthers added a commit that referenced this pull request Oct 14, 2026
* docs: describe deployment targets generically (no hosts, VM, resource group or org names)

* chore: genericize public deploy names and strip client hosts

Rename the Helm chart and namespaces from sagax-sandboxes to sandboxes /
sandbox-system, replace the client deploy tree with deploy/example, and
remove real hosts, vault names, D1 IDs and proof GUIDs from HEAD.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>

* test: align Example fixtures after client-name scrub

Assertions still expected the leftover "production" stand-in after
org names became Example. Match the fixtures and keep character
counts derived from the about-me text.

* chore: stop the Azure example prefix from matching the live cluster

The example stack used a prefix that made the cluster and identity names
the same as the live AKS cluster. Use a generic prefix instead.

* chore: drop leftover host paths, team id and install roots

Public deploy docs and the host deploy script now use generic
placeholders (<INSTALL_ROOT>, <APPLE_TEAM_ID>, <PERSPICAX_REPO>,
<EDGE_SERVICE>) and /opt/sagax defaults. Rename the image-gate
workflow off the old host name, match the sandbox pool Prometheus
label to sagax.io/pool, and skip Docker rebuilds for deploy markdown.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>

* ci: keep the runner-label node:test out of vitest

Vitest collects scripts/**/*.test.mjs, so the node:test runner-guard
file failed shard 2 with "No test suite found". Rename it to
*.node-test.mjs (same pattern as electron). List the interrupt
coordination e2e that flaked on the same shard (wait() returned
failed after interrupt; the file is unchanged vs main).

* chore: drop off-topic runner-label, retry-list and image-gate rename

Restore runner-guard, the runner-label tests and ci-retry-list to
match main (main already converted that suite to vitest). Put the
image-gate workflow back at main's filename; its body still calls
deploy-server.mjs.

* docs: attach the history-rewrite dry-run proof

Local clone --mirror only. Raw filter-repo log, git rev-list --all | wc -l
(6127 before and after), and git grep of every rewritten commit (empty,
exit 1). Live terms masked with placeholders. Rewritten refs were not pushed.

* chore: restore the image-gate workflow from main

Leave the file byte-identical to main so this PR does not conflict with
the image-gate engine-set check. That workflow is not part of this
hygiene change.

* docs: paste the raw -E dry-run proof, drop the image-gate rename

The attached Preuve is the local mirror dry-run: rev-list counts before
and after, then git grep -E over every rewritten SHA (empty stdout,
exit 1). The image-gate workflow is not path-renamed.

* docs: attach the uncollapsed filter-repo dry-run transcript

Replace the collapsed proof with the real filter-repo log, the wc -l
stdout before and after, and git grep of every rev-list SHA (empty,
exit 1). Placeholders only.

* docs: explain the 6080→6078 dry-run drop

Those two SHAs were only on origin/main; filter-repo dropped the
origin remote. Not empty commits. Chart dir rename stays in #437.

* fix: restore docker.yml and D1 ids; paste real 6080 filter-repo log

The md path filter was off-topic. wrangler keeps main's D1 id lines.
The two dropped SHAs were only on origin/main; filter-repo parsed 6078
because it removes that remote before walking.

* docs: one filter-repo dry-run on a fresh --mirror of main

Replace the contradictory workspace-mirror transcripts with a single
run: clone --mirror --single-branch --branch main, 6070 before, 6070
after, no dropped SHAs. docker.yml and D1 id lines stay identical to
main.

* docs: add the full-origin --mirror dry-run (all public refs)

Second local filter-repo pass on a complete origin --mirror after
deleting refs/pull. 20 heads, 30 tags, 6179 commits before and after,
no dropped SHAs.

* fix: replace remaining Azure region and VM-size literals with placeholders

Olesya audit on #437: ios-push already used <RESOURCE_GROUP>;
cutover-rollback now uses <RESOURCE_GROUP>, <REGION>, <VM_SIZE>;
the old helm chart path is gone. Same placeholders in the sibling
docs and tofu defaults so case-insensitive class greps are 0.

* fix: require Azure region and VM SKU variables with format checks

Commit 221a905 left '<REGION>' and '<VM_SIZE>' as OpenTofu defaults,
which are not valid Azure values. Make location, system_vm_size and
azure_vm_size required, validate region as ^[a-z]+[a-z0-9]*$ and SKU as
^Standard_[A-Za-z0-9_]+$, derive the core pool output from the variable,
and restore the AKS sandbox-pool SKU regex (not length > 0).

Also add docs/history-rewrite-plan.md: rewrite scope includes
cursor/docker-image-cves-5d72 (commit 1b3bbe5, Trivy JSON from PR #444)
and an explicit GitHub Support purge of refs/pull/444.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>

* docs(history-rewrite): inventaire pulsatrix-v3 et database_id wrangler

* docs/tofu: retirer le nom du dépôt privé, la région Azure d'exemple et la description du commit à purger

* chore: replace remaining private-repo name with a placeholder

Public HEAD no longer names the private repository. Restore the
history-rewrite description of commit 1b3bbe5's Trivy JSON and the
Support purge of refs/pull/444.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>

* docs(history-rewrite): purge de l'historique d'édition des PR

* docs(history-rewrite): commit à purger sans description, administrateur du dépôt

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
jencryzthers added a commit that referenced this pull request Oct 14, 2026
## Quoi

Bump de version, comme #421 pour 0.5.1 :

- `package.json` : `forkVersion` 0.5.2
- `ios/project.yml` : `MARKETING_VERSION` 0.5.2 (même version que le
desktop), `CURRENT_PROJECT_VERSION` 30, sur les quatre cibles
- `docs/releases/0.5.2.md` : notes complètes FR et EN (affichées dans
l'app avant et après la mise à jour), qui complètent celles de #458 avec
tout ce qui est entré depuis 0.5.1 : voix (#427, #435, #422/#424, #450,
#451, #458), démarrage serveur (#433, #460), approbations (#455),
modèles (#462, #466), sandboxes Kubernetes (#463, #465), image Docker
(#436, #444, #456), sécurité (#445), interface (#423, #425, #448, #454,
#461)
- `src/lib/bundled-release-notes.test.ts` : vérifie les nouvelles
entrées

NE PAS fusionner sans le GO de JC : la fusion sur main (changement de
`package.json`) lance `release.yml`.

## Prérequis avant la release

- Créer le secret de dépôt `TRIVYIGNORE_PRIVATE` (#456) : absent ou
vide, `docker.yml` échoue fermé sur le tag.

## Tests locaux (candidat, Node 26.11, macOS)

- `pnpm test:unit` : 8 shards, 1474 fichiers, exit 0
- `pnpm exec vitest run src/lib/bundled-release-notes.test.ts` : exit 0
- `pnpm test:shards` (tous les groupes) lancé avant #466 : exit 1. Les
échecs déterministes sont corrigés par #466 ; restent des e2e qui
passent seuls (charge des 8 shards) et
`server/codex-review.e2e.test.ts`, qui échoue sur ce Mac aussi au tag
`pulsa-v0.5.1` (Node 24 et 26).
- Tests Swift non lancés.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Jean-Christophe Proulx <jencryzthers@Jean-Christophes-Macbook-Pro.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants