docs(security+devex): off-chain encrypted vault + dev-env bootstrap#59
Merged
hanwencheng merged 2 commits intomainfrom Apr 26, 2026
Merged
docs(security+devex): off-chain encrypted vault + dev-env bootstrap#59hanwencheng merged 2 commits intomainfrom
hanwencheng merged 2 commits intomainfrom
Conversation
- New scripts/setup-dev-env.sh — idempotent bootstrap for macOS (Homebrew) and Linux (apt/dnf/pacman). Installs rustup+stable, Node 20+, jj (with required identity), jq, AWS CLI v2; builds the workspace; runs smoke tests. Skips Google Chrome and AWS infra by design. - docs/dev-setup.md §1 gets a "Quick path" subsection pointing at the script; manual matrix preserved as fallback. §2 notes that bootstrap users can skip ahead. Verified: bash -n syntax check passes; detection logic dry-traced on the operator's Mac (every prerequisite resolves so a re-run would skip every installer). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…renumber Per security review: on-chain encrypted credential storage (pallet-secrets-vault) creates an unbounded harvest-now-decrypt-later window. Public + immutable + permanent ciphertext means any future TEE-key compromise leaks all historical credentials. Splitting the TEE into two enclaves does not address the consequence axis. The fix requires two architectural moves that compose: 1. Off-chain ciphertext (S3) + on-chain hash + audit 2. Forward-secret per-epoch DEK rotation with deletion of old ciphertext After K epochs, total TEE compromise leaks at most one epoch. Changes: - New docs/spec/threat-model-key-custody.md — canonical security position - New docs/stage8-wip.md — operational design (S3 layout, pallet-vault-pointers, rotation runbook, TEE-B encryption-center responsibilities) - docs/spec/plans/development-stages.md — inserted new Stage 8 (off-chain vault); renumbered old Stage 8 (memory hygiene) → Stage 9; old Stage 9 (Heima holding pen) → Stage 10. Parallelization table + change log updated. - docs/stage7-wip.md — scope-boundary note: Stage 7 ships isolation primitive only; vault deferred to Stage 8. - docs/spec/credential-backend-interface.md — Mapping table superseded banner; store_credential / read_credential / teardown_agent rows updated to pallet-vault-pointers + S3. - docs/spec/ses-email-architecture.md §16 — cross-reference (email pipeline is the precedent that Stage 8 generalizes). - wiki/blockchain-tee-architecture.md §1 — superseded banner; row rewritten to "vault pointers, not blobs"; new EpochDek row; new audit extrinsics. - wiki/data-classification.md §1 — credential-blob row updated; doc-level banner. - wiki/key-security.md §1 — v0.1 storage column updated; doc-level banner. - wiki/Home.md — added link to threat model; rules 1+2 wording aligned. - docs/contradictions.md §7.1 — resolved entry documenting the decision. Tracks: #57 (security finding), #58 (Stage 7 broker server) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
11 tasks
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.
Summary
Two themes from a security + dev-experience pass:
pallet-secrets-vault) creates an unbounded harvest-now-decrypt-later window — public + immutable + permanent ciphertext means any future TEE-key compromise leaks all historical credentials. The fix is two architectural moves that compose: off-chain ciphertext (S3) + on-chain hash, plus per-epoch DEK rotation with deletion of old ciphertext. After K epochs, total TEE compromise leaks at most one epoch. Lands as new threat-model spec, new Stage 8 WIP design, and a doc sweep acrossdocs/+wiki/. Tracks issue #57.scripts/setup-dev-env.sh— idempotent, OS-aware (macOS / apt / dnf / pacman). Installs rustup+stable, Node 20+, jj (with required identity), jq, AWS CLI v2; builds the workspace; runs smoke tests.docs/dev-setup.md§1 gets a Quick-path subsection pointing at it. Companion to issue #58 (Stage 7 broker server) which will further reduce client-side AWS-cred sprawl.What's in the diff
Two commits, one per theme.
Stage 8 design at a glance
pallet-vault-pointersrow(user_wallet, service, agent, epoch, blob_id, ciphertext_hash)+ per-userEpochDek { wrapped_dek }+ audit extrinsics (BlobWritten,EpochRotated,EpochDestroyed)s3://agentkeys-vault/<wallet>/<service>/<epoch>/<blob_id>.enc, AES-256-GCM, gated by Stage 7 PrincipalTag isolationDefault rotation cadence: weekly + on-revocation. Lazy re-encryption (re-wrap on next read) chosen as v0.1 default; lifecycle TTL drops idle blobs.
EpochDestroyedis the audit event that bounds the forward-secrecy window.Stage renumber
Parallelization table updated: Stage 8 + Stage 9 are independent code surfaces; can run in parallel after Stage 7.
Test plan
bash -n scripts/setup-dev-env.sh— syntax check passespallet-vault-pointersshape is acceptable to upstream Substrate idioms before issue #57 leaves design phaseOut of scope (deliberately)
heima-gaps-vs-desired-architecture.md— flagged as a follow-up in the issue and the threat-model doc; mechanically straightforward.Session.token/pallet-secrets-vaultreferences in the body ofwiki/blockchain-tee-architecture.md(worked-example sections, etc.) carry the doc-level superseded banner but were not rewritten line-by-line. The banner + the §1 row update are sufficient for readers; a deeper sweep can land alongside the actual Stage 8 implementation work.Related
shielding/v1becomes the wrap-DEK key in the new design)🤖 Generated with Claude Code