2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-01-19 09:57:50 -05: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 11:03:15 -04:00
|
|
|
package azure
|
|
|
|
|
|
|
|
import (
|
2022-09-21 07:47:57 -04: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 11:03:15 -04:00
|
|
|
)
|
|
|
|
|
2022-08-31 14:10:49 -04: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 10:34:18 -05:00
|
|
|
func NewIssuer(log vtpm.AttestationLogger) atls.Issuer {
|
2022-10-05 09:02:46 -04:00
|
|
|
if _, err := snp.GetIDKeyDigest(vtpm.OpenVTPM); err == nil {
|
2023-02-28 10:34:18 -05:00
|
|
|
return snp.NewIssuer(log)
|
2022-08-19 06:26:29 -04:00
|
|
|
}
|
2023-02-28 10:34:18 -05:00
|
|
|
return trustedlaunch.NewIssuer(log)
|
2022-08-19 06:26:29 -04:00
|
|
|
}
|