Repository navigation
Isolate PCR signing behind a dedicated SecretSpec boundary - #912
Merged
Merged
Conversation
Separate the privileged signing path from local runtime and deployment: a single-key secretspec/pcr-signing.toml manifest resolved only around the signer, credential-stripped EIF builds, public-signature-only verified history appends, an immutable-artifact handoff verifier, and a hardened pcr_sign.js. Adds offline operator-boundary fixtures and an operator-boundaries Nix check. No keys, signing, publication, or deployment are performed by this change. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Chain the operator recipes through Just dependencies instead of nested `just --no-dotenv` calls, drop the unused `label` parameter and the redundant secretspec check before `run` (run already fails closed), and pass optional environment variables through `env -i` only when set so an empty DBUS/TMPDIR value cannot break keyring or temp-file access. Quote the preview SSH/SCP recipes and pass the preview database URL via the environment like dev/prod. Require the services/opensecret component path in the artifact verifier, resolve the test temp dir so the artifact tests pass on macOS, and document the keyring bus and python3/cryptography requirements. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Follow SecretSpec's own layout: the manifests commit `[providers]` aliases with the project IDs and a keyring credential, so per-machine setup is one `login` instead of `provider add` plus `login`. The local-dev manifest also declares a credential-free `opensecret_local_headless` twin; VMs and containers without a keyring export BWS_ACCESS_TOKEN and SECRETSPEC_PROVIDER=opensecret_local_headless. The local recipes therefore pass those two variables through and stop pinning --provider, and the inner service recipes drop the token before exec. Signing keeps the empty environment and a keyring-only alias. Fixtures patch their copied manifest to a dotenv URI, and the manifest test pins the committed IDs. Co-Authored-By: Claude Fable 5.1 <[email protected]>
`OpenSecret EIF release` is manual dispatch only. Its build job runs on the trusted ARM64 runner, uploads image.eif/pcr.json with SHA256SUMS and a handoff.json as an attested artifact, and reports whether the approved snapshot already covers the measurements. With dry_run unchecked, the sign job waits for the protected pcr-signing environment, resolves the existing key through Bitwarden's Secrets Manager action into a single masked step output, runs the same append-pcr-<env> recipe operators use (through a new `pcr_signer` override, so the key still reaches only the node signer and the verified atomic append is unchanged), and pushes an approval branch for an ordinary pull request. It never creates a GitHub Release or tag; a release-gate invariant and a workflow test class enforce that, along with pinned actions, read-only build permissions and single-step key exposure. The component flake gains a minimal `signing` dev shell and `scripts/ci_sign_pcr.sh`; the root check gets jq for the new script tests. Docs describe the flow, the one-time environment setup, and the deployment handoff from a run's artifact. Legacy mirror publication and deployment stay manual. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Maple development preview: https://9b06142f.maple-ca8.pages.dev Commit: Uses development API, billing, flags and PCR configuration. Cloudflare Access applies. |
This branch was successfully 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.
Problem
PCR approval signing shared the backend's general credential surface:
pcr_sign.jsechoed raw errors that could carry key material into logs.Approach
Keep the existing tools (Just,
pcr_sign.js,scripts/pcr_compatibility.py) and pin native SecretSpec commands instead of adding a custom secret framework. One shared SDK-trusted signing key stays; only its resolution boundary changes.What changes
secretspec/pcr-signing.toml(new): a separate manifest declaring onlySIGNING_PRIVATE_KEYunder asigningscope and anopensecret_pcr_signinguser-level provider alias. The rootsecretspec.tomllocal-runtime contract is untouched.build-eif-{dev,prod,preview}run underoperator_env(env -iwith a minimal tool/keyring allowlist), so builds never see credentials._append-pcr-filevalidates the PCR and history files first, skips already-approved measurements without any key lookup, and resolves the key viasecretspec runonly aroundnode pcr_sign.js sign-pcr0. The parent recipe never receives the key.pcr-signing-check/pcr-signing-loginrecipes; diesel dev/prod migrations pass the URL viaDATABASE_URLenv instead of argv; SCP recipes take an explicit EIF path argument with quoted SSH variables.scripts/pcr_compatibility.py:append-signaturesubcommand: validates inputs, accepts only a public signature on stdin, verifies it against the pinned SDK public key, and atomically rewrites history. Missing or symlinked files are errors, never recreated.artifactsubcommand: read-only handoff verifier, checking a clean checkout at the reviewed commit, signed approvals, measurement match, EIF SHA-256, and Nix store immutability. Deployment consumes this instead of rebuilding.pcr_sign.js: validates PCR0 format, deletes the env key after reading, and sanitizes error output so no key material can surface.nodejsadded to the dev shell; newoperator-boundariescheck runs the offline fixtures in the Nix sandbox.secretspec/README.mddocuments the one-time BWS UI import (never CLI argv writes), the dedicated machine account, the authorized signing flow, and the deployment handoff;docs/pcr-compatibility.md,docs/nitro-deploy.md, andAGENTS.mdpoint at it.Validation
checks.aarch64-linux.operator-boundariesand the rootchecks.aarch64-linux.pcr-compatibilitypass in the Nix sandbox.Explicitly out of scope
BWS project/machine-account creation, real value import, keyring logins, actual signing, PCR publication, and any deployment. These remain separate authorized operator steps documented in
secretspec/README.md.