feat(attest): add extraData parameter for runtime attestation#129
Open
mpjunior92 wants to merge 3 commits intomasterfrom
Open
feat(attest): add extraData parameter for runtime attestation#129mpjunior92 wants to merge 3 commits intomasterfrom
mpjunior92 wants to merge 3 commits intomasterfrom
Conversation
Passes extraData as extra_data to TEE server /v1/bound_evidence and as extra_data to KMS /auth/attest. Enforces 64-byte hardware limit (Intel TDX REPORTDATA / AMD SEV-SNP ReportData). Omitting extraData preserves existing behavior.
…plication When extraData is provided, JwtProvider bypasses the long-lived cache and requests a fresh attestation JWT. Concurrent requests for the same extraData are deduplicated via pendingExtraData map to avoid thundering herd on TEE hardware calls.
go-tpm-tools hashes extraData with SHA-256/SHA-512 before binding it into the hardware nonce (nonce.go:33,53), so the 64-byte hardware field limit does not apply to the caller's input. Arbitrary data up to 1MB is supported.
7 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
Adds optional
extraDataparameter toAttestClient.attest()andJwtProvider.getToken()for binding arbitrary application data (e.g., hash of a blog post, agent configuration) into TEE attestation evidence.When
extraDatais provided, the SDK sends it asextra_data(base64) to the TEE server's/v1/bound_evidenceendpoint and to the KMS/auth/attestendpoint. go-tpm-tools cryptographically bindsextra_datainto the attestation nonce via SHA-256/SHA-512 hashing, so arbitrary data up to 1MB is supported. When omitted, behavior is unchanged — fully backwards compatible.JwtProvider.getToken(extraData)bypasses the long-lived token cache (each runtime attestation is per-action) but deduplicates concurrent requests for the sameextraDatavia an in-flight promise map, preventing thundering herd on TEE hardware calls.Companion PR: Layr-Labs/eigenx-kms#17 — KMS server-side changes to accept
extra_data, verify it in the nonce, and embed it in the issued JWT.Changes
attest-client.ts—attest(extraData?: Buffer)with 1MB size limitjwt-provider.ts—getToken(extraData?: Buffer)with per-key dedup mapattest-client.test.ts— 4 tests (TEE forwarding, KMS forwarding, omission, size limit)jwt-provider.test.ts— 3 new tests (cache bypass, dedup, different keys)Test plan
npx vitest run packages/sdk/src/client/modules/attest/— 13 tests passingn2d) — JWT containsextra_dataclaimc3) — JWT containsextra_dataclaime2) — JWT containsextra_dataclaim🤖 Generated with Claude Code