mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 14:26:23 -04:00
Use TDX device to mark node as initialized (#1426)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
9e987778e0
commit
bda999d54e
3 changed files with 46 additions and 37 deletions
|
@ -9,6 +9,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -18,6 +19,7 @@ import (
|
|||
"github.com/edgelesssys/constellation/v2/disk-mapper/internal/rejoinclient"
|
||||
"github.com/edgelesssys/constellation/v2/disk-mapper/internal/setup"
|
||||
"github.com/edgelesssys/constellation/v2/internal/attestation/choose"
|
||||
"github.com/edgelesssys/constellation/v2/internal/attestation/tdx"
|
||||
"github.com/edgelesssys/constellation/v2/internal/attestation/vtpm"
|
||||
awscloud "github.com/edgelesssys/constellation/v2/internal/cloud/aws"
|
||||
azurecloud "github.com/edgelesssys/constellation/v2/internal/cloud/azure"
|
||||
|
@ -123,6 +125,13 @@ func main() {
|
|||
}
|
||||
defer mapper.Close()
|
||||
|
||||
// Use TDX if available
|
||||
openDevice := vtpm.OpenVTPM
|
||||
if attestVariant.OID().Equal(oid.QEMUTDX{}.OID()) {
|
||||
openDevice = func() (io.ReadWriteCloser, error) {
|
||||
return tdx.Open()
|
||||
}
|
||||
}
|
||||
setupManger := setup.New(
|
||||
log.Named("setupManager"),
|
||||
*csp,
|
||||
|
@ -130,7 +139,7 @@ func main() {
|
|||
afero.Afero{Fs: afero.NewOsFs()},
|
||||
mapper,
|
||||
setup.DiskMounter{},
|
||||
vtpm.OpenVTPM,
|
||||
openDevice,
|
||||
)
|
||||
|
||||
if err := setupManger.LogDevices(); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue