Skip to content

COCOS-591: Add support for GPU CC attestation#592

Merged
drasko merged 75 commits into
mainfrom
issue-591
May 8, 2026
Merged

COCOS-591: Add support for GPU CC attestation#592
drasko merged 75 commits into
mainfrom
issue-591

Conversation

@jovan-djukic

@jovan-djukic jovan-djukic commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

This is a feature because it adds the following functionality: GPU CC attestation. Its related to #591. In order for this feature to work the following conditions need to be met:

Component Version Source
Host kernel 6.11.0+ coconut-svsm/linux branch svsm
Guest kernel 6.17.0+ coconut-svsm/linux branch svsm-planes-v6.17
QEMU 10.1.0-based coconut-svsm/qemu branch svsm-igvm
COCONUT-SVSM v2026.02-devel-39-g797c118c coconut-svsm/svsm
OVMF Custom EDK2 coconut-svsm/edk2 branch svsm, built with -D TPM2_ENABLE
IGVM library From microsoft/igvm Installed to ~/igvminst
NVIDIA driver 570.211.01 DKMS, built with GCC 14
Guest GCC 14.x ppa:ubuntu-toolchain-r/test

The attestion service uses a rust helper to retrieve and verify the attestation report. The path to the helper is passed through an environment variable ATTESTATION_GPU_HELPER_PATH.

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.01456% with 206 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.54%. Comparing base (b44780d) to head (477c2c8).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
agent/service.go 74.56% 30 Missing and 14 partials ⚠️
pkg/resource/s3.go 52.85% 33 Missing ⚠️
pkg/atls/evidence_verifier.go 33.33% 22 Missing and 6 partials ⚠️
pkg/attestation/gpu/verifier.go 79.04% 17 Missing and 5 partials ⚠️
pkg/attestation/gpu/collector.go 75.92% 6 Missing and 7 partials ⚠️
pkg/resource/http.go 69.69% 5 Missing and 5 partials ⚠️
cli/keys.go 18.18% 9 Missing ⚠️
cli/attestation.go 36.36% 7 Missing ⚠️
cli/attestation_policy.go 25.00% 6 Missing ⚠️
pkg/attestation/eat/eat.go 60.00% 3 Missing and 3 partials ⚠️
... and 12 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #592      +/-   ##
==========================================
+ Coverage   68.36%   68.54%   +0.17%     
==========================================
  Files         116      123       +7     
  Lines        7344     7865     +521     
==========================================
+ Hits         5021     5391     +370     
- Misses       1746     1853     +107     
- Partials      577      621      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jovan-djukic jovan-djukic changed the title Feature: Add support for GPU CC attestation COCOS-591: Add support for GPU CC attestation Apr 27, 2026
@jovan-djukic jovan-djukic self-assigned this Apr 27, 2026
danko-miladinovic and others added 2 commits April 27, 2026 14:49
…port for S3, GCS, and OCI sources (#590)

* feat: implement extensible resource downloader framework with support for S3, GCS, and OCI sources

Signed-off-by: SammyOina <sammyoina@gmail.com>

* refactor: improve resource URL parsing and add support for bare OCI image references

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* fix: add empty string check and slash requirement for OCI image inference, and update python unit tests with event mock expectations

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* refactor: introduce OCIClient interface, add test coverage for decryption, and improve resource download error handling

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

* chore: remove trailing whitespace in OCI downloader and HTTP tests

Signed-off-by: Sammy Oina <sammyoina@gmail.com>

---------

Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
s.logger.Info(fmt.Sprintf("[ATTESTATION-SERVICE] Collected GPU evidence: format=%s bytes=%d",
evidence.EvidenceFormat, len(evidence.RawEvidence)))

opts = append(opts, eat.WithGPU(&eat.GPUExtensions{

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.

pkg/atls/evidence_verifier.go recomputes the expected GPU nonce from the session nonce, so persisting evidence.Nonce here makes the claim depend on the collector/helper echoing that value back correctly. If that round-trip ever diverges, the service will mint claims that can never verify. Use the gpuNonce you derived locally instead of trusting the helper response for this field.

Comment thread Makefile
NVIDIA_ATTESTATION_HELPER_RUSTFLAGS = $(strip $(RUSTFLAGS) $(if $(filter 1,$(NVAT_USE_SYSTEM_LIB)),,-C link-arg=-Wl,-rpath,$$ORIGIN/lib))

all: $(SERVICES)
.PHONY: all $(SERVICES) $(NVIDIA_ATTESTATION_HELPER) nvidia-attestation-helper-prereqs install clean

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.

make all now hard-requires NVAT setup, which is a build regression.

Default builds will fail on environments without NVAT headers/checkout, even when GPU attestation is not needed.

return fmt.Errorf("atls: gpu evidence is empty")
}

expectedNonce := sha256.Sum256(append(append([]byte(nil), claims.Nonce...), []byte(":gpu")...))

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.

Right now the session binding check only covers claims.GPUExtensions.Nonce. The raw GPU evidence is then verified using the nonce embedded in claims.GPUExtensions.EvidenceJSON, and those two values are never compared. That leaves a replay gap: a stale but self-consistent GPU evidence blob can be paired with a rewritten outer nonce and still pass helper verification. Reject the claim unless the nonce inside EvidenceJSON matches expectedNonce.

return nil, err
}

for _, opt := range opts {

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.

Guard nil ClaimsOption values to prevent panic. A call like NewEATClaims(..., nil) will panic at option invocation.

Comment thread pkg/attestation/gpu/verifier.go Outdated
return fmt.Errorf("gpu verifier response did not contain claims_json")
}

// NVIDIA attestation currently performs its own evidence-policy appraisal

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.

pkg/atls/evidence_verifier.go now passes the deployment policy into VerifyWithCoRIM, but this implementation discards it and accepts whatever the helper’s built-in NVIDIA checks allow. That makes GPU appraisal independent of the configured CoRIM and can admit hardware that the operator policy did not authorize. Please either appraise the returned GPU claims against manifest here or fail closed until manifest enforcement exists.


[dependencies]
anyhow = "1"
nv-attestation-sdk = { git = "https://github.com/NVIDIA/attestation-sdk", branch = "main" }

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.

Using branch = "main" makes builds non-deterministic and can break unexpectedly as upstream changes. Without a Cargo.lock file, this dependency will pull the latest main branch commit on every build.

This reverts commit d81d67e.
This reverts commit 5e566d5.
This reverts commit 47d13fe.
This reverts commit d81d67e.
This reverts commit 5e566d5.
This reverts commit 47d13fe.
@drasko drasko merged commit 27db9b2 into main May 8, 2026
10 checks passed
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.

4 participants