Repository navigation
chore(deploy): sign the hosted sandbox with a key of its own (#6694) - #6716
Open
rubentalstra wants to merge 4 commits into
Open
rubentalstra wants to merge 4 commits into
rubentalstra wants to merge 4 commits into
Conversation
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
marked this pull request as ready for review
November 26, 2026 20:22
rubentalstra
enabled auto-merge
November 26, 2026 20:22
This branch has not been deployed
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.
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.tomlsets[record.signing] mode = "pgp"withkey_fileandkey_passphrase_fileunder/run/secrets/, and[audit.access_log] publish_directory.deploy/hosted/docker-compose.ymlmounts the key and its passphrase into the CDR as compose secrets, from the files.envnames (FERROEHR_SIGNING_KEY_FILE,FERROEHR_SIGNING_PASSPHRASE_FILE). It mounts the passphrase alone intoferroehr-grantandferroehr-hold, because the configuration loader reads that file. While.envnames neither file,docker compose configfails, sodeploy.shrefuses the posture before it installs anything or stops the running CDR.deploy.shitself 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 withferrohealth-sopin the Rust builder image, with no network, and how to rotate it.env.exampledocuments the two lines.scripts/checks/shipped-configs.shand the lane test inapp/ferroehr/tests/it/definition_load.rsnow stage a throwaway passphrase file where the deployment mounts the real one, because the loader reads it.shipped-configs.shnow 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
.envnames 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 warningspasses.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.shreturns 0.scripts/checks/hosted-deploy-script.shandcompose-image-tags.shpass.docker compose configrefuses with the variables unset and resolves with them set.