From 59faa2b6929eedfee9f0d804c12c44fa06b7ce75 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:59:07 +0100 Subject: [PATCH] attestation: add hardcoded OpenStack enterprise measurements --- internal/attestation/measurements/measurements.go | 3 +++ .../attestation/measurements/measurements_enterprise.go | 1 + internal/attestation/measurements/measurements_oss.go | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/internal/attestation/measurements/measurements.go b/internal/attestation/measurements/measurements.go index 479a4db32..62172dd26 100644 --- a/internal/attestation/measurements/measurements.go +++ b/internal/attestation/measurements/measurements.go @@ -506,6 +506,9 @@ func DefaultsFor(provider cloudprovider.Provider, attestationVariant variant.Var case provider == cloudprovider.GCP && attestationVariant == variant.GCPSEVES{}: return gcp_GCPSEVES.Copy() + case provider == cloudprovider.OpenStack && attestationVariant == variant.QEMUVTPM{}: + return openstack_QEMUVTPM.Copy() + case provider == cloudprovider.QEMU && attestationVariant == variant.QEMUTDX{}: return qemu_QEMUTDX.Copy() diff --git a/internal/attestation/measurements/measurements_enterprise.go b/internal/attestation/measurements/measurements_enterprise.go index 684a2743d..f5884ff5f 100644 --- a/internal/attestation/measurements/measurements_enterprise.go +++ b/internal/attestation/measurements/measurements_enterprise.go @@ -22,6 +22,7 @@ var ( azure_AzureTDX = M{1: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 2: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 3: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 4: {Expected: []byte{0x79, 0xae, 0x46, 0x04, 0x65, 0x44, 0x27, 0x00, 0x15, 0x42, 0xa9, 0xc0, 0xa0, 0x1d, 0x38, 0x85, 0x01, 0x1c, 0x21, 0xc0, 0xcf, 0xfd, 0x69, 0x3a, 0xa6, 0xea, 0x9e, 0x6e, 0x35, 0x3b, 0x5d, 0xfb}, ValidationOpt: Enforce}, 8: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 9: {Expected: []byte{0xee, 0xe7, 0x01, 0x87, 0x27, 0x7f, 0xcf, 0x0a, 0xca, 0x00, 0x57, 0x8f, 0x27, 0xf1, 0x57, 0x04, 0xe7, 0x4e, 0x3a, 0x81, 0x6b, 0x1e, 0xaf, 0x39, 0x5c, 0x11, 0x74, 0xcd, 0xbc, 0xd7, 0xc3, 0x5a}, ValidationOpt: Enforce}, 11: {Expected: []byte{0x55, 0x5e, 0x5d, 0xa6, 0x04, 0xbc, 0x6e, 0x88, 0xc8, 0x92, 0x94, 0x7b, 0xd0, 0xb0, 0x6c, 0x16, 0x80, 0xc8, 0xe7, 0x4e, 0xee, 0xf2, 0x33, 0x81, 0x5c, 0xf3, 0x5d, 0xf1, 0xb1, 0x77, 0x4f, 0x49}, ValidationOpt: Enforce}, 12: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 13: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 14: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: WarnOnly}, 15: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}} azure_AzureTrustedLaunch M gcp_GCPSEVES = M{1: {Expected: []byte{0x36, 0x95, 0xdc, 0xc5, 0x5e, 0x3a, 0xa3, 0x40, 0x27, 0xc2, 0x77, 0x93, 0xc8, 0x5c, 0x72, 0x3c, 0x69, 0x7d, 0x70, 0x8c, 0x42, 0xd1, 0xf7, 0x3b, 0xd6, 0xfa, 0x4f, 0x26, 0x60, 0x8a, 0x5b, 0x24}, ValidationOpt: WarnOnly}, 2: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 3: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 4: {Expected: []byte{0x2e, 0x4c, 0xc5, 0x1e, 0x87, 0x18, 0x59, 0xc7, 0xbf, 0xa8, 0x33, 0xc5, 0x25, 0x2e, 0x01, 0x94, 0x43, 0x10, 0x14, 0x32, 0xef, 0xb1, 0xac, 0x5c, 0xf1, 0x22, 0xea, 0x2d, 0x04, 0x7b, 0x88, 0x42}, ValidationOpt: Enforce}, 6: {Expected: []byte{0x3d, 0x45, 0x8c, 0xfe, 0x55, 0xcc, 0x03, 0xea, 0x1f, 0x44, 0x3f, 0x15, 0x62, 0xbe, 0xec, 0x8d, 0xf5, 0x1c, 0x75, 0xe1, 0x4a, 0x9f, 0xcf, 0x9a, 0x72, 0x34, 0xa1, 0x3f, 0x19, 0x8e, 0x79, 0x69}, ValidationOpt: WarnOnly}, 8: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 9: {Expected: []byte{0xaa, 0x6c, 0x75, 0x22, 0x1d, 0x19, 0x7f, 0x50, 0x1d, 0xb3, 0xba, 0xbf, 0x62, 0xf6, 0x4c, 0xe3, 0xdc, 0xbc, 0x36, 0x28, 0xa8, 0xd8, 0xc7, 0x97, 0x6b, 0x03, 0x5e, 0xd6, 0xd2, 0x7f, 0xa0, 0xa9}, ValidationOpt: Enforce}, 11: {Expected: []byte{0x7b, 0xb4, 0x17, 0xdd, 0x00, 0x01, 0x3f, 0x3e, 0x80, 0x3a, 0xa9, 0xf0, 0x70, 0xac, 0xa7, 0xfb, 0x22, 0x90, 0xf5, 0xb1, 0x93, 0xb7, 0x11, 0x78, 0xfa, 0x20, 0x1a, 0xb1, 0x60, 0xeb, 0x38, 0x13}, ValidationOpt: Enforce}, 12: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 13: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 14: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: WarnOnly}, 15: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}} + openstack_QEMUVTPM = M{4: {Expected: []byte{0x3a, 0x3c, 0x53, 0xa0, 0x8a, 0xde, 0xeb, 0x91, 0xe5, 0xf7, 0xbe, 0x0f, 0x9c, 0x2d, 0x9b, 0x97, 0x27, 0x31, 0xee, 0x6d, 0x2e, 0xc8, 0x90, 0x84, 0xc0, 0xb6, 0xe8, 0x0d, 0xaf, 0x7e, 0x4c, 0xdb}, ValidationOpt: Enforce}, 8: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 9: {Expected: []byte{0xdf, 0xdf, 0x98, 0x7a, 0xb5, 0x2d, 0x49, 0xaa, 0x1a, 0x06, 0xa5, 0x5d, 0x1c, 0x8f, 0xa0, 0x69, 0xe6, 0x3a, 0xb6, 0xe7, 0x99, 0x7b, 0x33, 0x31, 0x04, 0x2f, 0x60, 0x1a, 0xcf, 0x1b, 0x87, 0xf7}, ValidationOpt: Enforce}, 11: {Expected: []byte{0x55, 0xf2, 0xb9, 0x62, 0x86, 0x52, 0x73, 0x58, 0xce, 0x3d, 0x1b, 0x62, 0xf6, 0xd5, 0xc6, 0x2f, 0xe9, 0x74, 0x48, 0xce, 0x7d, 0x86, 0x28, 0xd8, 0x5e, 0xd7, 0x1c, 0x64, 0x44, 0x3d, 0x60, 0x24}, ValidationOpt: Enforce}, 12: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 13: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 14: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: WarnOnly}, 15: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}} qemu_QEMUTDX M qemu_QEMUVTPM = M{4: {Expected: []byte{0x8f, 0x28, 0xa1, 0xde, 0xe3, 0x7d, 0x48, 0x1f, 0x4a, 0xca, 0x3d, 0xb5, 0xd7, 0xfa, 0xc6, 0x36, 0x4d, 0xa8, 0x7d, 0x23, 0xac, 0xb0, 0xab, 0xf1, 0x32, 0x3e, 0xa7, 0x26, 0x30, 0x31, 0x6c, 0x54}, ValidationOpt: Enforce}, 8: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 9: {Expected: []byte{0xf7, 0xed, 0x45, 0x70, 0x71, 0xa4, 0x21, 0x8a, 0x58, 0xe4, 0x7a, 0x44, 0x4a, 0xb2, 0x0f, 0x6c, 0xf3, 0x1a, 0x8f, 0xf3, 0xb6, 0x23, 0xfa, 0x8f, 0x28, 0x2d, 0x58, 0xc5, 0xf7, 0x66, 0xe3, 0x9b}, ValidationOpt: Enforce}, 11: {Expected: []byte{0x6a, 0x5e, 0xc3, 0x69, 0xe1, 0xa5, 0x0c, 0xf3, 0x71, 0xf7, 0xfe, 0x51, 0x58, 0xa3, 0xd1, 0x30, 0x99, 0x2f, 0xbf, 0x3f, 0x29, 0x28, 0xd8, 0xe1, 0xe4, 0x3d, 0xa5, 0x6c, 0x40, 0xc1, 0xea, 0x60}, ValidationOpt: Enforce}, 12: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 13: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}, 15: {Expected: []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, ValidationOpt: Enforce}} ) diff --git a/internal/attestation/measurements/measurements_oss.go b/internal/attestation/measurements/measurements_oss.go index 88782ba72..552d6bd26 100644 --- a/internal/attestation/measurements/measurements_oss.go +++ b/internal/attestation/measurements/measurements_oss.go @@ -64,6 +64,15 @@ var ( 13: WithAllBytes(0x00, Enforce, PCRMeasurementLength), uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength), } + openstack_QEMUVTPM = M{ + 4: PlaceHolderMeasurement(PCRMeasurementLength), + 8: WithAllBytes(0x00, Enforce, PCRMeasurementLength), + 9: PlaceHolderMeasurement(PCRMeasurementLength), + 11: WithAllBytes(0x00, Enforce, PCRMeasurementLength), + 12: PlaceHolderMeasurement(PCRMeasurementLength), + 13: WithAllBytes(0x00, Enforce, PCRMeasurementLength), + uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength), + } qemu_QEMUTDX = M{ 0: PlaceHolderMeasurement(TDXMeasurementLength), 1: PlaceHolderMeasurement(TDXMeasurementLength),