Skip to content

chore: Rebuild seismic as a clean patch stack on upstream ca2a75d (review only, do not merge) - #113

Closed
samlaf wants to merge 8 commits into
flashbots:mainfrom
SeismicSystems:seismic-split
Closed

samlaf wants to merge 8 commits into
flashbots:mainfrom
SeismicSystems:seismic-split

Conversation

@samlaf

@samlaf samlaf commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Do not merge. This PR exists only to review the stack. Once it's approved, seismic will be force-pushed to seismic-split and this PR closed. main is now an exact mirror of flashbots/attested-tls@ca2a75d, so the diff below is exactly what our fork carries.

Why

Motivation is in #8: we want to stop maintaining this fork, so every Seismic change should be a standalone commit on top of upstream that we can either upstream or drop. The current seismic branch (1f7147c) instead piles merge commits on an older upstream base. That makes it hard to see what we actually carry, and hard to peel commits off as they land upstream.

This PR replaces that history with 8 commits on top of current upstream main:

Commit Author Change #8 item
815a2b6 Samuel Azure: platform metadata is best-effort (/proc/meminfo + /sys/block fallback when SMBIOS is unreadable) Azure metadata fallback (was 0079937)
dbd473d Samuel Export the compiled-in Azure vTPM root CAs (AZURE_ROOT_CA_PEMS) Azure root CAs (was 4eaf323)
7a3c6e9 Henry Pin Google's GCE-cc-tcb-root_1 GCP (was #7)
cf11ba4 Henry Check Google's firmware endorsement on every live gcp-tdx verification GCP
a847b0b Henry Enforce extended key usage on endorsement certificates GCP
4494156 Henry Record the firmware endorsement in EndorsementSnapshot GCP
d2c69f4 Henry Replay archived gcp-tdx evidence against its recorded endorsement GCP
542b221 Henry Let verifiers share one endorsement cache GCP

The GCP work from #7 (previously a4c7079, 8304e8a, fe508d5, f750c1e) is split into 6 commits along feature boundaries, so each one can go upstream on its own (this is following the recommendation I had made in SeismicSystems#7 (comment))

Archived replay (521fa50 + e955a94) is no longer in the stack: it landed upstream in #93, and we now pick up upstream's post-review version. d2c69f4 lifts the restriction from upstream's a2898b9 ("refuse archived verification of GCP evidence"), since archived GCP evidence can now be replayed against its recorded endorsement.

Total delta vs upstream: 15 files, +1059 / −40.

Equivalence with merging upstream into seismic

seismic-merge-check (042d5f2) is a single merge of upstream/main (ca2a75d) into current seismic (1f7147c), with every hunk git got wrong fixed by hand. Its tree is identical to this PR, so the stack carries exactly what a plain upstream merge would have, just as reviewable commits instead of merge history.

git fetch origin
git diff origin/seismic-merge-check origin/seismic-split   # empty
git show --remerge-diff origin/seismic-merge-check         # every hand-made change in the merge

--remerge-diff diffs the merge against git's own automatic merge, conflict markers included, so it shows both the conflict resolutions and the corrections to hunks git merged cleanly but wrongly. GitHub's UI can't show this view, so run it locally. The corrections were:

Rollout after approval

  1. Tag the current tip so existing pins keep resolving. enclave pins 1f7147c:
    git tag seismic-archive/2026-10-30 1f7147c && git push origin seismic-archive/2026-10-30
  2. git push --force-with-lease=seismic:1f7147c origin seismic-split:seismic
  3. Close this PR, and bump the attestation pin in enclave in a separate PR.
  4. Future upstream syncs rebase seismic onto upstream instead of merging. Commits that land upstream drop out of the stack, tracked in Both nested-tls client and server modules export type alias NestingTlsStream #8.

samlaf and others added 8 commits October 30, 2026 11:31
Azure marketplace kernels (linux-azure, linux-azure-fde) do not ship
CONFIG_DMI_SYSFS, and where dmi-sysfs does exist its raw entries are
readable only by root, so azure evidence generation on a stock Azure CVM
fails with "Cannot retrieve platform metadata: I/O: No such file or
directory".

No verifier consults ram_bytes/num_disks for azure evidence — they exist
for the portable image-hash policies on DCAP/GCP platforms — so collect
them best-effort: use SMBIOS when available, otherwise fall back to
/proc/meminfo for RAM and a /sys/block count for disks.

The disk count holds to what platform::metadata_for would have returned:
one named list of virtual device prefixes, the same set
is_virtual_block_device excludes, and the Azure resource disk subtracted
the way metadata_for subtracts it. A LUKS node carries dm-* devices, so a
filter blind to those would over-count on exactly the machines this
fallback exists for.

The proper home for all of this is attest-measure's
platform::metadata_for, where a /proc/meminfo fallback would cover every
platform and caller; a TODO marks the added block for deletion once that
lands in easy-tee/attest and the attest pin picks it up.
Needed for
https://linear.app/seismic-systems/issue/SEI-426/refactorenclave-archive-one-atomic-re-verification-bundle-instead-of

A verdict on Azure evidence rests on two root CAs compiled into this
crate. They are the one input a relying party archiving a verification
cannot capture beside the evidence the way it captures the fetched DCAP
bundle: the AK certificate chain rides in the evidence and nothing else
on that leg is fetched, so the roots are the whole of what it chains to.

Export them as `azure::AZURE_ROOT_CA_PEMS`, each asset's file stem and
its PEM text in anchor order, so such a party can record which anchors a
verdict rested on and notice when a replaying build carries different
ones. The anchor list is now built from the same array, so the two
cannot drift.
Google signs one VMLaunchEndorsement per TDX firmware build under
GCE-cc-tcb-root_1, published at https://pki.goog/cloud_integrity/. Compile
that root in rather than fetch it at verification time, and export it with
its published name so a relying party can record which root it trusted.

x509-parser leaves the azure-verifier feature: GCP needs it on every build.
…x verification

Upstream consults Google's firmware endorsement only when a portable-image
policy matches, so a gcp-tdx verification that pins registers gets no
firmware check at all. After the provenance check, fetch the
VMLaunchEndorsement Google publishes for the quote's MRTD and verify it at
the verification instant: the leaf certificate is issued and signed by the
pinned root, both are valid then, no unrecognised critical extension, key
usage allows signing, the RSA-PSS signature over the golden measurement
holds, and the measurement names the quote's MRTD. Google publishes no
revocation source for these certificates, so none is consulted.

The fetch and cache follow provenance.rs: one verified copy per MRTD, and a
cached copy that stops verifying is evicted and refetched once.
An extended key usage, if present, must allow any purpose or server
authentication: the rule Google's reference verifier applies through Go's
default cert.Verify options. The leaf's signature is now checked after its
extensions, so a leaf restricted to another purpose is rejected for that.
The tests build such leaves with rcgen.
A live gcp-tdx verification reports the endorsement it verified next to the
DCAP collateral it consumed, so an archive of the evidence carries what is
needed to re-check the firmware later. The README documents the gcp-tdx
checks.
…dorsement

Upstream refuses archived verification of GCP evidence
(flashbots@a2898b9)
for two reasons: the replay fetched Google's firmware endorsement, whose
certificate is checked against the wall clock, and the provenance registry
is unsigned and mutable.

The recorded endorsement answers the first. A replay re-verifies it at the
snapshot's instant instead of fetching one, and a snapshot without one
fails with GcpEndorsementError::NotArchived. Nothing answers the second: a
replay skips the provenance lookup and trusts the original verification
for it. That is acceptable for re-verifying our own founding archives, so
this fork reverts the refusal. It stays fork-only until provenance has a
replayable answer.

The tests replay the crate's own GCP fixture with the endorsement Google
publishes for it, and a real GCP founding, and refuse a missing, tampered
or mismatched endorsement.
The enclave builds a verifier per call, so each would fetch its own copy of
an endorsement. GcpEndorsementChecker becomes public, and
AttestationVerifierBuilder::with_gcp_endorsement_checker shares one between
verifiers. Entries are keyed by MRTD and re-verified at every use.
@samlaf

samlaf commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

myyyyy bad this was meant for our fork.

@samlaf samlaf closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants