mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 06:16:08 -04:00
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:
parent
c978329839
commit
d52f3db2a3
16 changed files with 406 additions and 144 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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": {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue