Skip to content

Commit

Permalink
draft support for encrypted mesh in guest components
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Porter <[email protected]>
  • Loading branch information
portersrc committed Nov 18, 2024
1 parent 0fe01e4 commit 8062c00
Show file tree
Hide file tree
Showing 19 changed files with 970 additions and 50 deletions.
97 changes: 72 additions & 25 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ rstest = "0.17"
serde = { version = "1.0", features = ["derive"] }
serde_with = { version = "1.11.0", features = ["base64"] }
serde_json = "1.0"
serde_yml = "0.0.11"
serial_test = "3"
sha2 = "0.10.7"
strum = { version = "0.26", features = ["derive"] }
Expand Down
17 changes: 6 additions & 11 deletions api-server-rest/openapi/api.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"openapi": "3.0.3",
"openapi": "3.1.0",
"info": {
"title": "CoCo Restful API",
"description": "HTTP based API for CoCo containers to get resource/evidence/token from confidential-data-hub and attestation-agent.",
Expand All @@ -20,9 +20,7 @@
"paths": {
"/aa/evidence": {
"get": {
"tags": [
"crate"
],
"tags": [],
"operationId": "_evidence",
"parameters": [
{
Expand Down Expand Up @@ -67,9 +65,7 @@
},
"/aa/token": {
"get": {
"tags": [
"crate"
],
"tags": [],
"operationId": "_token",
"parameters": [
{
Expand Down Expand Up @@ -114,9 +110,7 @@
},
"/cdh/resource/{repository}/{type}/{tag}": {
"get": {
"tags": [
"crate"
],
"tags": [],
"operationId": "_resource",
"responses": {
"200": {
Expand Down Expand Up @@ -144,5 +138,6 @@
}
}
}
}
},
"components": {}
}
5 changes: 5 additions & 0 deletions confidential-data-hub/hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ image-rs = { path = "../../image-rs", default-features = false, features = ["kat
kms = { path = "../kms", default-features = false }
lazy_static.workspace = true
log.workspace = true
nix = { workspace = true, features = ["net"] }
prost = { workspace = true, optional = true }
protobuf = { workspace = true, optional = true }
secret.path = "../secret"
storage.path = "../storage"
overlay_network.path = "../overlay-network"
serde = { workspace = true, optional = true }
serde_json.workspace = true
thiserror.workspace = true
Expand Down Expand Up @@ -81,3 +83,6 @@ ehsm = ["image/ehsm", "secret/ehsm"]
bin = [ "anyhow", "attestation-agent", "cfg-if", "clap", "config", "env_logger", "serde" ]
ttrpc = ["dep:ttrpc", "protobuf", "ttrpc-codegen", "tokio/signal"]
grpc = ["prost", "tonic", "tonic-build", "tokio/signal"]

# support overlay network
overlay-network = []
15 changes: 14 additions & 1 deletion confidential-data-hub/hub/protos/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ message ImagePullResponse {
string manifest_digest = 1;
}

message InitOverlayNetworkRequest {
string pod_name = 1;
string lighthouse_pub_ip = 2;
}

message InitOverlayNetworkResponse {
int32 return_code = 1;
}

service SealedSecretService {
rpc UnsealSecret(UnsealSecretInput) returns (UnsealSecretOutput) {};
}
Expand All @@ -56,4 +65,8 @@ service SecureMountService {

service ImagePullService {
rpc PullImage(ImagePullRequest) returns (ImagePullResponse) {};
}
}

service OverlayNetworkService {
rpc InitOverlayNetwork(InitOverlayNetworkRequest) returns (InitOverlayNetworkResponse) {};
}
7 changes: 7 additions & 0 deletions confidential-data-hub/hub/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ pub trait DataHub {

/// Pull image of image url (reference), and place the merged layers in the `bundle_path/rootfs`
async fn pull_image(&self, _image_url: &str, _bundle_path: &str) -> Result<String>;

/// Initialize the overlay network
async fn init_overlay_network(
&self,
pod_name: String,
lighthouse_pub_ip: String,
) -> Result<Vec<u8>>;
}
Loading

0 comments on commit 8062c00

Please sign in to comment.