AB#2644 Fetch measurements from CDN (#653)

* Fetch measurements from CDN

* Perform metadata validation on fetched measurements

* Remove deprecated public bucket

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-11-28 10:27:33 +01:00 committed by GitHub
parent c978329839
commit d52f3db2a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 406 additions and 144 deletions

View file

@ -22,6 +22,7 @@ import (
"github.com/edgelesssys/constellation/v2/internal/attestation/measurements"
"github.com/edgelesssys/constellation/v2/internal/attestation/vtpm"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/crypto"
"github.com/edgelesssys/constellation/v2/verify/verifyproto"
@ -73,7 +74,7 @@ func main() {
if *metadata {
outputWithMetadata := measurements.WithMetadata{
CSP: strings.ToLower(*csp),
CSP: cloudprovider.FromString(*csp),
Image: strings.ToLower(*image),
Measurements: pcrs,
}

View file

@ -15,6 +15,7 @@ import (
"github.com/edgelesssys/constellation/v2/internal/attestation/measurements"
"github.com/edgelesssys/constellation/v2/internal/attestation/vtpm"
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
"github.com/google/go-tpm-tools/proto/attest"
"github.com/google/go-tpm-tools/proto/tpm"
"github.com/stretchr/testify/assert"
@ -152,22 +153,22 @@ func TestPrintPCRs(t *testing.T) {
func TestPrintPCRsWithMetadata(t *testing.T) {
testCases := map[string]struct {
format string
csp string
csp cloudprovider.Provider
image string
}{
"json": {
format: "json",
csp: "azure",
csp: cloudprovider.Azure,
image: "v2.0.0",
},
"yaml": {
csp: "gcp",
csp: cloudprovider.GCP,
image: "v2.0.0-testimage",
format: "yaml",
},
"empty format": {
format: "",
csp: "qemu",
csp: cloudprovider.QEMU,
image: "v2.0.0-testimage",
},
"empty": {},