Skip to content

Commit 39ee471

Browse files
committed
draft support for encrypted mesh in guest components
Signed-off-by: Chris Porter <[email protected]>
1 parent 0fe01e4 commit 39ee471

File tree

20 files changed

+1046
-16
lines changed

20 files changed

+1046
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ rstest = "0.17"
5555
serde = { version = "1.0", features = ["derive"] }
5656
serde_with = { version = "1.11.0", features = ["base64"] }
5757
serde_json = "1.0"
58+
serde_yml = "0.0.11"
5859
serial_test = "3"
5960
sha2 = "0.10.7"
6061
strum = { version = "0.26", features = ["derive"] }

confidential-data-hub/example.config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@
2424
"skip_proxy_ips": "192.168.0.1,localhost",
2525
"extra_root_certificates": "-----BEGIN CERTIFICATE-----\nMIIFTDCCAvugAwIBAgIBADBGBgkqhkiG9w0BAQowOaAPMA0GCWCGSAFlAwQCAgUA\noRwwGgYJKoZIhvcNAQEIMA0GCWCGSAFlAwQCAgUAogMCATCjAwIBATB7MRQwEgYD\nVQQLDAtFbmdpbmVlcmluZzELMAkGA1UEBhMCVVMxFDASBgNVBAcMC1NhbnRhIENs\nYXJhMQswCQYDVQQIDAJDQTEfMB0GA1UECgwWQWR2YW5jZWQgTWljcm8gRGV2aWNl\nczESMBAGA1UEAwwJU0VWLU1pbGFuMB4XDTIzMDEyNDE3NTgyNloXDTMwMDEyNDE3\nNTgyNlowejEUMBIGA1UECwwLRW5naW5lZXJpbmcxCzAJBgNVBAYTAlVTMRQwEgYD\nVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExHzAdBgNVBAoMFkFkdmFuY2Vk\nIE1pY3JvIERldmljZXMxETAPBgNVBAMMCFNFVi1WQ0VLMHYwEAYHKoZIzj0CAQYF\nK4EEACIDYgAExmG1ZbuoAQK93USRyZQcsyobfbaAEoKEELf/jK39cOVJt1t4s83W\nXM3rqI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ETwuookfV6qu3D/9KuSr9xiznmEg\nxynud/f525jppJMcD/ofbQxUZuGKvb3f3zy+aLxqidoX7gca2Xd9jyUy5Y/83+ZN\nbz4PZx81UJzXVI9ABEh8/xilATh1ZxOePTBJjN7lgr0lXtKYjV/43yyxgUYrXNZS\noLSG2dLCK9mjjraPjau34Q==\n-----END CERTIFICATE-----",
2626
"work_dir": "/run/image-rs"
27+
},
28+
"overlay_network": {
29+
"enable": "true",
30+
"nebula": {
31+
"lighthouse_ip": "192.168.100.100",
32+
"overlay_netmask": "255.255.255.0"
33+
}
2734
}
2835
}

confidential-data-hub/example.config.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,22 @@ oLSG2dLCK9mjjraPjau34Q==
176176
# The path to store the pulled image layer data.
177177
#
178178
# This value defaults to `/run/image-rs/`.
179-
work_dir = "/run/image-rs"
179+
work_dir = "/run/image-rs"
180+
181+
182+
# (Optional) Overlay network-related configuration
183+
# If enabled, overlay_network.nebula (and all its fields) are required
184+
[overlay_network]
185+
186+
# Set enable to true to enable the overlay network
187+
enable = "true"
188+
189+
[overlay_network.nebula]
190+
# The (internal/private) IP address of the lighthouse.
191+
# This MUST match the IP address (i.e. the internal/overlay/vpn IP address)
192+
# assigned to the lighthouse, which is running alongside trustee
193+
lighthouse_ip = "192.168.100.100"
194+
195+
# The netmask of the overlay network. The provided example is a /24 network,
196+
# allowing for 256 pods in the network.
197+
overlay_netmask = "255.255.255.0"

confidential-data-hub/hub/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ image-rs = { path = "../../image-rs", default-features = false, features = ["kat
4040
kms = { path = "../kms", default-features = false }
4141
lazy_static.workspace = true
4242
log.workspace = true
43+
nix = { workspace = true, features = ["net"] }
4344
prost = { workspace = true, optional = true }
4445
protobuf = { workspace = true, optional = true }
4546
secret.path = "../secret"
4647
storage.path = "../storage"
48+
overlay_network.path = "../overlay-network"
4749
serde = { workspace = true, optional = true }
4850
serde_json.workspace = true
4951
thiserror.workspace = true
@@ -81,3 +83,6 @@ ehsm = ["image/ehsm", "secret/ehsm"]
8183
bin = [ "anyhow", "attestation-agent", "cfg-if", "clap", "config", "env_logger", "serde" ]
8284
ttrpc = ["dep:ttrpc", "protobuf", "ttrpc-codegen", "tokio/signal"]
8385
grpc = ["prost", "tonic", "tonic-build", "tokio/signal"]
86+
87+
# support overlay network
88+
overlay-network = []

confidential-data-hub/hub/protos/api.proto

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ message ImagePullResponse {
4242
string manifest_digest = 1;
4343
}
4444

45+
message InitOverlayNetworkRequest {
46+
string pod_name = 1;
47+
string lighthouse_pub_ip = 2;
48+
}
49+
50+
message InitOverlayNetworkResponse {
51+
int32 return_code = 1;
52+
}
53+
4554
service SealedSecretService {
4655
rpc UnsealSecret(UnsealSecretInput) returns (UnsealSecretOutput) {};
4756
}
@@ -56,4 +65,8 @@ service SecureMountService {
5665

5766
service ImagePullService {
5867
rpc PullImage(ImagePullRequest) returns (ImagePullResponse) {};
59-
}
68+
}
69+
70+
service OverlayNetworkService {
71+
rpc InitOverlayNetwork(InitOverlayNetworkRequest) returns (InitOverlayNetworkResponse) {};
72+
}

confidential-data-hub/hub/src/api.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ pub trait DataHub {
3232

3333
/// Pull image of image url (reference), and place the merged layers in the `bundle_path/rootfs`
3434
async fn pull_image(&self, _image_url: &str, _bundle_path: &str) -> Result<String>;
35+
36+
/// Initialize the overlay network
37+
async fn init_overlay_network(
38+
&self,
39+
pod_name: String,
40+
) -> Result<()>;
3541
}

0 commit comments

Comments
 (0)