Skip to content

feat: QUIC agent tunnel — protocol, listener, agent client#1738

Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit intomasterfrom
feat/quic-tunnel-1-core
Draft

feat: QUIC agent tunnel — protocol, listener, agent client#1738
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit intomasterfrom
feat/quic-tunnel-1-core

Conversation

@irvingoujAtDevolution
Copy link
Copy Markdown
Contributor

Summary

Add QUIC-based agent tunnel core infrastructure. Agents in private networks connect outbound to Gateway via QUIC/mTLS, advertise reachable subnets and domains, and proxy TCP connections on behalf of Gateway.

This is PR 1 of 4 in a stacked PR series:

  1. Protocol + Tunnel Core (this PR)
  2. Transparent Routing (SSH/RDP/KDC through tunnel)
  3. Auth + Webapp (scope token exchange, management UI)
  4. Deployment + Installer (Docker, MSI)

What's included

Protocol (crates/agent-tunnel-proto/):

  • RouteAdvertise with subnets + domain advertisements
  • ConnectMessage/ConnectResponse for session stream setup
  • Heartbeat/HeartbeatAck for liveness detection

Gateway (devolutions-gateway/src/agent_tunnel/):

  • QUIC listener with mTLS authentication
  • Agent registry with subnet/domain tracking
  • Certificate authority for agent enrollment
  • Enrollment token store (one-time tokens)

Agent (devolutions-agent/):

  • QUIC client with auto-reconnect and exponential backoff
  • Enrollment with config merge (preserves existing settings)
  • Domain auto-detection (Windows/Linux)

API endpoints:

  • POST /jet/agent-tunnel/enroll
  • GET /jet/agent-tunnel/agents
  • GET/DELETE /jet/agent-tunnel/agents/{id}
  • POST /jet/agent-tunnel/agents/resolve-target

Test plan

  • cargo check -p devolutions-gateway -p devolutions-agent --release
  • 34 unit/integration tests pass (cargo test -p devolutions-gateway --release --lib -- agent_tunnel)
  • cargo test -p agent-tunnel-proto --release
  • Manual: agent enrolls and connects to gateway via QUIC
  • Manual: agent auto-reconnects after gateway restart

🤖 Generated with Claude Code

Add QUIC-based agent tunnel core infrastructure. Agents in private
networks connect outbound to Gateway via QUIC/mTLS, advertise reachable
subnets and domains, and proxy TCP connections on behalf of Gateway.

Protocol (agent-tunnel-proto crate):
- RouteAdvertise with subnets + domain advertisements
- ConnectMessage/ConnectResponse for session stream setup
- Heartbeat/HeartbeatAck for liveness detection
- Protocol version negotiation (v2)

Gateway (agent_tunnel module):
- QUIC listener with mTLS authentication
- Agent registry with subnet/domain tracking
- Certificate authority for agent enrollment
- Enrollment token store (one-time tokens)
- Bidirectional proxy stream multiplexing

Agent (devolutions-agent):
- QUIC client with auto-reconnect and exponential backoff
- Agent enrollment with config merge (preserves existing settings)
- Domain auto-detection (Windows: USERDNSDOMAIN, Linux: resolv.conf)
- Subnet validation on incoming connections
- Certificate file permissions (0o600 on Unix)

API endpoints:
- POST /jet/agent-tunnel/enroll — agent enrollment
- GET /jet/agent-tunnel/agents — list agents
- GET /jet/agent-tunnel/agents/{id} — get agent
- DELETE /jet/agent-tunnel/agents/{id} — delete agent
- POST /jet/agent-tunnel/agents/resolve-target — routing diagnostics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant