Skip to content

chore(deploy): sign the hosted sandbox with a key of its own (#6694) - #6716

Open
rubentalstra wants to merge 4 commits into
mainfrom
chore/sandbox-signing-key
Open

rubentalstra wants to merge 4 commits into
mainfrom
chore/sandbox-signing-key

Conversation

@rubentalstra

@rubentalstra rubentalstra commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Part of #6694.

Closes #6718

The hosted sandbox signs with an ML-DSA-65+Ed25519 key of its own, held on the box alone.

deploy/hosted/ferroehr.sandbox.toml sets [record.signing] mode = "pgp" with key_file and key_passphrase_file under /run/secrets/, and [audit.access_log] publish_directory. deploy/hosted/docker-compose.yml mounts the key and its passphrase into the CDR as compose secrets, from the files .env names (FERROEHR_SIGNING_KEY_FILE, FERROEHR_SIGNING_PASSPHRASE_FILE). It mounts the passphrase alone into ferroehr-grant and ferroehr-hold, because the configuration loader reads that file. While .env names neither file, docker compose config fails, so deploy.sh refuses the posture before it installs anything or stops the running CDR. deploy.sh itself does not change.

The publish directory is a tmpfs of the CDR container. The nightly wipe recreates the container, so the published checkpoints start again with the chain. A persistent directory would keep the old checkpoint files after a wipe. The server writes each checkpoint once and never overwrites it, so the restarted sequence would conflict with those files and the indicator would fail.

The runbook (deploy/hosted/README.md, "The signing key") says how to make the key on the box with ferrohealth-sop in the Rust builder image, with no network, and how to rotate it. env.example documents the two lines.

scripts/checks/shipped-configs.sh and the lane test in app/ferroehr/tests/it/definition_load.rs now stage a throwaway passphrase file where the deployment mounts the real one, because the loader reads it.

shipped-configs.sh now resolves the hosted compose file on every run, whatever program it is given; before, only its viewer half did (#6718). A broken interpolation fails with the file named.

Sequencing. The posture reaches the box only with a release image. The key and its passphrase already exist on the box, and .env names them, so the release that carries this deploys cleanly. ferroehr-hold-clinician (from #6695) gets the same passphrase mount as the other hold one-shots.

Local evidence: cargo clippy -p ferroehr --all-targets -- -D warnings passes. cargo nextest run -p ferroehr -E 'test(the_lanes_boot_on_the_seeded_default_definitions)' passes 1 of 1. FERROEHR_BIN=… scripts/checks/shipped-configs.sh returns 0. scripts/checks/hosted-deploy-script.sh and compose-image-tags.sh pass. docker compose config refuses with the variables unset and resolves with them set.

The sandbox posture sets [record.signing] mode = "pgp" with key_file and
key_passphrase_file under /run/secrets, and publishes access-log checkpoints
to a tmpfs that the nightly wipe empties with the database. The hosted compose
file mounts the key and its passphrase as compose secrets from the files .env
names, and refuses the posture while .env names neither. The runbook says how
the key is made on the box with ferrohealth-sop and how it is rotated. The
shipped-config check and the lane test stage a throwaway passphrase file where
the deployment mounts the real one.

Part of #6694
…s run

The hosted sandbox's compose file was resolved only in the viewer half of the
check, so a run given only a server image or binary never interpolated it.
It is now resolved once on every run, with every profile and the box's
placeholder environment, and a failure names the file.

Closes #6718
…ne-shot

ferroehr-hold-clinician, which came with the demo dataset, loads the sandbox
configuration too, and its loader reads the passphrase file.

Part of #6694
@rubentalstra
rubentalstra marked this pull request as ready for review November 26, 2026 20:22

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.

shipped-configs resolves the hosted compose file only when a viewer binary is given

1 participant