From 3aa01773337e683e79061c1b1735747f5617472f Mon Sep 17 00:00:00 2001 From: Leonard Cohnen Date: Sun, 30 Oct 2022 03:36:58 +0100 Subject: [PATCH] join-service: add AWS attestation --- internal/watcher/validator.go | 5 +++++ joinservice/cmd/main.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/internal/watcher/validator.go b/internal/watcher/validator.go index 11c843c68..ffd49db13 100644 --- a/internal/watcher/validator.go +++ b/internal/watcher/validator.go @@ -15,6 +15,7 @@ import ( "sync" "github.com/edgelesssys/constellation/v2/internal/atls" + "github.com/edgelesssys/constellation/v2/internal/attestation/aws" "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/gcp" @@ -40,6 +41,10 @@ type Updatable struct { func NewValidator(log *logger.Logger, csp string, fileHandler file.Handler, azureCVM bool) (*Updatable, error) { var newValidator newValidatorFunc switch cloudprovider.FromString(csp) { + case cloudprovider.AWS: + newValidator = func(m map[uint32][]byte, e []uint32, _ []byte, _ bool, log *logger.Logger) atls.Validator { + return aws.NewValidator(m, e, log) + } case cloudprovider.Azure: if azureCVM { newValidator = func(m map[uint32][]byte, e []uint32, idkeydigest []byte, enforceIdKeyDigest bool, log *logger.Logger) atls.Validator { diff --git a/joinservice/cmd/main.go b/joinservice/cmd/main.go index 93cc30c3b..05f6d6873 100644 --- a/joinservice/cmd/main.go +++ b/joinservice/cmd/main.go @@ -16,6 +16,7 @@ import ( "time" "github.com/edgelesssys/constellation/v2/internal/atls" + awscloud "github.com/edgelesssys/constellation/v2/internal/cloud/aws" azurecloud "github.com/edgelesssys/constellation/v2/internal/cloud/azure" "github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider" gcpcloud "github.com/edgelesssys/constellation/v2/internal/cloud/gcp" @@ -118,6 +119,11 @@ func getVPCIP(ctx context.Context, provider string) (string, error) { var err error switch cloudprovider.FromString(provider) { + case cloudprovider.AWS: + metadata, err = awscloud.New(ctx) + if err != nil { + return "", err + } case cloudprovider.Azure: metadata, err = azurecloud.NewMetadata(ctx) if err != nil {