Align fetched snapshot verification with local joins - #8403
Closed
cjen1-msft wants to merge 5 commits into
Closed
cjen1-msft wants to merge 5 commits into
cjen1-msft wants to merge 5 commits into
Conversation
Authenticate snapshot state with trusted ledger keys before using its service identity to verify the receipt. Suppress initial snapshot secret hooks so unauthenticated state cannot supply recovery keys. Cover local and fetched snapshots, malformed receipts, and hook isolation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fetched snapshots were rejected when not signed by the current service identity, even during recovery when the primary only has snapshots signed by its predecessor. Local snapshots were accepted in the same situation. Keep the eager check, but on mismatch fall back to the digest and proof check used for local snapshots and record that the signer is unverified. When the join response shows the service is open, discard such a snapshot and retry the join; when it is recovering, accept it as for a local one. Also suppress network.secrets hooks while a public-only join snapshot is loaded, so unauthenticated snapshot writes cannot seed private recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the existing local-join receipt checks for fetched snapshots, without requiring the current service identity. Remove the verification flag, retry handling, and separate hook-hardening changes. Cover previous-identity snapshots for local and fetched joins during recovery and after opening. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Joiners accept local snapshots signed by a previous service identity, but reject fetched copies because the fetch path checks the signer against the current service certificate.
This PR removes that extra check. Fetched snapshots use the same receipt checks as local join snapshots, both during recovery and after the service opens.
The production change is one line:
Digest and Merkle proof checks remain. Snapshot contents are authenticated by GCM with ledger keys during full deserialisation, immediately for an open service or during private recovery. The configured service certificate still authenticates the connection to the service.
Before
flowchart TD F["Fetch snapshot"] --> D["Check digest and Merkle proof"] D --> S{"Signed by current service identity?"} S -->|Yes| J["Receive authenticated join response"] S -->|No| R["Reject fetched snapshot"] J --> I["Continue through existing join path"] I --> G["Authenticate contents with GCM during full deserialisation"]After
flowchart TD F["Fetch snapshot"] --> D["Check digest and Merkle proof"] D --> J["Receive authenticated join response"] J --> I["Continue through existing join path"] I --> G["Authenticate contents with GCM during full deserialisation"]Existing recovery trust assumption
This PR adopts the existing local-snapshot trust model. During recovery, joiners use public snapshot state before GCM authentication. The safety of those early effects, including
network.secretshooks, is a separate concern shared with the local path. This PR does not establish that safety or change those hooks.Validation
loggingbuilds.recovery_snapshot_endorsements_testpasses. The join scenario checks that local and fetched previous-identity snapshots are used during recovery and after opening, rather than falling back to ledger replay.scripts/ci-checks.shpasses.ccf::pal::ccf::ds::Mutexalias. It has not been rerun for this revision.