Skip to content

Commit c2550fb

Browse files
committed
Initial encrypted mesh support
Signed-off-by: Chris Porter <porter@ibm.com>
1 parent 4cd62c3 commit c2550fb

File tree

21 files changed

+1051
-18
lines changed

21 files changed

+1051
-18
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rstest = "0.17"
5353
serde = { version = "1.0", features = ["derive"] }
5454
serde_with = { version = "3.13.0", features = ["base64"] }
5555
serde_json = "1.0"
56+
serde_yml = "0.0.11"
5657
serial_test = "3"
5758
sha2 = "0.10.9"
5859
strum = { version = "0.27", features = ["derive"] }

confidential-data-hub/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ TARGET_DIR := ../target
1515
BIN_NAME := confidential-data-hub
1616

1717
ONE_SHOT ?= false
18+
OVERLAY_NETWORK ?= false
1819

1920
SOURCE_ARCH := $(shell uname -m)
2021
RPC ?= ttrpc
@@ -59,6 +60,10 @@ ifneq ($(KMS_PROVIDER), none)
5960
features += $(KMS_PROVIDER)
6061
endif
6162

63+
ifeq ($(OVERLAY_NETWORK), true)
64+
features += overlay-network
65+
endif
66+
6267
ifeq ($(LIBC), musl)
6368
ifeq ($(ARCH), $(filter $(ARCH), s390x powerpc64le))
6469
$(error ERROR: Confidential Data Hub does not support building with the musl libc target for s390x and ppc64le architectures!)

confidential-data-hub/example.config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,13 @@
2828
},
2929
"extra_root_certificates": "-----BEGIN CERTIFICATE-----\nMIIFTDCCAvugAwIBAgIBADBGBgkqhkiG9w0BAQowOaAPMA0GCWCGSAFlAwQCAgUA\noRwwGgYJKoZIhvcNAQEIMA0GCWCGSAFlAwQCAgUAogMCATCjAwIBATB7MRQwEgYD\nVQQLDAtFbmdpbmVlcmluZzELMAkGA1UEBhMCVVMxFDASBgNVBAcMC1NhbnRhIENs\nYXJhMQswCQY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BfrvIBo1yEd+e56ZJMdhN8e+xWU\nbvovUC2/7Dl76fzAaACLSorZUv5XPJwKXwEOHo7FIcREjoZn+fKjJTnmdXce0LD6\n9RHr+r+ceyE79gmK31bI9DYiJoL4LeGdXZ3gMOVDR1OnDos5lOBcV+quJ6JujpgH\nd9g3Sa7Du7pusD9Fdap98ocZslRfFjFi//2YdVM4MKbq6IwpYNB+2PCEKNC7SfbO\nNgZYJuPZnM/wViES/cP7MZNJ1KUKBI9yh6TmlSsZZOclGJvrOsBZimTXpATjdNMt\ncluKwqAUUzYQmU7bf2TMdOXyA9iH5wIpj1kWGE1VuFADTKILkTc6LzLzOWCofLxf\nonhTtSDtzIv/uel547GZqq+rVRvmIieEuEvDETwuookfV6qu3D/9KuSr9xiznmEg\nxynud/f525jppJMcD/ofbQxUZuGKvb3f3zy+aLxqidoX7gca2Xd9jyUy5Y/83+ZN\nbz4PZx81UJzXVI9ABEh8/xilATh1ZxOePTBJjN7lgr0lXtKYjV/43yyxgUYrXNZS\noLSG2dLCK9mjjraPjau34Q==\n-----END CERTIFICATE-----",
3030
"work_dir": "/run/image-rs"
31+
},
32+
"overlay_network": {
33+
"enable": "true",
34+
"nebula": {
35+
"lighthouse_pub_ip": "127.0.0.1",
36+
"lighthouse_overlay_ip": "192.168.100.100",
37+
"overlay_netmask": "255.255.255.0"
38+
}
3139
}
3240
}

confidential-data-hub/example.config.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,24 @@ http_proxy = "http://127.0.0.1:5432"
201201
#
202202
# By default this value is not set.
203203
no_proxy = "192.168.0.1,localhost"
204+
205+
# (Optional) Overlay network-related configuration
206+
# If enabled, overlay_network.nebula (and all its fields) are required
207+
[overlay_network]
208+
209+
# Set enable to true to enable the overlay network
210+
enable = "true"
211+
212+
[overlay_network.nebula]
213+
# The public IP address of the lighthouse (localhost just used as an example
214+
# here).
215+
lighthouse_pub_ip = "127.0.0.1"
216+
217+
# The (internal/private) IP address of the lighthouse.
218+
# This MUST match the IP address (i.e. the internal/overlay/vpn IP address)
219+
# assigned to the lighthouse.
220+
lighthouse_overlay_ip = "192.168.100.100"
221+
222+
# The netmask of the overlay network. The provided example is a /24 network,
223+
# allowing for 256 pods in the network.
224+
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
@@ -45,6 +45,8 @@ env_logger = { workspace = true, optional = true }
4545
image-rs = { path = "../../image-rs", default-features = false, features = ["kata-cc-rustls-tls"] }
4646
kms = { path = "../kms", default-features = false }
4747
log.workspace = true
48+
nix = { workspace = true, features = ["net"] }
49+
overlay_network.path = "../overlay-network"
4850
prost = { workspace = true, optional = true }
4951
protobuf = { workspace = true, optional = true }
5052
rand.workspace = true
@@ -102,3 +104,6 @@ grpc = ["prost", "tonic", "tonic-build", "tokio/signal"]
102104

103105
# for secret_cli
104106
cli = ["clap/derive", "tokio/rt-multi-thread", "tokio/sync", "tokio/macros"]
107+
108+
# support overlay network
109+
overlay-network = ["overlay_network/overlay-network"]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ service SecureMountService {
5656

5757
service ImagePullService {
5858
rpc PullImage(ImagePullRequest) returns (ImagePullResponse) {};
59-
}
59+
}
60+
61+
service OverlayNetworkService {
62+
rpc InitOverlayNetwork(InitOverlayNetworkRequest) returns (InitOverlayNetworkResponse) {};
63+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ 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(&self, pod_name: String) -> Result<()>;
3538
}

0 commit comments

Comments
 (0)