diff --git a/Cargo.lock b/Cargo.lock index 0621d85..462e6a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -299,9 +299,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -317,9 +317,9 @@ dependencies = [ [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -1120,9 +1120,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -2282,9 +2282,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags 2.13.1", "errno", diff --git a/Cargo.toml b/Cargo.toml index ad18e73..42a0de5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ async-trait = "0.1.89" axum = "0.8.9" base64 = "0.22.1" bytes = "1.12.1" -cap-std = "4.0.2" +cap-std = "4.0.3" caps = "0.5.6" chacha20poly1305 = { version = "0.11.0", features = ["zeroize"] } clap = { version = "4.6.2", features = ["derive"] } @@ -52,7 +52,7 @@ flate2 = "1.1.9" fs2 = "0.4.3" futures-util = "0.3.33" getrandom = "0.4.3" -hickory-proto = "0.26.1" +hickory-proto = "0.26.2" http = "1.4.0" http-body-util = "0.1.4" httparse = "1.10.1" @@ -72,7 +72,7 @@ proptest = "1.11.0" rcgen = "0.14.8" reqwest = { version = "0.13.4", default-features = false, features = ["rustls", "socks", "stream"] } rpassword = "7.5.4" -rustix = { version = "1.1.4", features = ["fs", "process", "std"] } +rustix = { version = "1.1.6", features = ["fs", "process", "std"] } rlimit = "0.11.0" roxmltree = "0.21.1" rustls = { version = "0.23.46", default-features = false, features = ["ring", "std", "tls12"] } diff --git a/README.md b/README.md index 23a3080..6a4a1f2 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,10 @@ multi-repo workspaces, and nested agent sandbox settings. ### 1. Install SendBox and a runtime **Central Homebrew automation is pending review and activation in the tap.** -It will use verified patched stable releases v0.2.3 or newer; older artifacts -predate the TLS fixes for RUSTSEC-2026-0382/0383. See +The v0.2.3 TLS-fix floor alone is no longer sufficient: v0.2.5 also predates +the dependency fixes identified by the November 11, 2026 audit. New reviewed +host/guest release artifacts are still required. See the +[dependency security status](docs/installation.md#dependency-security-status) and [stable Homebrew updates](docs/installation.md#stable-homebrew-updates). Install the CLI from the existing Homebrew tap: @@ -99,13 +101,16 @@ need that bundle separately. | Your host | Session runtime and prerequisites | Setup | |---|---|---| -| macOS 26+ on Apple silicon | Apple Containerization, Xcode 26, and official `container` CLI **0.10.0** with its service registered and running | [Apple runtime](docs/apple-runtime.md) | +| macOS 26+ on Apple silicon | Apple Containerization, Xcode 26, and an exact matching official `container` CLI/service pair: **0.10.0** or **1.7.1**, with the service registered and running | [Apple runtime and qualification status](docs/apple-runtime.md) | | Linux x86_64 or aarch64 with hardware or nested virtualization | Kata Containers **3.28+**, containerd **1.7+**, nerdctl, CNI plugins, and user access to `/dev/kvm` and containerd | [Kata runtime](docs/kata-containers.md) | Linux host binaries also need libseccomp, libelf, zlib, and zstd runtime libraries (on Debian/Ubuntu: `libseccomp2 libelf1 zlib1g libzstd1`). Rust is only required when building from source. +Apple 1.7.1 compatibility is currently source-only, not part of released +SendBox v0.2.5. See the [release and physical qualification gates](docs/apple-runtime.md#qualification). + Run the installed `setup.sh` as your normal user for runtime preflight and configuration assistance, not `sudo sendbox`. For macOS package/DMG installs, the helper is `/usr/local/share/sendbox/setup.sh`; for tarballs it is in the diff --git a/Tests/qualification/inventory.v1.json b/Tests/qualification/inventory.v1.json index 1a18543..0bcfdd5 100644 --- a/Tests/qualification/inventory.v1.json +++ b/Tests/qualification/inventory.v1.json @@ -41,7 +41,7 @@ {"id":"module.rust-policy","category":"source_module","name":"Rust policy validation foundation","disposition":"preserve","rationale":"Retain structural policy validation without adding decisions in this PR.","evidence":["crates/sendbox-policy/src/lib.rs#PolicyConfiguration"],"target_crate":"sendbox-policy","target_phase":4,"conformance":{"status":"implemented","fixture_ids":["config.contracts"],"compatibility_note":null}}, {"id":"module.rust-mcp","category":"source_module","name":"Rust production MCP subsystem","disposition":"preserve","rationale":"Retain bounded framing, strict JSON-RPC validation, hierarchical deny-first tool policy, exact-command stdio brokering, trusted Streamable HTTP gateway enforcement, project validation, authenticated runtime policy, native observation records, deterministic observer descriptions, and Safe Outputs intent validation.","evidence":["crates/sendbox-mcp/src/artifact.rs#NativeObserverArtifact","crates/sendbox-mcp/src/audit.rs#BoundaryAuditEvent","crates/sendbox-mcp/src/broker.rs#StdioBroker","crates/sendbox-mcp/src/config.rs#ProjectConfigValidator","crates/sendbox-mcp/src/error.rs#errors","crates/sendbox-mcp/src/framing.rs#FrameDecoder","crates/sendbox-mcp/src/http_gateway.rs#HttpGateway","crates/sendbox-mcp/src/jsonrpc.rs#validate_message","crates/sendbox-mcp/src/lib.rs#public exports","crates/sendbox-mcp/src/observation.rs#ObservationParser","crates/sendbox-mcp/src/policy.rs#CompiledToolPolicy","crates/sendbox-mcp/src/runtime.rs#McpRuntimePolicy","crates/sendbox-mcp/src/safe_outputs.rs#Safe Outputs schemas sanitization artifact chain and seals"],"target_crate":"sendbox-mcp","target_phase":7,"conformance":{"status":"implemented","fixture_ids":["mcp.contracts","policy.decisions","persisted.formats","known-defects.negative"],"compatibility_note":null}}, {"id":"module.rust-runtime","category":"source_module","name":"Rust runtime foundation","disposition":"preserve","rationale":"Retain typed lifecycle, capability, process, cancellation, output, cleanup, and lifecycle-owned host/guest control-channel contracts.","evidence":["crates/sendbox-runtime/src/cancellation.rs#CancellationToken","crates/sendbox-runtime/src/capability.rs#RuntimeCapabilities","crates/sendbox-runtime/src/channel.rs#ControlChannelRequest and ProvisionedControlChannel","crates/sendbox-runtime/src/cleanup.rs#CleanupTransaction","crates/sendbox-runtime/src/clock.rs#Clock","crates/sendbox-runtime/src/error.rs#RuntimeError","crates/sendbox-runtime/src/id.rs#ContainerId and ImageReference","crates/sendbox-runtime/src/lib.rs#public exports","crates/sendbox-runtime/src/lifecycle.rs#LifecycleStateMachine","crates/sendbox-runtime/src/output.rs#OutputEvent","crates/sendbox-runtime/src/process.rs#ProcessRunner","crates/sendbox-runtime/src/provider.rs#RuntimeProvider","crates/sendbox-runtime/src/unavailable.rs#UnavailableRuntimeProvider"],"target_crate":"sendbox-runtime","target_phase":3,"conformance":{"status":"implemented","fixture_ids":["runtime.contracts"],"compatibility_note":"Transport endpoint mappings remain adapter-specific and are not claimed by this foundation."}}, - {"id":"module.rust-apple-runtime","category":"source_module","name":"Rust production Apple runtime adapter","disposition":"redesign","rationale":"Implement the object-safe runtime contract through the official Apple container 0.10.0 CLI with trusted direct execution, signed guest bundles, non-mutating preflight, lifecycle-owned authenticated stdio transport, bounded streaming and idempotent cleanup.","evidence":["crates/sendbox-runtime-apple/src/lib.rs#public Apple runtime exports","crates/sendbox-runtime-apple/src/command.rs#exact Apple CLI argv and launch configuration","crates/sendbox-runtime-apple/src/executable.rs#trusted executable resolution","crates/sendbox-runtime-apple/src/provider.rs#AppleRuntime RuntimeProvider implementation","crates/sendbox-runtime-apple/src/channel.rs#lifecycle-owned inherited-stdio control channel"],"target_crate":"sendbox-runtime-apple","target_phase":8,"conformance":{"status":"implemented","fixture_ids":["runtime.contracts","persisted.formats","known-defects.negative"],"compatibility_note":"The unqualified Swift framework path and unproven --publish-socket mapping are replaced by an official-CLI inherited-stdio relay; unsupported service mutation and policy combinations fail explicitly."}}, + {"id":"module.rust-apple-runtime","category":"source_module","name":"Rust production Apple runtime adapter","disposition":"redesign","rationale":"Implement the object-safe runtime contract through exact matched official Apple container 0.10.0 and 1.7.1 CLI/service pairs with trusted direct execution, signed guest bundles, non-mutating identity/schema preflight, lifecycle-owned authenticated stdio transport, bounded streaming and idempotent cleanup.","evidence":["crates/sendbox-runtime-apple/src/lib.rs#public Apple runtime exports","crates/sendbox-runtime-apple/src/command.rs#exact Apple CLI argv and launch configuration","crates/sendbox-runtime-apple/src/executable.rs#trusted executable resolution","crates/sendbox-runtime-apple/src/provider.rs#AppleRuntime RuntimeProvider implementation","crates/sendbox-runtime-apple/src/channel.rs#lifecycle-owned inherited-stdio control channel"],"target_crate":"sendbox-runtime-apple","target_phase":8,"conformance":{"status":"implemented","fixture_ids":["runtime.contracts","persisted.formats","known-defects.negative"],"compatibility_note":"The unqualified Swift framework path and unproven --publish-socket mapping are replaced by an official-CLI inherited-stdio relay; unsupported service mutation and policy combinations fail explicitly. Portable 1.7.1 conformance does not replace the prepared-host live gate, compatible release packaging or consumer exact-image qualification."}}, {"id":"module.rust-runtime-testkit","category":"source_module","name":"Rust runtime testkit","disposition":"preserve","rationale":"Retain deterministic runtime fakes, fixtures, and conformance scenarios.","evidence":["crates/sendbox-testkit/src/bin/process_fixture.rs#process fixture","crates/sendbox-testkit/src/lib.rs#RuntimeConformanceScenario"],"target_crate":"sendbox-testkit","target_phase":3,"conformance":{"status":"implemented","fixture_ids":["runtime.contracts"],"compatibility_note":null}}, {"id":"module.rust-project","category":"source_module","name":"Rust project analysis","disposition":"preserve","rationale":"Retain bounded native project analysis, optional refinement, and deterministic devcontainer generation.","evidence":["crates/sendbox-project/src/analysis.rs#Analyzer","crates/sendbox-project/src/devcontainer.rs#generate_devcontainer","crates/sendbox-project/src/error.rs#ProjectError","crates/sendbox-project/src/jsonc.rs#parse_jsonc","crates/sendbox-project/src/lib.rs#public exports","crates/sendbox-project/src/refinement.rs#RefinementProvider","crates/sendbox-project/src/scan.rs#ScanReport"],"target_crate":"sendbox-project","target_phase":10,"conformance":{"status":"implemented","fixture_ids":["setup.release"],"compatibility_note":null}}, {"id":"module.rust-bpf","category":"source_module","name":"Rust production BPF observation facade","disposition":"preserve","rationale":"Retain bounded versioned event decoding, Linux capability and BTF probes, cgroup-scoped libbpf lifecycle, typed diagnostics, and explicit event-loss accounting without enforcement claims.","evidence":["crates/sendbox-bpf/src/error.rs#BpfError and DiagnosticKind","crates/sendbox-bpf/src/event.rs#versioned bounded event ABI","crates/sendbox-bpf/src/lib.rs#public exports","crates/sendbox-bpf/src/loader.rs#EventStream and LossSnapshot","crates/sendbox-bpf/src/preflight.rs#kernel BTF tracepoint and capability probes","crates/sendbox-bpf/src/report.rs#bounded session-bound argument-free syscall reports"],"target_crate":"sendbox-bpf","target_phase":7,"conformance":{"status":"implemented","fixture_ids":["known-defects.negative","runtime.contracts"],"compatibility_note":"Exec and syscall hooks are cgroup-subtree audit observation with explicit sampling and loss accounting; the bounded MCP ABI is reserved and has no producer in this phase."}}, diff --git a/crates/sendbox-exec/Cargo.toml b/crates/sendbox-exec/Cargo.toml index bad0af9..f87c6c3 100644 --- a/crates/sendbox-exec/Cargo.toml +++ b/crates/sendbox-exec/Cargo.toml @@ -20,7 +20,7 @@ caps.workspace = true libc.workspace = true libseccomp.workspace = true rlimit.workspace = true -rustix = { version = "1.1.4", features = ["event", "fs", "process", "pty", "termios", "std"] } +rustix = { version = "1.1.6", features = ["event", "fs", "process", "pty", "termios", "std"] } [dev-dependencies] tempfile.workspace = true diff --git a/crates/sendbox-runtime-apple/src/command.rs b/crates/sendbox-runtime-apple/src/command.rs index 053cc00..75a090d 100644 --- a/crates/sendbox-runtime-apple/src/command.rs +++ b/crates/sendbox-runtime-apple/src/command.rs @@ -260,6 +260,11 @@ impl AppleContainerCommands { ]) } + #[must_use] + pub(crate) fn builtin_network_inspect(&self) -> CommandSpec { + self.spec(["network", "inspect", "default"]) + } + pub fn create( &self, id: &ContainerId, @@ -267,6 +272,18 @@ impl AppleContainerCommands { launch: &AppleLaunchConfiguration, bundle_root: &Path, public_key: &Path, + ) -> Result { + self.create_with_capabilities(id, image, launch, bundle_root, public_key, &[]) + } + + pub(crate) fn create_with_capabilities( + &self, + id: &ContainerId, + image: &str, + launch: &AppleLaunchConfiguration, + bundle_root: &Path, + public_key: &Path, + capabilities: &[&str], ) -> Result { validate_image(image)?; launch.validate()?; @@ -298,6 +315,9 @@ impl AppleContainerCommands { display_path(public_key_parent) )), ]; + for capability in capabilities { + arguments.extend([plain("--cap-add"), plain(*capability)]); + } append_environment(&mut arguments, &launch.environment); append_mounts(&mut arguments, &launch.mounts)?; append_network(&mut arguments, &launch.network)?; diff --git a/crates/sendbox-runtime-apple/src/provider.rs b/crates/sendbox-runtime-apple/src/provider.rs index 3bde83a..147879e 100644 --- a/crates/sendbox-runtime-apple/src/provider.rs +++ b/crates/sendbox-runtime-apple/src/provider.rs @@ -43,7 +43,7 @@ use crate::{ }; pub const APPLE_RUNTIME_ID: &str = "apple-container"; -const SUPPORTED_VERSION: &str = "0.10.0"; +const SUPPORTED_VERSIONS: [&str; 2] = ["0.10.0", "1.7.1"]; const BOOTSTRAP_TARGET: &str = RUNTIME_INJECTED_BOOTSTRAP_TARGET; const BUNDLE_LAUNCHER: &str = "bin/sendbox-exec-launcher"; const GUEST_BUNDLE_ROOT: &str = "/opt/sendbox"; @@ -228,7 +228,10 @@ impl AppleRuntime { ]) } - async fn check_preflight(&self, cancellation: &CancellationToken) -> Result<(), RuntimeError> { + async fn check_preflight( + &self, + cancellation: &CancellationToken, + ) -> Result<&'static str, RuntimeError> { self.configuration.validate()?; if !self.configuration.allow_non_apple_host && (std::env::consts::OS != "macos" || std::env::consts::ARCH != "aarch64") @@ -255,15 +258,57 @@ impl AppleRuntime { .await?; ensure_complete_output(&version, "Apple container version")?; let version = String::from_utf8_lossy(&version.stdout.bytes); - if parse_container_cli_version(&version) != Some(SUPPORTED_VERSION) { + let parsed = parse_container_cli_version(&version); + let Some(cli_version) = SUPPORTED_VERSIONS + .into_iter() + .find(|supported| parsed == Some(*supported)) + else { return Err(RuntimeError::Unavailable { runtime: self.runtime_id.clone(), reason: format!( - "requires official Apple container CLI {SUPPORTED_VERSION}; observed `{}`", + "requires official Apple container CLI {}; selected {} reports `{}`", + SUPPORTED_VERSIONS.join(" or "), + self.commands.executable().display(), version.trim() ), }); + }; + + let service = self + .run_raw(self.commands.service_status(), cancellation) + .await?; + match service.termination { + TerminationReason::Cancelled => return Err(RuntimeError::Cancelled), + TerminationReason::TimedOut => return Err(RuntimeError::TimedOut), + TerminationReason::Exited => {} } + ensure_complete_output(&service, "Apple container service status")?; + let service_status: ServiceStatus = + serde_json::from_slice(&service.stdout.bytes).map_err(|error| { + RuntimeError::Unavailable { + runtime: self.runtime_id.clone(), + reason: format!("service status was not complete valid JSON: {error}"), + } + })?; + if service_status.status != "running" { + return Err(RuntimeError::Unavailable { + runtime: self.runtime_id.clone(), + reason: format!( + "Apple container service is `{}`; SendBox never starts, registers, or stops it", + service_status.status + ), + }); + } + checked_outcome(service)?; + service_status + .validate_identity(cli_version) + .map_err(|error| RuntimeError::Unavailable { + runtime: self.runtime_id.clone(), + reason: format!( + "selected Apple container CLI {} ({cli_version}): {error}; SendBox never changes the executable or service automatically", + self.commands.executable().display() + ), + })?; for (command, tokens) in required_help_tokens() { let output = self @@ -271,11 +316,14 @@ impl AppleRuntime { .await?; ensure_complete_output(&output, &format!("Apple container {command} help"))?; let help = String::from_utf8_lossy(&output.stdout.bytes); - let missing = tokens + let mut missing = tokens .iter() .filter(|token| !help.contains(**token)) .copied() .collect::>(); + if cli_version == "1.7.1" && command == "create" && !help.contains("--cap-add") { + missing.push("--cap-add"); + } if !missing.is_empty() { return Err(RuntimeError::Unavailable { runtime: self.runtime_id.clone(), @@ -286,28 +334,22 @@ impl AppleRuntime { }); } } - - let service = self - .run_raw(self.commands.service_status(), cancellation) - .await?; - ensure_complete_output(&service, "Apple container service status")?; - let service_status: ServiceStatus = - serde_json::from_slice(&service.stdout.bytes).map_err(|error| { - RuntimeError::Unavailable { - runtime: self.runtime_id.clone(), - reason: format!("service status was not complete valid JSON: {error}"), - } - })?; - if service_status.status != "running" { - return Err(RuntimeError::Unavailable { - runtime: self.runtime_id.clone(), - reason: format!( - "Apple container service is `{}`; SendBox never starts, registers, or stops it", - service_status.status - ), - }); + if cli_version == "1.7.1" + && self + .configuration + .launch + .network + .network + .as_deref() + .is_none_or(|network| network == "default") + { + let network = self + .run_checked(self.commands.builtin_network_inspect(), cancellation) + .await?; + ensure_complete_output(&network, "Apple built-in network inspect")?; + validate_builtin_network(&network.stdout.bytes)?; } - Ok(()) + Ok(cli_version) } fn verify_bundle(&self) -> Result<(), RuntimeError> { @@ -403,26 +445,38 @@ impl AppleRuntime { image: &str, cancellation: &CancellationToken, ) -> Result<(), RuntimeError> { - match self.configuration.launch.pull_policy { + let inspection = match self.configuration.launch.pull_policy { ImagePullPolicy::Always => { self.run_checked(self.commands.image_pull(image), cancellation) .await?; + self.run_checked(self.commands.image_inspect(image), cancellation) + .await? } ImagePullPolicy::Missing => { let inspection = self .run_raw(self.commands.image_inspect(image), cancellation) .await?; - if !inspection.status.success { + match inspection.termination { + TerminationReason::Cancelled => return Err(RuntimeError::Cancelled), + TerminationReason::TimedOut => return Err(RuntimeError::TimedOut), + TerminationReason::Exited => {} + } + if inspection.status.success { + inspection + } else { self.run_checked(self.commands.image_pull(image), cancellation) .await?; + self.run_checked(self.commands.image_inspect(image), cancellation) + .await? } } ImagePullPolicy::Never => { self.run_checked(self.commands.image_inspect(image), cancellation) - .await?; + .await? } - } - Ok(()) + }; + ensure_complete_output(&inspection, "Apple image inspect")?; + validate_image_inspection(&inspection.stdout.bytes, image) } async fn inject_bootstrap( @@ -637,7 +691,7 @@ impl RuntimeProvider for AppleRuntime { .unwrap_or_else(|poison| poison.into_inner()) .clone() .ok_or_else(|| provider_error("Apple runtime is not initialized"))?; - self.verify_launch_artifacts()?; + let cli_version = self.check_preflight(cancellation).await?; self.ensure_image(&request.image, cancellation).await?; let launch = self.configuration.launch.merge_create_request(&request)?; if self @@ -655,12 +709,22 @@ impl RuntimeProvider for AppleRuntime { prepare_state_directory(&container_state)?; let staged_public_key = stage_public_key(&self.configuration.public_key, &container_state)?; - let command = match self.commands.create( + let capabilities: &[&str] = if cli_version == "1.7.1" { + if self.configuration.syscall_tracing { + &["CAP_NET_ADMIN", "CAP_SYS_ADMIN"] + } else { + &["CAP_NET_ADMIN"] + } + } else { + &[] + }; + let command = match self.commands.create_with_capabilities( &request.container_id, &request.image, &launch, &self.configuration.bundle_root, &staged_public_key, + capabilities, ) { Ok(command) => command, Err(error) => { @@ -822,7 +886,7 @@ impl RuntimeProvider for AppleRuntime { .run_checked(self.commands.inspect(container), cancellation) .await?; ensure_complete_output(&outcome, "Apple container inspect")?; - let observed = parse_lifecycle(&outcome.stdout.bytes).unwrap_or(lifecycle); + let observed = parse_lifecycle(&outcome.stdout.bytes, container)?; Ok(RuntimeStatus { lifecycle: observed, health: if observed == LifecycleState::Running { @@ -1031,6 +1095,101 @@ impl RuntimeProvider for AppleRuntime { #[derive(Deserialize)] struct ServiceStatus { status: String, + #[serde(rename = "apiServerAppName")] + api_server_app_name: Option, + #[serde(rename = "apiServerVersion")] + api_server_version: Option, + client: Option, + server: Option, +} + +#[derive(Deserialize)] +struct ServiceIdentity { + #[serde(rename = "appName")] + app_name: String, + version: String, +} + +impl ServiceStatus { + fn validate_identity(&self, cli_version: &str) -> Result<(), RuntimeError> { + let (app_name, server_version) = match cli_version { + "0.10.0" if self.client.is_none() && self.server.is_none() => ( + self.api_server_app_name.as_deref(), + self.api_server_version.as_deref(), + ), + "1.7.1" if self.api_server_app_name.is_none() && self.api_server_version.is_none() => { + let client = self.client.as_ref().ok_or_else(|| { + provider_error("service status is missing the CLI client identity") + })?; + if client.app_name != "container" || client.version != cli_version { + return Err(provider_error(format!( + "service status client identity is {} {}, expected container {cli_version}", + client.app_name, client.version + ))); + } + let server = self.server.as_ref().ok_or_else(|| { + provider_error("service status is missing the API server identity") + })?; + ( + Some(server.app_name.as_str()), + Some(server.version.as_str()), + ) + } + _ => return Err(provider_error("unrecognized Apple service identity schema")), + }; + if app_name != Some("container-apiserver") || server_version != Some(cli_version) { + return Err(provider_error(format!( + "API server identity is {} {}, expected container-apiserver {cli_version}; mixed CLI/server versions are unsupported", + app_name.unwrap_or(""), + server_version.unwrap_or("") + ))); + } + Ok(()) + } +} + +#[derive(Deserialize)] +struct ManagedNetworkConfiguration { + name: String, + mode: String, + plugin: String, + labels: BTreeMap, +} + +#[derive(Deserialize)] +struct ManagedNetworkInspection { + id: String, + configuration: ManagedNetworkConfiguration, +} + +fn validate_builtin_network(bytes: &[u8]) -> Result<(), RuntimeError> { + let records: Vec = + serde_json::from_slice(bytes).map_err(|error| { + provider_error(format!( + "invalid Apple built-in network inspect JSON: {error}" + )) + })?; + let [record] = records.as_slice() else { + return Err(provider_error( + "Apple built-in network inspect must return exactly one default network; SendBox never creates or reconfigures networks", + )); + }; + let configuration = &record.configuration; + if record.id != "default" + || configuration.name != "default" + || configuration.mode != "nat" + || configuration.plugin != "container-network-vmnet" + || configuration + .labels + .get("com.apple.container.resource.role") + .map(String::as_str) + != Some("builtin") + { + return Err(provider_error( + "Apple default network identity must be the built-in container-network-vmnet NAT network; SendBox never creates or reconfigures networks", + )); + } + Ok(()) } fn required_help_tokens() -> [(&'static str, &'static [&'static str]); 8] { @@ -1298,28 +1457,122 @@ fn outcome_error(outcome: &ProcessOutcome) -> RuntimeError { )) } -fn parse_lifecycle(bytes: &[u8]) -> Option { - let value: serde_json::Value = serde_json::from_slice(bytes).ok()?; - find_status(&value).and_then(|status| match status.to_ascii_lowercase().as_str() { - "running" => Some(LifecycleState::Running), - "stopped" | "exited" => Some(LifecycleState::Stopped), - "created" => Some(LifecycleState::Created), - _ => None, - }) +#[derive(Deserialize)] +struct OciDescriptor { + digest: String, } -fn find_status(value: &serde_json::Value) -> Option<&str> { - match value { - serde_json::Value::Object(object) => object - .iter() - .find_map(|(key, value)| { - key.eq_ignore_ascii_case("status") - .then(|| value.as_str()) - .flatten() - }) - .or_else(|| object.values().find_map(find_status)), - serde_json::Value::Array(values) => values.iter().find_map(find_status), - _ => None, +#[derive(Deserialize)] +struct ImageConfiguration { + name: String, + descriptor: OciDescriptor, +} + +#[derive(Deserialize)] +struct ImageInspection { + name: Option, + index: Option, + id: Option, + configuration: Option, +} + +fn validate_image_inspection(bytes: &[u8], image: &str) -> Result<(), RuntimeError> { + let records: Vec = serde_json::from_slice(bytes) + .map_err(|error| provider_error(format!("invalid Apple image inspect JSON: {error}")))?; + let [record] = records.as_slice() else { + return Err(provider_error( + "Apple image inspect must return exactly one image", + )); + }; + let (name, digest) = match ( + &record.name, + &record.index, + &record.id, + &record.configuration, + ) { + (Some(name), Some(index), None, None) => (name, &index.digest), + (None, None, Some(id), Some(configuration)) => { + if configuration.descriptor.digest.strip_prefix("sha256:") != Some(id.as_str()) { + return Err(provider_error( + "Apple image ID does not match its OCI index descriptor", + )); + } + (&configuration.name, &configuration.descriptor.digest) + } + _ => return Err(provider_error("unrecognized Apple image inspect schema")), + }; + if name.is_empty() + || !digest.strip_prefix("sha256:").is_some_and(|hex| { + hex.len() == 64 + && hex + .bytes() + .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)) + }) + { + return Err(provider_error( + "Apple image inspect must include a name and canonical SHA-256 index digest", + )); + } + if let Some((_, requested_digest)) = image.rsplit_once('@') + && requested_digest != digest + { + return Err(provider_error(format!( + "Apple image index digest {digest} does not match requested {requested_digest}" + ))); + } + Ok(()) +} + +#[derive(Deserialize)] +struct ContainerIdentity { + id: String, +} + +#[derive(Deserialize)] +#[serde(untagged)] +enum InspectedStatus { + Legacy(String), + Managed { state: String }, +} + +#[derive(Deserialize)] +struct ContainerInspection { + id: Option, + configuration: ContainerIdentity, + status: InspectedStatus, +} + +fn parse_lifecycle(bytes: &[u8], container: &ContainerId) -> Result { + let records: Vec = serde_json::from_slice(bytes).map_err(|error| { + provider_error(format!("invalid Apple container inspect JSON: {error}")) + })?; + let [record] = records.as_slice() else { + return Err(provider_error( + "Apple container inspect must return exactly one owned container", + )); + }; + if record.configuration.id != container.as_str() { + return Err(provider_error( + "Apple container inspect configuration does not match the owned container", + )); + } + let state = match (&record.status, &record.id) { + (InspectedStatus::Legacy(state), None) => state, + (InspectedStatus::Managed { state }, Some(id)) if id == container.as_str() => state, + _ => { + return Err(provider_error( + "Apple container inspect identity or status schema does not match the owned container", + )); + } + }; + match state.as_str() { + "running" => Ok(LifecycleState::Running), + "stopped" | "exited" => Ok(LifecycleState::Stopped), + "stopping" => Ok(LifecycleState::Stopping), + "created" => Ok(LifecycleState::Created), + _ => Err(provider_error(format!( + "unrecognized Apple container lifecycle state `{state}`" + ))), } } @@ -1360,11 +1613,13 @@ mod tests { ), Some("0.10.0") ); - assert_ne!( - parse_container_cli_version( - "container CLI version 0.10.0-rc.1 (build: release, commit: fixture)" - ), - Some(SUPPORTED_VERSION) + assert!( + !SUPPORTED_VERSIONS.contains( + &parse_container_cli_version( + "container CLI version 0.10.0-rc.1 (build: release, commit: fixture)" + ) + .expect("version token") + ) ); assert_eq!( parse_container_cli_version("wrapper container CLI version 0.10.0"), @@ -1373,10 +1628,64 @@ mod tests { } fn fixture_runtime() -> (tempfile::TempDir, AppleRuntime) { + fixture_runtime_for_version("0.10.0") + } + + fn fixture_runtime_for_version(version: &str) -> (tempfile::TempDir, AppleRuntime) { let temporary = tempfile::tempdir_in(std::env::current_dir().expect("current directory")) .expect("temporary"); let fake_state = temporary.path().join("fake-state"); fs::create_dir(&fake_state).expect("fake state"); + fs::write( + fake_state.join("version"), + format!("container CLI version {version} (build: release, commit: fixture)\n"), + ) + .expect("version"); + let service = if version == "0.10.0" { + serde_json::json!({ + "status": "running", + "apiServerAppName": "container-apiserver", + "apiServerVersion": version + }) + } else { + serde_json::json!({ + "status": "running", + "client": {"appName": "container", "version": version}, + "server": {"appName": "container-apiserver", "version": version} + }) + }; + fs::write(fake_state.join("service.json"), service.to_string()).expect("service"); + let digest = format!("sha256:{}", "a".repeat(64)); + let image = if version == "0.10.0" { + serde_json::json!([{ + "name": "fixture:image", + "index": {"digest": digest}, + "variants": [] + }]) + } else { + serde_json::json!([{ + "id": "a".repeat(64), + "configuration": {"name": "fixture:image", "descriptor": {"digest": digest}}, + "variants": [] + }]) + }; + fs::write(fake_state.join("image.json"), image.to_string()).expect("image"); + fs::write( + fake_state.join("network.json"), + serde_json::json!([{ + "id": "default", + "configuration": { + "name": "default", "mode": "nat", "plugin": "container-network-vmnet", + "labels": {"com.apple.container.resource.role": "builtin"} + }, + "status": {"ipv4Gateway": "192.0.2.1", "ipv4Subnet": "192.0.2.0/24"} + }]) + .to_string(), + ) + .expect("network"); + if version != "0.10.0" { + fs::write(fake_state.join("modern"), b"").expect("modern schema"); + } let executable = temporary.path().join("container"); let script = format!( r#"#!/bin/sh @@ -1387,12 +1696,22 @@ printf '%s\n' "$*" >> "$commands" last='' for arg in "$@"; do last="$arg"; done case "$1" in - --version) echo 'container CLI version 0.10.0 (build: release, commit: fixture)' ;; - system) echo '{{"status":"running"}}' ;; + --version) cat "$state/version" ;; + system) + if [ -f "$state/slow-service" ]; then touch "$state/service-inspect-started"; sleep 5; fi + cat "$state/service.json" + ;; + network) + if [ "$2" != "inspect" ] || [ "$last" != "default" ]; then exit 64; fi + cat "$state/network.json" + ;; create|start|exec|logs|kill|stop|delete|inspect) if [ "${{2:-}}" = "--help" ]; then case "$1" in - create) echo 'container create --mount --env --network --dns --cpus --memory --kernel --workdir --label' ;; + create) + echo 'container create --mount --env --network --dns --cpus --memory --kernel --workdir --label' + if [ -f "$state/modern" ]; then echo '--cap-add'; fi + ;; start) echo 'container start' ;; exec) echo 'container exec --interactive --detach --workdir' ;; logs) echo 'container logs --follow' ;; @@ -1406,7 +1725,19 @@ case "$1" in case "$1" in create) touch "$state/created" ;; start) touch "$state/running" ;; - inspect) if [ -f "$state/running" ]; then echo '{{"status":"running"}}'; else echo '{{"status":"stopped"}}'; fi ;; + inspect) + if [ -f "$state/inspect.json" ]; then + cat "$state/inspect.json" + else + status=stopped + if [ -f "$state/running" ]; then status=running; fi + if [ -f "$state/modern" ]; then + printf '[{{"id":"%s","configuration":{{"id":"%s"}},"status":{{"state":"%s","networks":[]}}}}]\n' "$last" "$last" "$status" + else + printf '[{{"configuration":{{"id":"%s"}},"status":"%s"}}]\n' "$last" "$status" + fi + fi + ;; exec) if [ "$last" = "noisy" ]; then printf '0123456789abcdef'; else echo 'exec-ok'; fi ;; logs) echo 'log-line' ;; stop) rm -f "$state/running" ;; @@ -1414,8 +1745,9 @@ case "$1" in esac ;; image) - if [ "$last" = "slow:image" ]; then sleep 5; fi + if [ "$last" = "slow:image" ]; then touch "$state/image-inspect-started"; sleep 5; fi if [ "$last" = "fail:image" ]; then echo 'intentional image failure' >&2; exit 23; fi + if [ "$2" = "inspect" ]; then cat "$state/image.json"; fi if [ "$2" = "inspect" ] || [ "$2" = "pull" ]; then exit 0; fi ;; *) echo "unexpected: $*" >&2; exit 64 ;; @@ -1589,26 +1921,361 @@ esac #[tokio::test] async fn fake_cli_passes_shared_runtime_conformance() { + for version in ["0.10.0", "1.7.1"] { + let (temporary, runtime) = fixture_runtime_for_version(version); + let state = temporary.path().join("runtime-state"); + let scenario = RuntimeConformanceScenario { + initialize: InitializeRequest { + state_directory: state, + }, + create: create_request("apple-conformance", "fixture:image"), + start: StartRequest::default(), + exec: ExecRequest { + command: CommandSpec { + arguments: vec![CommandArgument::plain("ok")], + ..CommandSpec::new(Program::Absolute(PathBuf::from("/bin/echo"))) + }, + purpose: ExecPurpose::BootstrapControl, + }, + signal: Some(RuntimeSignal::Interrupt), + }; + run_runtime_conformance(&runtime, scenario) + .await + .unwrap_or_else(|error| panic!("{version} conformance: {error}")); + } + } + + #[tokio::test] + async fn mixed_or_unidentified_services_fail_before_image_or_container_mutation() { + for (version, service) in [ + ( + "0.10.0", + serde_json::json!({ + "status": "running", + "apiServerAppName": "container-apiserver", + "apiServerVersion": "1.7.1" + }), + ), + ("0.10.0", serde_json::json!({"status": "running"})), + ( + "1.7.1", + serde_json::json!({ + "status": "running", + "client": {"appName": "container", "version": "1.7.1"}, + "server": {"appName": "container-apiserver", "version": "0.10.0"} + }), + ), + ( + "1.7.1", + serde_json::json!({ + "status": "running", + "client": {"appName": "wrapper", "version": "1.7.1"}, + "server": {"appName": "container-apiserver", "version": "1.7.1"} + }), + ), + ( + "1.7.1", + serde_json::json!({ + "status": "running", + "client": {"appName": "container", "version": "1.7.1"}, + "server": {"appName": "unreviewed-server", "version": "1.7.1"} + }), + ), + ("1.7.2", serde_json::json!({"status": "running"})), + ("1.7.1-rc.1", serde_json::json!({"status": "running"})), + ] { + let (temporary, runtime) = fixture_runtime_for_version(version); + fs::write( + temporary.path().join("fake-state/service.json"), + service.to_string(), + ) + .expect("service"); + let cancellation = CancellationToken::new(); + assert!( + runtime + .preflight(PreflightRequest::default(), &cancellation) + .await + .is_err(), + "{version}: {service}" + ); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), + }, + &cancellation, + ) + .await + .expect("initialize"); + assert!( + runtime + .create( + create_request("apple-mixed", "fixture:image"), + &cancellation + ) + .await + .is_err(), + "create must independently reject {version}: {service}" + ); + let commands = + fs::read_to_string(temporary.path().join("fake-state/commands")).expect("commands"); + assert!(!commands.lines().any(|line| { + line.starts_with("image ") + || line.starts_with("create ") + || line.starts_with("delete ") + })); + } + } + + #[tokio::test] + async fn inspect_uses_owned_modern_state_and_never_falls_back_to_cached_running() { let (temporary, runtime) = fixture_runtime(); - let state = temporary.path().join("runtime-state"); - let scenario = RuntimeConformanceScenario { - initialize: InitializeRequest { - state_directory: state, - }, - create: create_request("apple-conformance", "fixture:image"), - start: StartRequest::default(), - exec: ExecRequest { - command: CommandSpec { - arguments: vec![CommandArgument::plain("ok")], - ..CommandSpec::new(Program::Absolute(PathBuf::from("/bin/echo"))) + let cancellation = CancellationToken::new(); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), }, - purpose: ExecPurpose::BootstrapControl, - }, - signal: Some(RuntimeSignal::Interrupt), - }; - run_runtime_conformance(&runtime, scenario) + &cancellation, + ) + .await + .expect("initialize"); + let id = runtime + .create( + create_request("apple-inspect", "fixture:image"), + &cancellation, + ) + .await + .expect("create"); + runtime + .start(&id, StartRequest::default(), &cancellation) .await - .expect("conformance"); + .expect("start"); + let inspection = temporary.path().join("fake-state/inspect.json"); + fs::write( + &inspection, + serde_json::json!([{ + "id": id.as_str(), + "configuration": {"id": id.as_str(), "labels": {"status": "running"}}, + "status": {"state": "stopped", "networks": []} + }]) + .to_string(), + ) + .expect("inspect"); + assert_eq!( + runtime + .status(&id, &cancellation) + .await + .expect("status") + .lifecycle, + LifecycleState::Stopped + ); + for invalid in [ + serde_json::json!([]), + serde_json::json!([{"configuration": {"id": "not-owned"}, "status": "running"}]), + serde_json::json!([{ + "id": "not-owned", "configuration": {"id": id.as_str()}, "status": {"state": "running"} + }]), + serde_json::json!([{"configuration": {"id": id.as_str()}, "status": {"state": "new-state"}}]), + serde_json::json!([{"configuration": {"id": id.as_str(), "status": "running"}}]), + serde_json::json!([ + {"configuration": {"id": id.as_str()}, "status": "running"}, + {"configuration": {"id": id.as_str()}, "status": "running"} + ]), + ] { + fs::write(&inspection, invalid.to_string()).expect("invalid inspection"); + assert!( + runtime.status(&id, &cancellation).await.is_err(), + "unrecognized inspection must not look healthy: {invalid}" + ); + } + } + + #[tokio::test] + async fn image_index_must_match_the_pin_not_a_variant_or_display_name() { + let pinned = format!("sha256:{}", "b".repeat(64)); + let image = format!("example.test/fixture@{pinned}"); + for inspection in [ + serde_json::json!([{ + "name": image, "index": {"digest": format!("sha256:{}", "a".repeat(64))}, + "variants": [{"digest": pinned}] + }]), + serde_json::json!([{ + "id": "a".repeat(64), + "configuration": {"name": image, "descriptor": {"digest": format!("sha256:{}", "a".repeat(64))}}, + "variants": [{"digest": pinned}] + }]), + serde_json::json!([{ + "id": "a".repeat(64), + "configuration": {"name": image, "descriptor": {"digest": pinned}}, + "variants": [] + }]), + serde_json::json!([]), + ] { + let (temporary, runtime) = fixture_runtime(); + fs::write( + temporary.path().join("fake-state/image.json"), + inspection.to_string(), + ) + .expect("image inspection"); + let cancellation = CancellationToken::new(); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), + }, + &cancellation, + ) + .await + .expect("initialize"); + assert!( + runtime + .create(create_request("apple-index", &image), &cancellation) + .await + .is_err(), + "must reject mismatched index: {inspection}" + ); + let commands = + fs::read_to_string(temporary.path().join("fake-state/commands")).expect("commands"); + assert!( + !commands + .lines() + .any(|line| line.starts_with("create --name ")) + ); + assert!(!commands.lines().any(|line| line.starts_with("image pull "))); + } + } + + #[tokio::test] + async fn both_image_schemas_preserve_pins_and_validate_post_pull_inspection() { + let image = format!("example.test/fixture@sha256:{}", "a".repeat(64)); + for version in ["0.10.0", "1.7.1"] { + for pull_policy in [ImagePullPolicy::Always, ImagePullPolicy::Never] { + let (temporary, mut runtime) = fixture_runtime_for_version(version); + runtime.configuration.launch.pull_policy = pull_policy; + let cancellation = CancellationToken::new(); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), + }, + &cancellation, + ) + .await + .expect("initialize"); + runtime + .create(create_request("apple-pinned", &image), &cancellation) + .await + .expect("pinned image"); + let commands = fs::read_to_string(temporary.path().join("fake-state/commands")) + .expect("commands"); + assert!(commands.lines().any(|line| { + line.starts_with("create --name ") + && line.ends_with(&format!("{image} container-init")) + })); + if pull_policy == ImagePullPolicy::Always { + assert!( + commands.find("image pull ").expect("pull") + < commands + .find("image inspect ") + .expect("post-pull inspection") + ); + } + } + } + } + + #[tokio::test] + async fn modern_guest_capabilities_cover_enforcement_and_only_opt_in_tracing() { + for version in ["0.10.0", "1.7.1"] { + for tracing in [false, true] { + let (temporary, mut runtime) = fixture_runtime_for_version(version); + runtime.configuration.syscall_tracing = tracing; + let cancellation = CancellationToken::new(); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), + }, + &cancellation, + ) + .await + .expect("initialize"); + runtime + .create( + create_request("apple-capabilities", "fixture:image"), + &cancellation, + ) + .await + .expect("create"); + let commands = fs::read_to_string(temporary.path().join("fake-state/commands")) + .expect("commands"); + let create = commands + .lines() + .find(|line| line.starts_with("create --name ")) + .expect("create command") + .split_whitespace() + .collect::>(); + let capabilities = create + .windows(2) + .filter(|pair| pair[0] == "--cap-add") + .map(|pair| pair[1]) + .collect::>(); + let expected = match (version, tracing) { + ("1.7.1", true) => vec!["CAP_NET_ADMIN", "CAP_SYS_ADMIN"], + ("1.7.1", false) => vec!["CAP_NET_ADMIN"], + _ => Vec::new(), + }; + assert_eq!(capabilities, expected, "{version}, tracing={tracing}"); + } + } + } + + #[tokio::test] + async fn modern_builtin_network_must_be_identified_without_reconfiguration() { + for network in [ + serde_json::json!([]), + serde_json::json!([{ + "id": "default", + "configuration": { + "name": "default", "mode": "nat", "plugin": "unreviewed-plugin", + "labels": {"com.apple.container.resource.role": "builtin"} + } + }]), + serde_json::json!([{ + "id": "default", + "configuration": { + "name": "default", "mode": "nat", "plugin": "container-network-vmnet", + "labels": {} + } + }]), + ] { + let (temporary, runtime) = fixture_runtime_for_version("1.7.1"); + fs::write( + temporary.path().join("fake-state/network.json"), + network.to_string(), + ) + .expect("network"); + assert!( + runtime + .preflight(PreflightRequest::default(), &CancellationToken::new()) + .await + .is_err(), + "must reject unidentified built-in network: {network}" + ); + let commands = + fs::read_to_string(temporary.path().join("fake-state/commands")).expect("commands"); + assert!( + commands + .lines() + .any(|line| line == "network inspect default") + ); + assert!(!commands.lines().any(|line| { + line.starts_with("network create ") + || line.starts_with("network delete ") + || line.starts_with("system start") + })); + } } #[tokio::test] @@ -1665,7 +2332,7 @@ esac fs::read_to_string(temporary.path().join("fake-state/commands")).expect("commands"); let create = commands .lines() - .find(|line| line.starts_with("create ")) + .find(|line| line.starts_with("create --name ")) .expect("create command"); assert!(create.contains("--cpus 3")); assert!(create.contains("--memory 768M")); @@ -1748,40 +2415,57 @@ esac #[tokio::test] async fn fake_cli_cancellation_terminates_the_inflight_operation() { - let (temporary, runtime) = fixture_runtime(); - let runtime = Arc::new(runtime); - let cancellation = CancellationToken::new(); - runtime - .initialize( - InitializeRequest { - state_directory: temporary.path().join("state"), - }, - &cancellation, - ) - .await - .expect("initialize"); - let task_runtime = Arc::clone(&runtime); - let task_cancellation = cancellation.clone(); - let task = tokio::spawn(async move { - task_runtime - .create( - create_request("apple-cancel", "slow:image"), - &task_cancellation, + for phase in ["service", "image"] { + let (temporary, runtime) = fixture_runtime(); + if phase == "service" { + fs::write(temporary.path().join("fake-state/slow-service"), b"") + .expect("slow service"); + } + let runtime = Arc::new(runtime); + let cancellation = CancellationToken::new(); + runtime + .initialize( + InitializeRequest { + state_directory: temporary.path().join("state"), + }, + &cancellation, ) .await - }); - tokio::time::sleep(Duration::from_millis(50)).await; - cancellation.cancel(); - assert!(matches!( - task.await.expect("task"), - Err(RuntimeError::Cancelled) - )); + .expect("initialize"); + let task_runtime = Arc::clone(&runtime); + let task_cancellation = cancellation.clone(); + let task = tokio::spawn(async move { + task_runtime + .create( + create_request("apple-cancel", "slow:image"), + &task_cancellation, + ) + .await + }); + let marker = temporary + .path() + .join(format!("fake-state/{phase}-inspect-started")); + tokio::time::timeout(Duration::from_secs(5), async { + while !marker.exists() { + tokio::time::sleep(Duration::from_millis(5)).await; + } + }) + .await + .expect("inspection must actually be in flight"); + cancellation.cancel(); + assert!(matches!( + tokio::time::timeout(Duration::from_secs(3), task) + .await + .expect("cancellation must interrupt the five-second operation") + .expect("task"), + Err(RuntimeError::Cancelled) + )); + } } #[tokio::test] async fn fake_cli_failures_are_reported_and_output_is_capped() { let (temporary, mut runtime) = fixture_runtime(); - runtime.configuration.output_limit_bytes = 8; let cancellation = CancellationToken::new(); runtime .initialize( @@ -1809,6 +2493,7 @@ esac .start(&id, StartRequest::default(), &cancellation) .await .expect("start"); + runtime.configuration.output_limit_bytes = 8; let outcome = runtime .exec( &id, diff --git a/crates/sendbox-runtime-apple/tests/live.rs b/crates/sendbox-runtime-apple/tests/live.rs index f1a9bfb..c2fe6b1 100644 --- a/crates/sendbox-runtime-apple/tests/live.rs +++ b/crates/sendbox-runtime-apple/tests/live.rs @@ -12,10 +12,10 @@ use sendbox_protocol::{ use sendbox_runtime::{ BootstrapDelivery, BootstrapMaterial, CancellationToken, ChannelLifetime, ChannelOwnership, ContainerId, ControlChannelRequest, ControlEndpointKind, CreateRequest, InitializeRequest, - PreflightRequest, RUNTIME_INJECTED_BOOTSTRAP_TARGET, RuntimeMount, RuntimeProvider, - StartRequest, StopRequest, + LifecycleState, PreflightRequest, RUNTIME_INJECTED_BOOTSTRAP_TARGET, RuntimeMount, + RuntimeProvider, StartRequest, StopRequest, }; -use sendbox_runtime_apple::{AppleRuntime, AppleRuntimeConfiguration}; +use sendbox_runtime_apple::{AppleRuntime, AppleRuntimeConfiguration, ImagePullPolicy}; #[tokio::test] async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup() { @@ -28,9 +28,29 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( let public_key = required_path("SENDBOX_APPLE_CONTAINER_PUBLIC_KEY"); let trust_root_id = required("SENDBOX_APPLE_CONTAINER_TRUST_ROOT_ID"); let image = required("SENDBOX_APPLE_CONTAINER_LIVE_IMAGE"); + let (_, digest) = image + .rsplit_once("@sha256:") + .expect("live image must be pinned by its OCI index SHA-256 digest"); + assert!( + digest.len() == 64 + && digest + .bytes() + .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)), + "live image digest must be canonical SHA-256" + ); let minimum_release_sequence = required("SENDBOX_APPLE_CONTAINER_MIN_RELEASE_SEQUENCE") .parse() .expect("minimum release sequence must be an integer"); + let nonce = SystemTime::now() + .duration_since(UNIX_EPOCH) + .expect("clock") + .as_nanos(); + let container_id = + ContainerId::new(format!("sendbox-apple-live-{}-{nonce}", std::process::id())) + .expect("container id"); + let mut session_bytes = nonce.to_le_bytes(); + session_bytes[..4].copy_from_slice(&std::process::id().to_le_bytes()); + let session_id = SessionId::from_bytes(session_bytes); let mut configuration = AppleRuntimeConfiguration::new( bundle, public_key, @@ -42,6 +62,22 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( if let Ok(executable) = std::env::var("SENDBOX_APPLE_CONTAINER_EXECUTABLE") { configuration.executable = Some(PathBuf::from(executable)); } + configuration.launch.pull_policy = ImagePullPolicy::Never; + configuration.egress_policy = + Some(sendbox_egress::runtime::RuntimePolicyDocument::for_session( + session_id, + sendbox_policy::NetworkPolicy { + default_action: sendbox_policy::Action::Deny, + allowed_domains: Vec::new(), + blocked_domains: Vec::new(), + allow_dns: false, + max_connections: None, + allowed_networks: Vec::new(), + blocked_networks: Vec::new(), + allowed_ports: Vec::new(), + dns: sendbox_policy::DnsPolicy::default(), + }, + )); let runtime = AppleRuntime::new(configuration).expect("runtime configuration"); let cancellation = CancellationToken::new(); runtime @@ -56,6 +92,13 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( let temporary = tempfile::tempdir_in(std::env::current_dir().expect("current directory")) .expect("runtime state"); + let workspace = temporary.path().join("workspace"); + std::fs::create_dir(&workspace).expect("generated workspace"); + std::fs::write( + workspace.join("fixture.txt"), + b"generated live qualification\n", + ) + .expect("generated fixture"); runtime .initialize( InitializeRequest { @@ -66,22 +109,13 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( .await .expect("initialize"); - let nonce = SystemTime::now() - .duration_since(UNIX_EPOCH) - .expect("clock") - .as_nanos(); - let container_id = - ContainerId::new(format!("sendbox-apple-live-{}-{nonce}", std::process::id())) - .expect("container id"); - let mut session_bytes = nonce.to_le_bytes(); - session_bytes[..4].copy_from_slice(&std::process::id().to_le_bytes()); - let session_id = SessionId::from_bytes(session_bytes); + eprintln!("owned live container: {container_id}"); let boundary_plan_digest = BoundaryPlanDigest::from_bytes([0x84; 32]); let secret = [0x6d_u8; 32]; let mut created = false; let mut channel = None; - let primary = async { + let primary = tokio::time::timeout(Duration::from_secs(90), async { runtime .create( CreateRequest { @@ -95,7 +129,7 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( memory_bytes: 512 * 1024 * 1024, }, mounts: vec![RuntimeMount { - source: temporary.path().to_path_buf(), + source: workspace, destination: PathBuf::from("/workspace"), writable: true, }], @@ -111,6 +145,16 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( runtime .start(&container_id, StartRequest::default(), &cancellation) .await?; + if runtime + .status(&container_id, &cancellation) + .await? + .lifecycle + != LifecycleState::Running + { + return Err(sendbox_runtime::RuntimeError::Provider( + "live container inspect did not report running".to_owned(), + )); + } let provisioned = runtime .provision_control_channel( ControlChannelRequest { @@ -172,8 +216,9 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( .await .map_err(protocol_error)?; Ok::<(), sendbox_runtime::RuntimeError>(()) - } - .await; + }) + .await + .unwrap_or(Err(sendbox_runtime::RuntimeError::TimedOut)); let channel_cleanup = if let Some(channel) = channel.as_mut() { channel.cleanup(&cancellation).await @@ -187,11 +232,28 @@ async fn configured_live_runtime_proves_authenticated_stdio_channel_and_cleanup( } else { Ok(()) }; + let stopped_status = if created && stop.is_ok() { + runtime + .status(&container_id, &cancellation) + .await + .and_then(|status| { + if status.lifecycle == LifecycleState::Stopped { + Ok(()) + } else { + Err(sendbox_runtime::RuntimeError::Provider( + "live container inspect did not report stopped".to_owned(), + )) + } + }) + } else { + Ok(()) + }; let cleanup = runtime.cleanup(&container_id, &cancellation).await; primary.expect("live lifecycle and authenticated channel"); channel_cleanup.expect("live channel cleanup"); stop.expect("live stop"); + stopped_status.expect("live stopped inspect"); assert!(cleanup.expect("live cleanup").is_complete()); } diff --git a/crates/sendbox-secrets/Cargo.toml b/crates/sendbox-secrets/Cargo.toml index 6448777..ee8a0f1 100644 --- a/crates/sendbox-secrets/Cargo.toml +++ b/crates/sendbox-secrets/Cargo.toml @@ -20,10 +20,10 @@ url.workspace = true zeroize.workspace = true [target.'cfg(target_os = "linux")'.dependencies] -cap-std = "4.0.2" +cap-std = "4.0.3" fs2 = "0.4.3" libc = "0.2.183" -rustix = { version = "1.1.4", features = ["process"] } +rustix = { version = "1.1.6", features = ["process"] } [target.'cfg(target_os = "macos")'.dependencies] core-foundation = "0.10.1" diff --git a/docs/apple-runtime.md b/docs/apple-runtime.md index a319656..bd189a4 100644 --- a/docs/apple-runtime.md +++ b/docs/apple-runtime.md @@ -11,7 +11,8 @@ inside the VM. ## Requirements - macOS on arm64 -- official `container` CLI **0.10.0** +- official `container` CLI and API server with exactly matching versions: + **0.10.0 / 0.10.0** or **1.7.1 / 1.7.1** - a root-owned executable, root-owned/non-writable bundle and optional kernel, and a root-owned mode `0444` Ed25519 public key - the `container` service already registered and running @@ -28,14 +29,87 @@ A plain Alpine base image does not include `nftables`. Entrypoint and working-directory paths must also be symlink-free; see the [workload image requirements](installation.md#workload-image-versus-guest-bundle). -`setup.sh` installs only the qualified 0.10.0 signed package and verifies its -pinned SHA-256 digest plus package signature before invoking the installer. -Already-installed later versions fail preflight rather than being accepted -optimistically. +The 1.7.1 adapter changes are source compatibility, not a new SendBox release +or completed consumer qualification. Released SendBox v0.2.5 does not contain +them. Keep using independently verified, compatible released host/guest bytes +for production; a source build or portable fixture pass is not equivalent. + +`setup.sh` still installs only the pinned 0.10.0 signed package and verifies its +SHA-256 digest plus package signature. This compatibility change does not +update the installer, install 1.7.1, or change the registered service. All +other versions, prereleases, and mixed CLI/server pairs fail closed. Preflight is non-mutating. It queries version, complete command help, and -`container system status --format json`. It never runs `container system -start`, `stop`, or registration commands. +`container system status --format json`. It checks the API server's version and +`container-apiserver` identity, not just `status: running`. The 1.7.1 payload +must also identify the client as `container` at the selected CLI version. +Creation repeats preflight before inspecting/pulling an image or creating a +container, including when a library caller omitted a separate preflight. +It never runs `container system start`, `stop`, or registration commands. + +### Executable and service selection + +The production host resolves `container` in this fixed order, independently of +the caller's `PATH`: `/usr/local/bin`, `/opt/homebrew/bin`, `/usr/bin`, `/bin`. +It does not skip an older installed executable to find a newer one. Diagnostics +identify the selected absolute path and observed CLI/server versions. A +user-owned Homebrew CLI or writable ancestor is still rejected. + +`AppleRuntimeConfiguration.executable` is an explicit library API override. +`SENDBOX_APPLE_CONTAINER_EXECUTABLE` configures only the live test below; it is +not an override for `sendbox run`. The production CLI currently has no Apple +executable override. Do not copy an unsigned Homebrew binary into a trusted +location or relax ownership checks to make preflight pass. + +Apple 1.7.1 discovers plugins from the **running server's** `installRoot`: +`libexec/container-plugins` first, then `libexec/container/plugins` beneath that +root. The official signed package installs `bin/container`, +`bin/container-apiserver`, and `libexec/container/plugins//` under +`/usr/local`; each plugin has its own `bin/` executable and `config.toml`. +Apple's `--install-root` option belongs to `container system start`, not a +per-container command. SendBox clears inherited `CONTAINER_*` variables and +does not offer a plugin-root override or restart services. + +In the compatibility investigation, `/usr/local/bin/container` was 0.10.0 +while the API server and Homebrew CLI were 1.7.1. The old CLI returned an empty +network list and failed creation with `builtin network is not present`; the +matching 1.7.1 CLI could see the existing built-in `default` NAT network. That +error was not evidence that a network should be created or reconfigured. +An operator must review and provision a matching trusted CLI explicitly. + +### Reviewed JSON contracts + +The 1.7.1 contracts were reviewed against upstream +[`a15b46097aa4c2325da13c1fb5192b9274aab083`](https://github.com/apple/container/tree/a15b46097aa4c2325da13c1fb5192b9274aab083): + +- Image inspection accepts the 0.10.0 top-level `name`/`index.digest` layout + and the 1.7.1 `configuration.name`/`configuration.descriptor.digest` layout. + Exactly one image is required. The 1.7.1 raw-hex `id` must agree with the + canonical SHA-256 descriptor. A requested digest must match that descriptor, + never a tag, display name, annotation, or platform-variant digest. Inspection + is repeated after a pull; malformed or truncated output fails. +- Container inspection requires exactly one record bound to the owned + `configuration.id`. It reads the 0.10.0 top-level status string or the + 1.7.1 `status.state` plus matching top-level `id`. Missing, unknown, or + ambiguous state is an error, never cached `running` health or a recursively + discovered label. +- With the default network on 1.7.1, non-mutating + `network inspect default` must identify `id` and `configuration.name` as + `default`, mode `nat`, plugin `container-network-vmnet`, and label + `com.apple.container.resource.role=builtin`. This is a prerequisite check, + not network creation, migration, or an egress-policy exception. + +Apple 1.7.1 also restricts the default Linux capability set. A root UID alone +cannot program nftables: the reviewed default mask lacks `CAP_NET_ADMIN`. +The adapter explicitly grants that capability to the signed trusted guest +containment services. Only when syscall tracing is explicitly enabled does it +also grant guest-only `CAP_SYS_ADMIN`, needed by the reviewed guest to mount +tracefs and attach BPF programs. That broader trusted-service capability is +absent when tracing is disabled. It never requests `ALL` or a privileged +container. The non-root workload still runs through the signed +launcher with empty capability sets, seccomp and deny-first command/network +policy; these supervisor grants are not workload grants. The 0.10.0 argv is +unchanged because that CLI does not offer `--cap-add`. ## Lifecycle and control transport @@ -51,10 +125,9 @@ environment, mounts, DNS servers, CPU, memory, working directory, and labels override or extend adapter defaults. Memory must be expressed in whole MiB, and conflicting no-DNS/DNS settings fail before the CLI is invoked. -Apple 0.10.0 advertises `--publish-socket`, but the available development host -reported an unregistered service, so no live VM evidence established its -replacement, ownership, cancellation, or bidirectional semantics. The -production adapter therefore **does not advertise published Unix sockets**. +Both reviewed versions advertise `--publish-socket`, but no live VM evidence +establishes its replacement, ownership, cancellation, or bidirectional semantics. +The production adapter therefore **does not advertise published Unix sockets**. It uses another official CLI surface: 1. The provider combines the per-session secret with the signed trust metadata, @@ -92,22 +165,54 @@ export SENDBOX_APPLE_CONTAINER_PUBLIC_KEY=/absolute/path/to/root.pub export SENDBOX_APPLE_CONTAINER_TRUST_ROOT_ID=release-root-v1 export SENDBOX_APPLE_CONTAINER_MIN_RELEASE_SEQUENCE=1 export SENDBOX_APPLE_CONTAINER_LIVE_IMAGE=ghcr.io/example/sendbox-base@sha256:... +# Optional explicit trusted CLI path, for this test only: +export SENDBOX_APPLE_CONTAINER_EXECUTABLE=/usr/local/bin/container cargo test -p sendbox-runtime-apple --test live -- --nocapture ``` When `SENDBOX_APPLE_CONTAINER_LIVE=1`, missing configuration, a stopped service, transport failure, authentication failure, or cleanup failure fails the test; -it is not converted to a skip. The test uses unique container and session/socket -identities and always attempts channel cleanup, stop, and targeted delete. +it is not converted to a skip. The image must already exist locally at its exact +index digest; the test never pulls it. It mounts only generated fixture data, +separate from host runtime state, uses unique container and session/socket +identities, and checks running and stopped inspect states. The primary live +operation has a 90-second deadline, followed by channel cleanup, stop, and +targeted delete even after failure. An ordinary test run without the live flag +does not provide physical qualification evidence. + +The November 11, 2026 investigation first verified mixed-version and +user-owned-CLI rejection before VM creation. After the operator provisioned the +official root-owned Apple 1.7.1 CLI, the live gate passed with the already-running +1.7.1 service and existing default network. A generated production-host Node +workload also exited successfully with non-root UID, empty workload capability +sets and `NoNewPrivs=1`. A separate generated cancellation returned exit 130, +rolled back its transient write, preserved prior successful output, and removed +the exact owned VM. No model credentials or live checkout were used. + +These runs used the source-built, dependency-patched host with the unchanged +reviewed v0.2.5 guest bundle, release sequence 10. They are backend evidence, +not patched guest or release qualification. New independently reviewed +compatible host/guest release artifacts and each consumer's exact-image +execution, cancellation, recovery, accounting, and checkpoint qualification +remain separate gates. + +Optional syscall tracing remains **unqualified on the inspected default guest +environment**: guest kernel 6.18.5 exposed neither +`/sys/kernel/tracing` nor `/sys/kernel/btf/vmlinux`. The reviewed tracer failed +with `mounting guest tracefs: No such file or directory`, even with the +explicitly opted-in guest-only `CAP_SYS_ADMIN`. Prepare a trusted guest/kernel +exposing tracefs, BTF and the required tracepoints before qualifying this mode. +Do not silently skip tracing or claim readiness when it was requested. SendBox +does not install a kernel or restart/reconfigure shared services to fix it. ## Limitations -- Only CLI 0.10.0 is qualified; later versions fail preflight until their help - and lifecycle schemas are reviewed. +- Only exact matching 0.10.0 and 1.7.1 CLI/server pairs are supported by this + source. No other version is accepted based on ordering or help similarity. - The adapter does not start/register/stop the Apple service. - `--publish-socket`, Rosetta, virtualization passthrough, SSH forwarding, TTY mode, and arbitrary workload exec are not advertised. -- Apple CLI 0.10.0 has no hostname option. Container identity remains the +- Neither reviewed CLI has a hostname option. Container identity remains the session-unique container name rather than claiming a separately configured kernel hostname. - Runtime `Network` capability covers Apple network/DNS provisioning. @@ -147,9 +252,10 @@ In one retained failed run, Apple reported `vmexec ... read ack pipe` while starting the control relay; the guest was locally ready but the relay never reached the handshake. Apple 0.10.0 can also wait indefinitely after such a start failure. The upstream [waiter fix](https://github.com/apple/container/pull/1289) -is included in 0.11.0, but later Apple versions remain unqualified by this -adapter. Do not infer that a later successful retry repaired an earlier failed -run or upgrade the host service as an implicit workaround. +is included in 0.11.0. That does not qualify 0.11.0 or every later version; +this adapter separately reviews exact supported pairs. Do not infer that a +later successful retry repaired an earlier failed run or upgrade the host +service as an implicit workaround. Replacing only the host CLI cannot correct that guest defect: rebuild and sign the guest bundle as well. Host/guest manifest versions must match the binaries, diff --git a/docs/installation.md b/docs/installation.md index 1aedf97..dc841cf 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -16,7 +16,7 @@ narrower capability set. | Apple runtime | macOS | 26 (Tahoe) or newer | | Apple runtime | Hardware | Apple silicon | | Apple runtime | Xcode | 26 | -| Apple runtime | Official `container` CLI | Exactly 0.10.0; service already registered and running | +| Apple runtime | Official `container` CLI and API server | Exact matching 0.10.0 or 1.7.1 pair; service already registered and running; see [source/release qualification status](apple-runtime.md#requirements) | | Kata runtime | Linux | Bare metal or nested virtualization | | Kata runtime | Kata Containers | 3.28 or newer | | Kata runtime | containerd | 1.7 or newer | @@ -63,8 +63,9 @@ provenance before trusting it. The existing [mbianchidev/tap](https://github.com/mbianchidev/homebrew-tap) uses a **formula**, not a GUI cask. -Before installing, confirm the formula uses a patched stable release -**v0.2.3 or newer**. Published v0.2.2 and earlier binaries predate +Before installing, check the [dependency security status](#dependency-security-status). +The **v0.2.3 TLS-fix floor is necessary but no longer sufficient**. +Published v0.2.2 and earlier binaries predate [RUSTSEC-2026-0382](https://rustsec.org/advisories/RUSTSEC-2026-0382) and [RUSTSEC-2026-0383](https://rustsec.org/advisories/RUSTSEC-2026-0383). Published binaries cannot inherit source fixes. The planned central updater @@ -73,6 +74,32 @@ the formula. **Central automation is pending review and activation in the tap**; see [stable Homebrew updates](#stable-homebrew-updates). This source change does not publish a replacement release or activate that automation. +### Dependency security status + +The November 11, 2026 CI audit identified additional advisories in the unchanged +v0.2.5 source/release lockfile. Source now requires at least +`cap-std`/`cap-primitives` 4.0.3, `hickory-proto` 0.26.2, and `rustix` 1.1.6; +the lockfiles resolve `hickory-proto` 0.26.3: + +- [RUSTSEC-2026-0482](https://rustsec.org/advisories/RUSTSEC-2026-0482): + capability filesystem sandbox escape, fixed by `cap-primitives` 4.0.3. +- [RUSTSEC-2026-0491](https://rustsec.org/advisories/RUSTSEC-2026-0491), + [0487](https://rustsec.org/advisories/RUSTSEC-2026-0487), + [0488](https://rustsec.org/advisories/RUSTSEC-2026-0488), + [0490](https://rustsec.org/advisories/RUSTSEC-2026-0490), and + [0489](https://rustsec.org/advisories/RUSTSEC-2026-0489): + DNS allocation/panic defects fixed by `hickory-proto` 0.26.2. +- [RUSTSEC-2026-0486](https://rustsec.org/advisories/RUSTSEC-2026-0486): + an extended-attribute buffer unsoundness warning fixed by `rustix` 1.1.6. + +These are source fixes, not newly published artifacts. Rebuild and independently +review both the host and signed guest bundle in a new release; an installed +v0.2.5 binary or guest bundle does not inherit dependency updates or Apple 1.7.1 +compatibility. Do not treat an older release as patched merely because it +passes signature/digest verification or the historical TLS version floor. + +### Formula installation + Install with: ```bash diff --git a/fuzz/bpf/Cargo.lock b/fuzz/bpf/Cargo.lock index 5766d08..adc8d04 100644 --- a/fuzz/bpf/Cargo.lock +++ b/fuzz/bpf/Cargo.lock @@ -54,7 +54,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -65,7 +65,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -136,9 +136,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -148,15 +148,15 @@ dependencies = [ "maybe-owned", "rustix", "rustix-linux-procfs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "winx", ] [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -483,7 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -663,9 +663,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -1278,15 +1278,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1765,7 +1765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2123,7 +2123,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/fuzz/config/Cargo.lock b/fuzz/config/Cargo.lock index 8246366..e9e468c 100644 --- a/fuzz/config/Cargo.lock +++ b/fuzz/config/Cargo.lock @@ -301,9 +301,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/fuzz/credentials/Cargo.lock b/fuzz/credentials/Cargo.lock index c85821a..3ce50dd 100644 --- a/fuzz/credentials/Cargo.lock +++ b/fuzz/credentials/Cargo.lock @@ -54,7 +54,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -65,7 +65,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -150,9 +150,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -162,15 +162,15 @@ dependencies = [ "maybe-owned", "rustix", "rustix-linux-procfs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "winx", ] [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -416,7 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -587,9 +587,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -1183,7 +1183,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1296,15 +1296,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1373,7 +1373,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1712,7 +1712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2147,7 +2147,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/fuzz/git/Cargo.lock b/fuzz/git/Cargo.lock index ea20ab6..9eef89f 100644 --- a/fuzz/git/Cargo.lock +++ b/fuzz/git/Cargo.lock @@ -273,9 +273,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/fuzz/mcp/Cargo.lock b/fuzz/mcp/Cargo.lock index edd5648..6f7041b 100644 --- a/fuzz/mcp/Cargo.lock +++ b/fuzz/mcp/Cargo.lock @@ -54,7 +54,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -65,7 +65,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -121,9 +121,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -133,15 +133,15 @@ dependencies = [ "maybe-owned", "rustix", "rustix-linux-procfs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", "winx", ] [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -366,7 +366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -518,9 +518,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -1067,15 +1067,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1445,7 +1445,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1768,7 +1768,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/fuzz/project/Cargo.lock b/fuzz/project/Cargo.lock index 5192329..b1a8385 100644 --- a/fuzz/project/Cargo.lock +++ b/fuzz/project/Cargo.lock @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/fuzz/registry/Cargo.lock b/fuzz/registry/Cargo.lock index 35eca32..7561ef3 100644 --- a/fuzz/registry/Cargo.lock +++ b/fuzz/registry/Cargo.lock @@ -591,7 +591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1497,7 +1497,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1667,15 +1667,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags 2.13.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1732,7 +1732,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2398,7 +2398,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2833,7 +2833,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/fuzz/secrets/Cargo.lock b/fuzz/secrets/Cargo.lock index a8efd60..1f20730 100644 --- a/fuzz/secrets/Cargo.lock +++ b/fuzz/secrets/Cargo.lock @@ -47,9 +47,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -65,9 +65,9 @@ dependencies = [ [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -563,9 +563,9 @@ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/fuzz/security/Cargo.lock b/fuzz/security/Cargo.lock index 3415e6a..b681f96 100644 --- a/fuzz/security/Cargo.lock +++ b/fuzz/security/Cargo.lock @@ -68,9 +68,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cap-primitives" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdadbd7c002d3a484b35243669abdae85a0ebaded5a61117169dc3400f9a7ff0" +checksum = "8b5f74729fd2f44701d1a8eb47e906cdb3ccd9ec0f02baad85a744b791940b18" dependencies = [ "ambient-authority", "fs-set-times", @@ -86,9 +86,9 @@ dependencies = [ [[package]] name = "cap-std" -version = "4.0.2" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7281235d6e96d3544ca18bba9049be92f4190f8d923e3caef1b5f66cfa752608" +checksum = "c1ec78e242cfa2cfe276807ac2ecc00315a6c97786977414bcd1c3963b6c91b8" dependencies = [ "cap-primitives", "io-extras", @@ -762,9 +762,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/spikes/apple-container-adapter/Cargo.lock b/spikes/apple-container-adapter/Cargo.lock index c80c285..9aee6ba 100644 --- a/spikes/apple-container-adapter/Cargo.lock +++ b/spikes/apple-container-adapter/Cargo.lock @@ -271,9 +271,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/spikes/egress-enforcement/Cargo.lock b/spikes/egress-enforcement/Cargo.lock index e5fde6e..28ae629 100644 --- a/spikes/egress-enforcement/Cargo.lock +++ b/spikes/egress-enforcement/Cargo.lock @@ -213,7 +213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -268,9 +268,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -605,15 +605,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -777,7 +777,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -929,7 +929,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/spikes/egress-enforcement/Cargo.toml b/spikes/egress-enforcement/Cargo.toml index b5a82a2..cdacee7 100644 --- a/spikes/egress-enforcement/Cargo.toml +++ b/spikes/egress-enforcement/Cargo.toml @@ -20,7 +20,7 @@ path = "src/bin/netns_harness.rs" [dependencies] async-trait = "0.1.89" clap = { version = "4.6.2", features = ["derive"] } -hickory-proto = "0.26.1" +hickory-proto = "0.26.2" ipnet = "2.11.0" libc = "0.2.177" serde = { version = "1.0.228", features = ["derive"] } diff --git a/spikes/exec-broker/Cargo.lock b/spikes/exec-broker/Cargo.lock index 6dfa2f9..831df85 100644 --- a/spikes/exec-broker/Cargo.lock +++ b/spikes/exec-broker/Cargo.lock @@ -366,9 +366,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno", diff --git a/tools/sendbox-qualification/Cargo.lock b/tools/sendbox-qualification/Cargo.lock index b570a9a..628cc0a 100644 --- a/tools/sendbox-qualification/Cargo.lock +++ b/tools/sendbox-qualification/Cargo.lock @@ -495,9 +495,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rustix" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" dependencies = [ "bitflags", "errno",