Repository navigation
feat(supervisor): route approved egress through appliance VPN - #13
Draft
craig-kindo wants to merge 8 commits into
Draft
craig-kindo wants to merge 8 commits into
craig-kindo wants to merge 8 commits into
Conversation
Signed-off-by: craig <craig@kindo.ai>
Signed-off-by: craig <craig@kindo.ai>
Advisor-ca-squashed review cuts preserved (review_token binding, single denial builder, presentation-only validation, endpoint CA contracts incl. pub validate_upstream_ca_pem and the CA-survival tests); VPN appliance code brought in whole (tunnel_id plumbing, tunnel policy validation, TunnelRouteConflict merge error, tokio-wireguard vendor, tunnel.rs).
Signed-off-by: craig <craig@kindo.ai> (cherry picked from commit 4447bcd89e25787c8d3cf78eceb75677aa3467cc)
… builds The VPN integration added tunnel reconciliation to the sidecar entrypoint handler but referenced `networking`, a binding that only exists in the outer run_sandbox scope. The handler region is #[cfg(target_os = "linux")], so macOS-only scoped checks never compiled it and every Linux-target build of openshell-sandbox failed with E0425 (cannot find value `networking`). Carry the tunnel manager through SidecarEntrypointHandler instead, populated from the same RunContext tunnel the policy poll loop uses. (cherry picked from commit d6719b35c0a223460cfa642094b4407ca1144d30)
The vpn-appliance example built Peer.allowed_ips as Strings via format! but tokio_wireguard::config::Peer expects Vec<IpNet>, failing the Linux example build with E0308. Parse the formatted /32 like the file's own interface address pattern. Verified: cargo check -p openshell-supervisor-network --example vpn-appliance. (cherry picked from commit 7785c867e86889448f1c5a145fda04c994156027)
…eway RPCs policy.local's proposal submit and lookup/wait paths dialed the configured OPENSHELL_ENDPOINT directly. In a Kubernetes fleet deployment that endpoint is the headless Service — a discovery address the chart deliberately omits from the gateway's serving certificate (see the sandbox chart's openshellServerExtraSans: the per-pod wildcard only), so the dial fails TLS hostname verification and every wait/lookup returns gateway_connect_failed. The denial flush hit the same wall and already addressed a replica via gateway_fleet::unary_endpoint; these two paths are the outliers. Lift unary_endpoint (plus endpoint_shape/member_endpoint) into openshell-core's gateway_fleet so the supervisor-network crate can reach it without a dependency inversion, delegate the supervisor-process copy to it, and route both policy.local connect sites through a new connect_gateway_for_rpc helper with bounded replica rotation. Single-endpoint deployments are unchanged: unary_endpoint returns the configured endpoint when no fleet is configured. (cherry picked from commit 70c88b5d9c3fa4d0f1897e5f06210bfc4b09a4de)
Stop/start resolved the Sandbox CR by the gateway id-label selector, but in claim mode the bound Sandbox is pool-generated and carries no gateway labels — the id label lives on the SandboxClaim, and the claim's status.sandbox.name names the bound CR. StopSandbox on a claimed sandbox therefore always failed with 'stop sandbox failed: sandbox not found'. get_sandbox and delete_sandbox already resolve claims by the same selector; stop/start now fall back to the same resolution: find the claim by id label, read status.sandbox.name, and patch the operating state on the bound CR. Direct-mode sandboxes keep the existing label-lookup path. (cherry picked from commit a01b0bb7ce9f77e3137f2c04fd18e356e70b0edd)
Author
E2E EvidenceCluster: Scenario 5
The full S5.0–S5.7 scenario ended |
|
This pull request has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add supervisor-terminated, per-sandbox WireGuard tunnels for policy-approved destinations. The tunnel uses userspace
tokio_wireguardwithout a kernel module, and the supervisor remains the policy point for inner traffic.Stacked on #12 — merge that first; this PR's diff is only the VPN work. Companion mono PR #14658 supplies the
via: 'vpn'destination and appliance configuration flow on top of mono #14611.Related Issue
No accepted issue was provided for this directly requested, multi-repository feature. Repository convention requires an accepted issue for a feature or architecture PR; link one before merge.
Changes
TunnelManagerandSandboxPolicy.tunnelsmap with appliance host and UDP port, peer public key,private_key_env_keyreference, local address, allowed inner CIDRs, MTU, and keepalive.NetworkEndpoint.tunnel_idselects the tunnel at the upstream dial.vpn-appliancetest example and Linux sidecar cfg-gate fix.validate_upstream_ca_pemthrough merge-conflict resolution. The companion mono branch has a post-merge fix that restores itsstale_reviewerror kind.Known state: tunnel reload state and task-local manager selection carry audit-flagged simplification debt to resolve before this draft leaves draft. Key rotation and inner DNS are future phases.
Testing
mise run pre-commitpasses — not independently rerun during this PR submission; commits are unchanged.cargo check -p openshell-supervisor-network -p openshell-serverpassed on this stacked branch. The companion mono and fork changes passed scenario 5 end to end on digest-verified stacked images; see thedoink-qa-evidencecomment and localk3d-verify/case-vpn5/STATUS.mdreport.Checklist