2022-09-05 09:06:08 +02:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-01-19 15:57:50 +01:00
|
|
|
/*
|
|
|
|
# Azure attestation
|
|
|
|
|
|
|
|
Constellation supports multiple attestation technologies on Azure.
|
|
|
|
|
|
|
|
- SEV - Secure Nested Paging (SEV-SNP)
|
|
|
|
|
|
|
|
TPM attestation verified using an SEV-SNP attestation statement.
|
|
|
|
|
|
|
|
- Trusted Launch
|
|
|
|
|
|
|
|
Basic TPM attestation.
|
|
|
|
*/
|
2022-03-22 16:03:15 +01:00
|
|
|
package azure
|
|
|
|
|
|
|
|
import (
|
2022-09-21 13:47:57 +02:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/atls"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/azure/snp"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/azure/trustedlaunch"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/vtpm"
|
2022-03-22 16:03:15 +01:00
|
|
|
)
|
|
|
|
|
2022-08-31 20:10:49 +02:00
|
|
|
// NewIssuer returns an SNP issuer if it can successfully read the idkeydigest from the TPM.
|
|
|
|
// Otherwise returns a Trusted Launch issuer.
|
2023-02-28 16:34:18 +01:00
|
|
|
func NewIssuer(log vtpm.AttestationLogger) atls.Issuer {
|
2022-10-05 15:02:46 +02:00
|
|
|
if _, err := snp.GetIDKeyDigest(vtpm.OpenVTPM); err == nil {
|
2023-02-28 16:34:18 +01:00
|
|
|
return snp.NewIssuer(log)
|
2022-08-19 12:26:29 +02:00
|
|
|
}
|
2023-02-28 16:34:18 +01:00
|
|
|
return trustedlaunch.NewIssuer(log)
|
2022-08-19 12:26:29 +02:00
|
|
|
}
|