mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-05 05:11:30 -04:00
Add TDX bazel files
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
bda999d54e
commit
c478df36fa
10 changed files with 30 additions and 23 deletions
|
@ -6,19 +6,10 @@ provider "registry.terraform.io/dmacvicar/libvirt" {
|
||||||
constraints = "0.7.1"
|
constraints = "0.7.1"
|
||||||
hashes = [
|
hashes = [
|
||||||
"h1:1yEJVPVFkRkbRY63+sFRAWau/eJ0xlecHWLCV8spkWU=",
|
"h1:1yEJVPVFkRkbRY63+sFRAWau/eJ0xlecHWLCV8spkWU=",
|
||||||
"h1:2TW4H7EJz0p6rMGjJ14Fy1etM/pGp4vPOllymBmRl90=",
|
|
||||||
"h1:6n+4i1nSCzOcAdvqAoWM43uZbL5qnZvIAXF8UvhB/to=",
|
|
||||||
"h1:6qa1y7cSCcdMYgWpVVSZzCemOQfy2ncGj/rxfjMcvyw=",
|
|
||||||
"h1:7mozCSkEConY5A0SVKeXJK5W2DjQuPiAPwZw6gWfSfI=",
|
|
||||||
"h1:AJn6IML1iiq9oIUdDQTDApMvsfSKfMncF4RoKnhpNaY=",
|
"h1:AJn6IML1iiq9oIUdDQTDApMvsfSKfMncF4RoKnhpNaY=",
|
||||||
"h1:G114r+ESpxpMCnBxFXZZ3+HktoNK4WXAJ5M3GRwvgBQ=",
|
"h1:G114r+ESpxpMCnBxFXZZ3+HktoNK4WXAJ5M3GRwvgBQ=",
|
||||||
"h1:IWlvnTGnDMZFUxW1BFHlM4VpGfYrTFjjSO7cXoruu54=",
|
|
||||||
"h1:SJd8sKf1raygPGCWi+BDQVIgk6D7cNTAqCOWDF6aR7U=",
|
|
||||||
"h1:ZG+KVAKVm++wfWnGdc8QIFn1LHRycUnmYibMg4REQyk=",
|
"h1:ZG+KVAKVm++wfWnGdc8QIFn1LHRycUnmYibMg4REQyk=",
|
||||||
"h1:bKcU6mYeMAXvtv1wbJSEKqNxYmxkqXY+Obztn22Y4g4=",
|
|
||||||
"h1:kk1aVdohwN9Shcsd5oHsQWMUet428NbQP5VvTfu5cCo=",
|
|
||||||
"h1:rDm9KgxNWuhdTCJpfepeTzCB/b24bKrOMN57637RZtU=",
|
"h1:rDm9KgxNWuhdTCJpfepeTzCB/b24bKrOMN57637RZtU=",
|
||||||
"h1:sba9mbcScff5YyBWaGzCy17Tzk2qbpYO6FutG06PqMo=",
|
|
||||||
"zh:1c59f2ab68da6326637ee8b03433e84af76b3e3562f251a7f2aa239a7b262a8d",
|
"zh:1c59f2ab68da6326637ee8b03433e84af76b3e3562f251a7f2aa239a7b262a8d",
|
||||||
"zh:236e24ecf036e99d9d1e2081a39dc9cb4b8993850a37141a1449f20750f883d6",
|
"zh:236e24ecf036e99d9d1e2081a39dc9cb4b8993850a37141a1449f20750f883d6",
|
||||||
"zh:4519c22b1f00c1d37d60ac6c2cb7ad5ab9dbcd44a80b4f61e68aacb54eae017d",
|
"zh:4519c22b1f00c1d37d60ac6c2cb7ad5ab9dbcd44a80b4f61e68aacb54eae017d",
|
||||||
|
|
|
@ -12,6 +12,7 @@ go_library(
|
||||||
"//disk-mapper/internal/rejoinclient",
|
"//disk-mapper/internal/rejoinclient",
|
||||||
"//disk-mapper/internal/setup",
|
"//disk-mapper/internal/setup",
|
||||||
"//internal/attestation/choose",
|
"//internal/attestation/choose",
|
||||||
|
"//internal/attestation/tdx",
|
||||||
"//internal/attestation/vtpm",
|
"//internal/attestation/vtpm",
|
||||||
"//internal/cloud/aws",
|
"//internal/cloud/aws",
|
||||||
"//internal/cloud/azure",
|
"//internal/cloud/azure",
|
||||||
|
|
|
@ -127,7 +127,7 @@ func main() {
|
||||||
|
|
||||||
// Use TDX if available
|
// Use TDX if available
|
||||||
openDevice := vtpm.OpenVTPM
|
openDevice := vtpm.OpenVTPM
|
||||||
if attestVariant.OID().Equal(oid.QEMUTDX{}.OID()) {
|
if attestVariant.OID().Equal(variant.QEMUTDX{}.OID()) {
|
||||||
openDevice = func() (io.ReadWriteCloser, error) {
|
openDevice = func() (io.ReadWriteCloser, error) {
|
||||||
return tdx.Open()
|
return tdx.Open()
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ go_library(
|
||||||
deps = [
|
deps = [
|
||||||
"//internal/cloud/cloudprovider",
|
"//internal/cloud/cloudprovider",
|
||||||
"//internal/sigstore",
|
"//internal/sigstore",
|
||||||
|
"//internal/variant",
|
||||||
"@com_github_google_go_tpm//tpmutil",
|
"@com_github_google_go_tpm//tpmutil",
|
||||||
"@com_github_siderolabs_talos_pkg_machinery//config/encoder",
|
"@com_github_siderolabs_talos_pkg_machinery//config/encoder",
|
||||||
"@in_gopkg_yaml_v3//:yaml_v3",
|
"@in_gopkg_yaml_v3//:yaml_v3",
|
||||||
|
|
|
@ -48,6 +48,7 @@ go_test(
|
||||||
"//internal/config/instancetypes",
|
"//internal/config/instancetypes",
|
||||||
"//internal/constants",
|
"//internal/constants",
|
||||||
"//internal/file",
|
"//internal/file",
|
||||||
|
"//internal/variant",
|
||||||
"@com_github_go_playground_locales//en",
|
"@com_github_go_playground_locales//en",
|
||||||
"@com_github_go_playground_universal_translator//:universal-translator",
|
"@com_github_go_playground_universal_translator//:universal-translator",
|
||||||
"@com_github_go_playground_validator_v10//:validator",
|
"@com_github_go_playground_validator_v10//:validator",
|
||||||
|
|
|
@ -11,6 +11,7 @@ go_library(
|
||||||
"//internal/logger",
|
"//internal/logger",
|
||||||
"//internal/variant",
|
"//internal/variant",
|
||||||
"//measurement-reader/internal/sorted",
|
"//measurement-reader/internal/sorted",
|
||||||
|
"//measurement-reader/internal/tdx",
|
||||||
"//measurement-reader/internal/tpm",
|
"//measurement-reader/internal/tpm",
|
||||||
"@org_uber_go_zap//:zap",
|
"@org_uber_go_zap//:zap",
|
||||||
"@org_uber_go_zap//zapcore",
|
"@org_uber_go_zap//zapcore",
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
load("//bazel/go:go_test.bzl", "go_test")
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "sorted",
|
name = "sorted",
|
||||||
srcs = ["sorted.go"],
|
srcs = ["sorted.go"],
|
||||||
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/sorted",
|
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/sorted",
|
||||||
visibility = ["//measurement-reader:__subpackages__"],
|
visibility = ["//measurement-reader:__subpackages__"],
|
||||||
|
deps = ["//internal/attestation/measurements"],
|
||||||
|
)
|
||||||
|
|
||||||
|
go_test(
|
||||||
|
name = "sorted_test",
|
||||||
|
srcs = ["sorted_test.go"],
|
||||||
|
embed = [":sorted"],
|
||||||
|
deps = [
|
||||||
|
"//internal/attestation/measurements",
|
||||||
|
"@com_github_stretchr_testify//assert",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,6 +23,7 @@ type Measurement struct {
|
||||||
// MeasurementType are the supported attestation types we can sort.
|
// MeasurementType are the supported attestation types we can sort.
|
||||||
type MeasurementType uint32
|
type MeasurementType uint32
|
||||||
|
|
||||||
|
// Available measurement types.
|
||||||
const (
|
const (
|
||||||
TPM MeasurementType = iota
|
TPM MeasurementType = iota
|
||||||
TDX
|
TDX
|
||||||
|
|
12
measurement-reader/internal/tdx/BUILD.bazel
Normal file
12
measurement-reader/internal/tdx/BUILD.bazel
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "tdx",
|
||||||
|
srcs = ["tdx.go"],
|
||||||
|
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/tdx",
|
||||||
|
visibility = ["//measurement-reader:__subpackages__"],
|
||||||
|
deps = [
|
||||||
|
"//internal/attestation/tdx",
|
||||||
|
"//measurement-reader/internal/sorted",
|
||||||
|
],
|
||||||
|
)
|
|
@ -1,5 +1,4 @@
|
||||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
load("//bazel/go:go_test.bzl", "go_test")
|
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "tpm",
|
name = "tpm",
|
||||||
|
@ -7,21 +6,9 @@ go_library(
|
||||||
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/tpm",
|
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/tpm",
|
||||||
visibility = ["//measurement-reader:__subpackages__"],
|
visibility = ["//measurement-reader:__subpackages__"],
|
||||||
deps = [
|
deps = [
|
||||||
"//internal/attestation/measurements",
|
|
||||||
"//internal/attestation/vtpm",
|
"//internal/attestation/vtpm",
|
||||||
"//measurement-reader/internal/sorted",
|
"//measurement-reader/internal/sorted",
|
||||||
"@com_github_google_go_tpm//tpm2",
|
"@com_github_google_go_tpm//tpm2",
|
||||||
"@com_github_google_go_tpm_tools//client",
|
"@com_github_google_go_tpm_tools//client",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
go_test(
|
|
||||||
name = "tpm_test",
|
|
||||||
srcs = ["tpm_test.go"],
|
|
||||||
embed = [":tpm"],
|
|
||||||
deps = [
|
|
||||||
"//internal/attestation/measurements",
|
|
||||||
"//measurement-reader/internal/sorted",
|
|
||||||
"@com_github_stretchr_testify//assert",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue