Skip to content

Commit

Permalink
Initial encrypted mesh support
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Porter <[email protected]>
  • Loading branch information
portersrc committed Feb 28, 2025
1 parent 96aff63 commit b576ee3
Show file tree
Hide file tree
Showing 20 changed files with 1,054 additions and 16 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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
8 changes: 8 additions & 0 deletions confidential-data-hub/example.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@
"skip_proxy_ips": "192.168.0.1,localhost",
"extra_root_certificates": "-----BEGIN CERTIFICATE-----\nMIIFTDCCAvugAwIBAgIBADBGBgkqhkiG9w0BAQowOaAPMA0GCWCGSAFlAwQCAgUA\noRwwGgYJKoZIhvcNAQEIMA0GCWCGSAFlAwQCAgUAogMCATCjAwIBATB7MRQwEgYD\nVQQLDAtFbmdpbmVlcmluZzELMAkGA1UEBhMCVVMxFDASBgNVBAcMC1NhbnRhIENs\nYXJhMQswCQYDVQQIDAJDQTEfMB0GA1UECgwWQWR2YW5jZWQgTWljcm8gRGV2aWNl\nczESMBAGA1UEAwwJU0VWLU1pbGFuMB4XDTIzMDEyNDE3NTgyNloXDTMwMDEyNDE3\nNTgyNlowejEUMBIGA1UECwwLRW5naW5lZXJpbmcxCzAJBgNVBAYTAlVTMRQwEgYD\nVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExHzAdBgNVBAoMFkFkdmFuY2Vk\nIE1pY3JvIERldmljZXMxETAPBgNVBAMMCFNFVi1WQ0VLMHYwEAYHKoZIzj0CAQYF\nK4EEACIDYgAExmG1ZbuoAQK93USRyZQcsyobfbaAEoKEELf/jK39cOVJt1t4s83W\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IieEuEvDETwuookfV6qu3D/9KuSr9xiznmEg\nxynud/f525jppJMcD/ofbQxUZuGKvb3f3zy+aLxqidoX7gca2Xd9jyUy5Y/83+ZN\nbz4PZx81UJzXVI9ABEh8/xilATh1ZxOePTBJjN7lgr0lXtKYjV/43yyxgUYrXNZS\noLSG2dLCK9mjjraPjau34Q==\n-----END CERTIFICATE-----",
"work_dir": "/run/image-rs"
},
"overlay_network": {
"enable": "true",
"nebula": {
"lighthouse_pub_ip": "127.0.0.1",
"lighthouse_overlay_ip": "192.168.100.100",
"overlay_netmask": "255.255.255.0"
}
}
}
24 changes: 23 additions & 1 deletion confidential-data-hub/example.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,26 @@ oLSG2dLCK9mjjraPjau34Q==
# The path to store the pulled image layer data.
#
# This value defaults to `/run/image-rs/`.
work_dir = "/run/image-rs"
work_dir = "/run/image-rs"


# (Optional) Overlay network-related configuration
# If enabled, overlay_network.nebula (and all its fields) are required
[overlay_network]

# Set enable to true to enable the overlay network
enable = "true"

[overlay_network.nebula]
# The public IP address of the lighthouse (localhost just used as an example
# here).
lighthouse_pub_ip = "127.0.0.1"

# The (internal/private) IP address of the lighthouse.
# This MUST match the IP address (i.e. the internal/overlay/vpn IP address)
# assigned to the lighthouse.
lighthouse_overlay_ip = "192.168.100.100"

# The netmask of the overlay network. The provided example is a /24 network,
# allowing for 256 pods in the network.
overlay_netmask = "255.255.255.0"
5 changes: 5 additions & 0 deletions confidential-data-hub/hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ env_logger = { workspace = true, optional = true }
image-rs = { path = "../../image-rs", default-features = false, features = ["kata-cc-rustls-tls"] }
kms = { path = "../kms", default-features = false }
log.workspace = true
nix = { workspace = true, features = ["net"] }
overlay_network.path = "../overlay-network"
prost = { workspace = true, optional = true }
protobuf = { workspace = true, optional = true }
rand.workspace = true
Expand Down Expand Up @@ -102,3 +104,6 @@ grpc = ["prost", "tonic", "tonic-build", "tokio/signal"]

# for secret_cli
cli = ["clap/derive", "tokio/rt-multi-thread", "tokio/sync", "tokio/macros"]

# 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) {};
}
6 changes: 6 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,10 @@ 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>;

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (stable, ubuntu-24.04)

Diff in /home/runner/work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (ubuntu-24.04, stable)

Diff in /home/runner/work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (ubuntu-24.04-arm, 1.82.0, ATTESTER=cca-attester TEE_PLATFORM=cca, --no-default-features --...

Diff in /home/runner/work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (ubuntu-24.04-arm, 1.82.0)

Diff in /home/runner/work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (s390x, stable)

Diff in /home/ansible/gha-runner/_layout/_work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

Check warning on line 34 in confidential-data-hub/hub/src/api.rs

View workflow job for this annotation

GitHub Actions / Check (stable, s390x)

Diff in /home/ansible/gha-runner/_layout/_work/guest-components/guest-components/confidential-data-hub/hub/src/api.rs

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

0 comments on commit b576ee3

Please sign in to comment.