diff --git a/internal/attestation/measurements/overrides.go b/internal/attestation/measurements/overrides.go index 1118756ce8..af7dcfa52b 100644 --- a/internal/attestation/measurements/overrides.go +++ b/internal/attestation/measurements/overrides.go @@ -98,12 +98,12 @@ type valueOverride struct { func ApplyOverrides(in M, csp cloudprovider.Provider, attestationVariant string) (M, error) { out := in.Copy() var matchingOverrides []measurementOverride - if cspOverride, ok := measurementOverridesForCSP[csp.String()]; ok { - matchingOverrides = append(matchingOverrides, cspOverride) - } if attestationVariantOverride, ok := measurementOverridesForAttestationVariant[attestationVariant]; ok { matchingOverrides = append(matchingOverrides, attestationVariantOverride) } + if cspOverride, ok := measurementOverridesForCSP[csp.String()]; ok { + matchingOverrides = append(matchingOverrides, cspOverride) + } for _, override := range matchingOverrides { for _, i := range override.ValueOverrides { m, ok := out[i.Index] diff --git a/internal/osimage/uplosi/uplosiupload.go b/internal/osimage/uplosi/uplosiupload.go index ea5054db67..31bc67aded 100644 --- a/internal/osimage/uplosi/uplosiupload.go +++ b/internal/osimage/uplosi/uplosiupload.go @@ -209,21 +209,32 @@ func awsParseAMIARN(arn string) (region string, amiID string, retErr error) { func extendAzureConfig(azureConfig map[string]any, version versionsapi.Version, attestationVariant string, timestamp time.Time) { azureConfig["attestationVariant"] = attestationVariant - azureConfig["sharedImageGallery"] = azureGalleryName(version) + azureConfig["sharedImageGallery"] = azureGalleryName(version, attestationVariant) azureConfig["imageDefinitionName"] = azureImageOffer(version) azureConfig["offer"] = azureImageOffer(version) formattedTime := timestamp.Format(timestampFormat) azureConfig["diskName"] = fmt.Sprintf("constellation-%s-%s-%s", version.Stream(), formattedTime, attestationVariant) } -func azureGalleryName(version versionsapi.Version) string { +func azureGalleryName(version versionsapi.Version, attestationVariant string) string { + var prefix string switch version.Stream() { case "stable": - return "Constellation_CVM" + prefix = "Constellation" case "debug": - return "Constellation_Debug_CVM" + prefix = "Constellation_Debug" + default: + prefix = "Constellation_Testing" } - return "Constellation_Testing_CVM" + + var suffix string + switch attestationVariant { + case "azure-tdx": + suffix = "_TDX" + case "azure-sev-snp": + suffix = "_CVM" + } + return prefix + suffix } func azureImageOffer(version versionsapi.Version) string {