Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: support to build components for all platforms and amd #453

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ARCH ?= $(shell uname -m)
DESTDIR ?= /usr/local/bin

LIBC ?= musl

# TODO: delete `KBC` parameter once KBC related functionalities are
# all deprecated in code.
KBC ?=

NO_RESOURCE_PROVIDER ?=
Expand Down Expand Up @@ -34,6 +37,22 @@ else ifeq ($(TEE_PLATFORM), snp)
KBC = cc_kbc_snp
else ifeq ($(TEE_PLATFORM), az-snp-vtpm)
KBC = cc_kbc_az_snp_vtpm
else ifeq ($(TEE_PLATFORM), all)
LIBC = gnu
KBC = cc_kbc_all_attesters
ifeq ($(NO_RESOURCE_PROVIDER), true)
RESOURCE_PROVIDER :=
else
RESOURCE_PROVIDER = sev,kbs
endif
else ifeq ($(TEE_PLATFORM), amd)
LIBC = gnu
KBC = cc_kbc_snp,online_sev_kbc
ifeq ($(NO_RESOURCE_PROVIDER), true)
RESOURCE_PROVIDER :=
else
RESOURCE_PROVIDER = sev,kbs
endif
endif
# TODO: Add support for CCA and CSV

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ make install DESTDIR=/usr/local/bin

The `TEE_PLATFORM` parameter can be
- `none`: for tests with non-confidential guests
- `all`: for all following platforms
- `fs`: for platforms with encrypted root filesystems (i.e. s390x)
- `tdx`: for Intel TDX
- `az-tdx-vtpm`: for Intel TDX with Azure vTPM
- `sev`: for AMD SEV(-ES)
- `snp`: for AMD SEV-SNP
- `amd`: for both AMD SEV(-ES) and AMD SEV-SNP
- `az-snp-vtpm`: for AMD SEV-SNP with Azure vTPM

by default, `kbs`/`sev` as a resource provider will be built in Confidential Data Hub. If you do not want enable any
Expand Down
3 changes: 2 additions & 1 deletion confidential-data-hub/hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ required-features = ["bin"]
[dependencies]
anyhow = { workspace = true, optional = true }
async-trait.workspace = true
attestation_agent = { path = "../../attestation-agent/lib", default-features = false, optional = true }
base64.workspace = true
clap = { workspace = true, features = [ "derive" ], optional = true }
env_logger = { workspace = true, optional = true }
Expand Down Expand Up @@ -43,7 +44,7 @@ aliyun = ["image/aliyun", "secret/aliyun"]
kbs = ["image/kbs", "kms/kbs", "secret/kbs"]

# support sev to provide confidential resources
sev = ["image/sev", "kms/sev", "dep:sev", "secret/sev"]
sev = ["attestation_agent", "image/sev", "kms/sev", "dep:sev", "secret/sev"]

# support eHSM stacks (KMS, ...)
ehsm = ["image/ehsm", "secret/ehsm"]
Expand Down
11 changes: 10 additions & 1 deletion confidential-data-hub/hub/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ impl Hub {
pub(crate) async fn init(&mut self) -> Result<()> {
#[cfg(feature = "sev")]
{
Self::init_sev().await?;
use log::{info, warn};
match attestation_agent::aa_kbc_params::get_params().await {
Ok(aa_kbc_params) => {
if aa_kbc_params.kbc() == "online_sev_kbc" {
info!("online_sev_kbc used. Start to initialize sev.");
Self::init_sev().await?;
}
}
Err(e) => warn!("Get `aa_kbc_params` failed. Skip initialize sev. {e:?}"),
};
}

#[cfg(feature = "kbs")]
Expand Down
Loading