Commit f16f14a
committed
feat(dgw): decouple agent tunnel SAN from network endpoint
Splits the Gateway's cryptographic identity (the SAN written to the agent
tunnel server certificate) from its network reachability (the host the agent
dials). A single `conf.hostname` was previously overloaded as both, which broke
deployments where the gateway is reachable by several names depending on the
agent's network position (internal FQDN, IP literal, public DNS).
`AgentTunnel.AdvertisedNames` is the authoritative list of names/IPs the
gateway accepts enrollments through, and is the SAN set written into
`agent-tunnel-server-cert.pem`. Each entry is either a bare string or
`{ "Name": "...", "Label": "..." }` for DVLS UI grouping. When absent, the
config defaults to `[conf.hostname]` so existing deployments are unaffected.
At gateway boot the server cert is regenerated whenever the on-disk SAN set
differs from the configured advertised names. The existing server keypair is
reused so the SPKI pin held by already-enrolled agents stays stable; only the
cert document is reissued. The new cert fingerprint is logged.
`/jet/tunnel/enroll` now parses the JWT's `jet_gw_url`, normalises the host
(DNS lowercased, IP literals canonicalised), and rejects with HTTP 400 +
`{ error, message, help }` body when the host is not in
`AgentTunnel.AdvertisedNames`. The enrollment response now carries both
`quic_endpoint` (legacy, computed from the validated JWT host and the listen
port) and `quic_port` (new); a follow-up release will drop `quic_endpoint`.
`/jet/diagnostics/configuration` now exposes an `agent_tunnel` field with
`enabled`, `listen_port`, and the advertised name list (with optional labels).
DVLS reads this to build the "Generate enrollment string" dropdown.
Issue: DGW-Agent-Tunnel-Identity1 parent 45de0e6 commit f16f14a
7 files changed
Lines changed: 706 additions & 89 deletions
File tree
- crates/agent-tunnel/src
- devolutions-gateway/src
- api
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
35 | 65 | | |
36 | 66 | | |
37 | 67 | | |
| |||
75 | 105 | | |
76 | 106 | | |
77 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
78 | 126 | | |
79 | 127 | | |
80 | 128 | | |
81 | 129 | | |
82 | 130 | | |
| 131 | + | |
83 | 132 | | |
84 | 133 | | |
85 | 134 | | |
| |||
0 commit comments