Skip to content

Commit d4fd8b4

Browse files
committed
adding in GPU device binding event
1 parent 3b011bd commit d4fd8b4

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

cel/cos_tlv.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const (
4848
LaunchSeparatorType
4949
MemoryMonitorType
5050
GpuCCModeType
51+
GPUDeviceAttestationBindingType
5152
)
5253

5354
// CosTlv is a specific event type created for the COS (Google Container-Optimized OS),

launcher/agent/agent_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,9 @@ func measureFakeEvents(attestAgent AttestationAgent) error {
645645
if err := attestAgent.MeasureEvent(cel.CosTlv{EventType: cel.OverrideArgType, EventContent: []byte(arg)}); err != nil {
646646
return err
647647
}
648+
if err := attestAgent.MeasureEvent(cel.CosTlv{EventType: cel.GPUDeviceAttestationBindingType, EventContent: []byte(arg)}); err != nil {
649+
return err
650+
}
648651
return nil
649652
}
650653

launcher/container_runner.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,17 @@ func (r *ContainerRunner) measureMemoryMonitor() error {
421421
return nil
422422
}
423423

424+
// TODO: Test functionality once GPU support is available.
425+
// measureGPUAttestationEvidence will measure GPU attestation claims into the COS
426+
// eventlog in the AttestationAgent.
427+
func (r *ContainerRunner) measureGPUAttestationEvidence() error {
428+
if err := r.attestAgent.MeasureEvent(cel.CosTlv{EventType: cel.GPUDeviceAttestationBindingType, EventContent: []byte{}}); err != nil {
429+
return err
430+
}
431+
r.logger.Info("Successfully measured GPU device attestation binding event")
432+
return nil
433+
}
434+
424435
// Retrieves the default OIDC token from the attestation service, and returns how long
425436
// to wait before attemping to refresh it.
426437
// The token file will be written to a tmp file and then renamed.

server/eventlog.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ func getVerifiedCosState(coscel gecel.CEL, registerType gecel.MRType) (*pb.Attes
450450
}
451451
cosState.GpuDeviceState.CcMode = pb.GPUDeviceCCMode(ccMode)
452452

453+
// TODO: add support for GPU Device Attestation Binding Event
454+
// case cel.GPUDeviceAttestationBindingType:
455+
453456
default:
454457
return nil, fmt.Errorf("found unknown COS Event Type %v", cosTlv.EventType)
455458
}

0 commit comments

Comments
 (0)