feat(agent): derive QUIC endpoint from enrollment URL host#1795
Closed
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 2 commits into
Closed
Conversation
4 tasks
…uic_port Companion to the gateway-side identity refactor. The agent now composes the QUIC dial target from `(jet_gw_url.host, quic_port)` rather than blindly trusting whatever `quic_endpoint` the gateway returned. The host the agent uses is the host the operator already proved is reachable from this agent's network (the host the enrollment HTTP call landed on); the gateway only tells the agent which UDP port to dial. `EnrollResponse` now accepts both shapes during the compat window: - New gateways send both `quic_endpoint` (legacy) and `quic_port` (new). The agent prefers `quic_port` and pairs it with the enrollment URL host. - Older gateways send only `quic_endpoint`. The agent parses the port off that and still pairs it with the enrollment URL host so the old SAN-mismatch symptom (gateway substitutes its `conf.hostname` and breaks DNS resolution on the agent side) cannot recur on either side of the upgrade. `format_endpoint` handles DNS, IPv4, and IPv6 hosts with proper bracketing for IPv6 literals (`[fd00::7]:4433`). Issue: DGW-Agent-Tunnel-Identity
add8746 to
c0a9a8c
Compare
Contributor
Author
|
Closing — not authorized; will be reopened after explicit owner approval. |
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
Second of three PRs implementing the agent-tunnel identity refactor
described in
AGENT_TUNNEL_IDENTITY_DESIGN.md. This PR is agent-only.With #1794 (PR 1) the gateway now returns
quic_portseparately fromthe legacy
quic_endpoint. This PR teaches the agent to derive the QUICdial target from the host the admin already chose for enrollment
(
jet_gw_url) rather than whatever hostname the gateway happens toadvertise in
quic_endpoint. The host the agent uses is thereforeguaranteed to be one the agent's network can reach (it just did, during
enrollment).
Scope (per spec PR 2):
jet_gw_urlhost from the enrollment JWT.format_endpoint(host, port)helper that handles DNS, IPv4, andbracketed IPv6 correctly (
[fd00::7]:4433vs10.10.0.7:4433).quic_portfrom the enrollment response when present; fall backto parsing
quic_endpointfor backward compatibility with oldergateways during the rollout window.
agent.json::Tunnel.GatewayEndpointfrom the new logic.Dependency
This PR depends on #1794 (gateway returns
quic_port). It is the basefor #pr3 (installer).
Spec
See
AGENT_TUNNEL_IDENTITY_DESIGN.md(PR 2 section).Test plan
cargo test -p devolutions-agentpassesformat_endpointcovering IPv4, IPv6, DNSSAN validates against multi-SAN cert from PR 1