Repository navigation
feat(repo): sc rewrap --rotate re-seals protected paths under fresh keys (ADR-0051) - #196
Conversation
…eys (ADR-0051) A plain rewrap drops a revoked recipient's wrap but keeps the DEK, so a recipient with an old wrap still opens the tip. --rotate reuses the convergent-upgrade branch to decrypt each protected blob and re-seal it under a fresh DEK to the rule's granted set plus escrow: one commit, one oplog record, skip-and-report, new ciphertext ids. History keeps the old ciphertext (rotation is not erasure). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Independent Codex Sol (gpt-6.1-sol, read-only) review of the diff: no new security or data-integrity bugs. It checked old-ciphertext/wrap leakage, shared ciphertext ids rotating independently with the right DEK, tree rebuild, stat-cache recording, dry-run side effects, empty grant sets and the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78919e8e6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9328135a75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…p --rotate ADR-0051 carries the new decision. The threat model and ARCHITECTURE said a plain sc rewrap is the cryptographic cutover, which leaves a revoked holder's key working; they now name --rotate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 10
✨ Finishing Touches
Comment |
Problem
sc revokeis standing-only andsc rewraponly replaces wrap lists, so a recipient revoked earlier who still holds an old wrap and DEK keeps opening the tip's ciphertext. Secrets havesc secret rotate; protected paths had no equivalent. ADR-0043 recorded rotate-for-paths as an unlocked follow-on (randomized DEKs are independent of the plaintext).Change
sc rewrap --rotate(Repo::rewrap_with(.., rotate);rewrap()is unchanged) re-seals every protected blob at the tip under a fresh DEK and nonce, to the rule's granted set plus escrow. It reuses the existing convergent-upgrade branch (unwrap, decrypt,encrypt_path_randomized, retarget the entry, drop the old ciphertext's wrap entry once unreferenced, record the working file in the stat cache). One commit, one oplog record, skip-and-report for blobs the identity cannot open (left byte-for-byte as they were), and all existing guards (private branch, partial clone, in-progress merge/pick/rebase). Newblobs_rotatedcount, separate from the convergentblobs_resealed.Rotation is not erasure: history keeps the old ciphertext and wraps. ADR-0051 records this; ROADMAP, ARCHITECTURE, ADR-0043, CLAUDE.md and the CLI reference are updated.
Verification
rotate_makes_the_tip_unreadable_with_a_revoked_recipients_old_dek: a plain rewrap leaves a revoked recipient's old DEK working; dry-run commits nothing; rotate changes the ciphertext id, the old DEK no longer opens it, alice still reads the plaintext, the old wraps are gone, status is clean, a second rotate is another fresh seal, and undo restores.rotate_skips_a_path_the_identity_cannot_open_and_rotates_the_rest.demo/run_rewrap_demo.shstep 7 proves it through the CLI.cargo fmt,cargo clippy --workspace --all-targets -D warnings,cargo test --workspacepass.🤖 Generated with Claude Code
Summary by CodeRabbit
sc rewrap --rotateto reseal protected files at the latest revision under fresh keys, helping prevent holders of old keys from opening the rotated files.