Skip to content

feat: cache NVIDIA GPU attestation collateral#791

Open
kvinwang wants to merge 2 commits into
hapi-gpu-verifyfrom
hapi-gpu-ocsp-cache
Open

feat: cache NVIDIA GPU attestation collateral#791
kvinwang wants to merge 2 commits into
hapi-gpu-verifyfrom
hapi-gpu-ocsp-cache

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

Builds on #789 and removes NVIDIA's live OCSP/RIM services from the warm GPU-VM boot path.

  • add dstack-gpu-attest-proxy, a persistent PCCS-like cache:
    • POST /ocsp keys responses by the DER OCSP request list, excluding the per-request nonce
    • GET /v1/rim/<id> caches version-addressed NVIDIA RIM documents
    • cache metadata/body digests survive restarts, expired entries fail closed, and per-kind entry counts are bounded
    • OCSP lifetime is capped by the signed nextUpdate (or one hour from thisUpdate when absent)
  • add optional nvidia_attestation_proxy_url to VMM config and .sys-config.json
  • route nvattest OCSP and RIM calls through the configured proxy
  • package NVIDIA's allow_trust_outpost_ocsp.rego in the GPU image and select it only in proxy mode
  • patch the pinned NVIDIA SDK to enforce thisUpdate/nextUpdate with OCSP_check_validity, so accepting a cached nonce mismatch cannot turn an old signed good response into an indefinite replay
  • document deployment, cache behavior, and the sys-config trust boundary

The proxy never signs or rewrites collateral. The guest still verifies NVIDIA signatures, certificate/RIM chains, response freshness, measurements, CC state, and the independent fresh GPU evidence nonce added by #789.

Configuration

Run the proxy on a host/fleet address reachable during early guest boot:

dstack-gpu-attest-proxy \
  --listen 0.0.0.0:8090 \
  --cache-dir /var/cache/dstack/gpu-attest-proxy

Then configure the VMM:

[cvm]
nvidia_attestation_proxy_url = "http://10.0.2.2:8090"

See dstack/gpu-attest-proxy/README.md for TTLs and environment variables.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -p dstack-gpu-attest-proxy -p dstack-util -p dstack-types -p dstack-vmm --all-targets -- -D warnings
  • cargo test -p dstack-gpu-attest-proxy -p dstack-util -p dstack-types -p dstack-vmm
    • proxy: 10 tests
    • dstack-types: 30 tests
    • dstack-util: 47 tests
    • dstack-vmm: 42 tests
  • python3 -m py_compile dstack/scripts/bin/dstack-cloud
  • applied the Yocto patch with git apply --check against NVIDIA SDK commit 9d12801cea8a198ea0f29640dfaf8a4017c841c5
  • live NVIDIA OCSP check using the repository's GH100 certificate chain:
    • first request: X-Dstack-Cache: MISS
    • a second request for the same CertID with a different nonce: X-Dstack-Cache: HIT
    • cached DER remained openssl ocsp-verifiable as good with the original signed nextUpdate

Stacked on #789; review only the final commit in this PR.

Copilot AI review requested due to automatic review settings July 17, 2026 06:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a persistent “PCCS-like” cache service for NVIDIA GPU attestation collateral (OCSP + RIM) and wires it through VMM/sys-config so GPU guests can complete local attestation without relying on NVIDIA’s live services during warm boot.

Changes:

  • Introduces dstack-gpu-attest-proxy HTTP service with bounded persistent caches for OCSP and RIM collateral.
  • Adds nvidia_attestation_proxy_url plumbing (VMM config → .sys-config.json → guest nvattest invocation), including selecting NVIDIA’s Trust Outpost OCSP policy when proxy mode is enabled.
  • Updates Yocto packaging and docs; applies an NVIDIA SDK patch to enforce OCSP thisUpdate/nextUpdate freshness validation.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
os/yocto/layers/meta-nvidia/recipes-graphics/nvattest/nvattest_2026.06.09.bb Applies OCSP freshness patch and installs the Trust Outpost policy into the GPU image.
os/yocto/layers/meta-nvidia/recipes-graphics/nvattest/files/0001-validate-ocsp-response-freshness.patch Patches NVIDIA SDK to enforce OCSP validity windows even when nonce can’t match.
dstack/vmm/vmm.toml Documents the new optional VMM config knob.
dstack/vmm/src/config.rs Adds nvidia_attestation_proxy_url to VMM config struct.
dstack/vmm/src/app.rs Exposes nvidia_attestation_proxy_url via sys-config; adds coverage in tests.
dstack/scripts/bin/dstack-cloud Supports emitting nvidia_attestation_proxy_url into generated .sys-config.json.
dstack/gpu-attest-proxy/src/ocsp.rs Implements OCSP request key derivation (nonce-agnostic) and cache expiry calculation from signed timestamps.
dstack/gpu-attest-proxy/src/main.rs CLI entrypoint / configuration for running the proxy daemon.
dstack/gpu-attest-proxy/src/lib.rs HTTP server, upstream fetching, caching logic, and request routing.
dstack/gpu-attest-proxy/src/cache.rs Persistent cache storage with metadata + body digests and bounded eviction.
dstack/gpu-attest-proxy/README.md Documents deployment, cache behavior, and operational headers.
dstack/gpu-attest-proxy/Cargo.toml New crate manifest for the proxy.
dstack/dstack-util/src/system_setup.rs Routes nvattest OCSP/RIM calls through proxy when configured; selects Trust Outpost policy.
dstack/dstack-util/Cargo.toml Adds url dependency for proxy URL validation.
dstack/dstack-types/src/lib.rs Adds nvidia_attestation_proxy_url to sys-config schema.
dstack/Cargo.toml Adds gpu-attest-proxy to the Rust workspace.
dstack/Cargo.lock Locks new crate and dependency graph updates.
docs/tutorials/vmm-configuration.md Documents how to enable the GPU attestation cache/proxy.
docs/security/cvm-boundaries.md Documents the trust boundary implications of nvidia_attestation_proxy_url.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dstack/gpu-attest-proxy/src/lib.rs
Comment thread dstack/gpu-attest-proxy/src/lib.rs
Comment thread dstack/gpu-attest-proxy/src/lib.rs
Comment thread dstack/gpu-attest-proxy/src/lib.rs
Comment thread dstack/gpu-attest-proxy/src/lib.rs
Comment thread dstack/gpu-attest-proxy/src/main.rs
Comment thread dstack/dstack-util/src/system_setup.rs
Comment thread dstack/dstack-util/src/system_setup.rs
Comment thread dstack/dstack-util/src/system_setup.rs
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