2022-12-12 09:55:30 -05:00
|
|
|
//go:build !enterprise
|
|
|
|
|
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
package measurements
|
|
|
|
|
|
|
|
import "github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
|
|
|
|
|
|
|
// DefaultsFor provides the default measurements for given cloud provider.
|
|
|
|
func DefaultsFor(provider cloudprovider.Provider) M {
|
|
|
|
switch provider {
|
|
|
|
case cloudprovider.AWS:
|
|
|
|
return M{
|
|
|
|
4: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
8: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
9: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
11: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
12: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
13: WithAllBytes(0x00, Enforce),
|
|
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
}
|
|
|
|
case cloudprovider.Azure:
|
|
|
|
return M{
|
|
|
|
4: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
8: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
9: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
11: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
12: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
13: WithAllBytes(0x00, Enforce),
|
|
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
}
|
|
|
|
case cloudprovider.GCP:
|
|
|
|
return M{
|
|
|
|
4: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
8: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
9: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
11: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
12: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
13: WithAllBytes(0x00, Enforce),
|
|
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
}
|
|
|
|
case cloudprovider.QEMU:
|
|
|
|
return M{
|
|
|
|
4: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
8: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
9: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
11: WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
12: PlaceHolderMeasurement(),
|
2023-03-22 06:47:39 -04:00
|
|
|
13: WithAllBytes(0x00, Enforce),
|
|
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce),
|
2022-12-12 09:55:30 -05:00
|
|
|
}
|
|
|
|
default:
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|