REFERENCE

Endpoints off the office network

Your laptops leave the office, and you want them to keep checking in and installing attested updates from home or a hotel, without a VPN and without putting the console on the Internet.

UPDATED

An endpoint gets its updates by checking in with your server and installing from your attested feed. A laptop that leaves the office can no longer reach a LAN address, so without a VPN it gets nothing until it is back. Since platform 0.249.1, Community Edition can publish the agent and feed routes, and nothing else, on a second port that a front door you run puts on the Internet. With agents from 0.249.2, a laptop moves to that public address when the LAN stops answering, after it has checked that the server behind it is yours, and comes back when the LAN answers again.

The public listener

It is off until you set two configuration values on the platform container, both read when it starts:

  • Wep:PublicAgent:ListenPort, a port of its own, different from the console’s port and the broker port.
  • Wep:Network:TrustedProxyNetworks, the network or networks your front door connects from. The listener binds only when this names at least one network explicitly in the platform’s configuration; the built-in defaults do not count. Without it every remote device would arrive from the front door’s one address, and a single client could use up the per-address limits on enrollment and device re-issue for every laptop.

Then set Wep:PublicAgent:Address to the HTTPS address your front door publishes. That is the address agents learn. If the listener does not bind, the startup log says why.

On the public port only the agent’s routes and the feed answer. The console, sign-in, the health checks, the broker routes and static files answer 404 with no body. The port decides, never the host name, because front doors rewrite host headers. A few rules are stricter there than on the LAN:

  • An agent that holds no device key is refused, with the same 401 a revoked agent gets.
  • A device-key re-bind after a lost key always waits for an operator, whatever the tenant’s hold setting.
  • A successful enrollment still counts against the per-address enrollment limit, and a refusal at the seat cap does not say how many seats are used.
  • Check-ins, inventory and the other agent calls keep their per-agent limits, so many laptops behind one carrier NAT are not throttled.
  • The route CI pipelines publish in-house apps through stays off this port unless you turn it on, in the catalog policy settings’ Manifest sources section.

What the front door must do

The front door is yours: a reverse proxy such as Caddy or nginx, a Cloudflare Tunnel, or Microsoft Entra Application Proxy with passthrough pre-authentication. Whichever you use, it must:

  • Point at the public port, never at the console’s port. The console’s port serves the console, and a front door in front of it puts the console on the Internet.
  • End TLS with a certificate your endpoints trust. The agent and winget both use this name. A certificate from a public CA needs no root import; anything else is distributed like your LAN root.
  • Pass the path, query string and body through unchanged, with no path prefix added or stripped. The feed’s address carries the endpoint’s token in its path.
  • Forward the client’s address in X-Forwarded-For, from an address inside the trusted proxy networks.
  • Put no sign-in or challenge in front of agent traffic. The agent is a Windows service with no user: an interactive sign-in such as Entra pre-authentication, a login page or a bot-protection challenge breaks it. The agent sends no User-Agent of its own, so key any exception on the host name.
  • Be the only thing that reaches the public port.

Check it from a machine outside your network, such as a laptop on a phone hotspot. At the public name, console pages such as / and /fleet must answer 404, and a check-in sent with no token must answer 401 from the platform. A 200 or a sign-in page means the front door points at the console’s port. A 403, a login page or an HTML error on the check-in means the front door is challenging it.

How the agent decides where to connect

The server proves who it is. At its first start, since platform 0.249.1, the server mints an instance identity key used for nothing else. When an agent asks, the server signs the agent’s fresh nonce together with the addresses it is configured with. The agent checks that answer against the key’s fingerprint it pinned, not against TLS, which the front door ends.

The pin is learned once, and only a new enrollment replaces it. An agent learns it at enrollment (since platform 0.249.2 the enrollment answer carries it), or from a check-in to the address it enrolled with. A check-in never replaces a pin the agent holds; only a new enrollment starts over. The pin and the addresses the agent has proven are kept in agent.addresses.json, readable by SYSTEM only. Community backups carry the identity key. If it goes missing or is replaced, the platform will not start until you restore it from a backup or accept the loss on purpose, because agents will not believe a server that proves itself with another key.

Learning the public address. Since platform 0.249.2 the enrollment answer names it. Since platform 0.249.3 every check-in from an agent at 0.249.2 or later that holds a device key carries it too, in a signed section, so an agent enrolled on the LAN learns it with nothing for you to push. A device that is already away can be given the address, and the fingerprint if it holds none, by machine policy instead, through Intune or Group Policy: the string values PublicAddress and ServerIdentityPin under HKLM\SOFTWARE\Policies\Wep\Agent. The fingerprint is the SPKI SHA-256 the platform logs when it mints the key. However the agent learns an address, it uses it only once the server reached there proves the pinned identity and lists that address among its own.

Switching. The agent stays on the LAN while the LAN answers. Two failures in a row move it: a transport or TLS error, a timeout, or an answer from a front door or captive portal rather than from the platform. Only the platform’s own 401 reads as a revocation. While it is away, the agent keeps checking the LAN, and it moves back once the server there proves the pinned identity, so a captive portal answering the LAN name never pulls it back.

Network changes. Since agent 0.249.5 the agent notices within seconds that the device moved to another network. It asks its current address for a proof at once, and for the next two minutes one failure is enough to switch. A switch starts a check-in straight away, so the server sees the endpoint in seconds rather than at the next 15-minute check-in. A DHCP renewal, a Hyper-V or WSL virtual switch coming up, or a new IPv6 privacy address does not count as a change.

winget follows the agent

When the agent moves, it moves winget’s source with it, between cycles and never while a cycle’s installs run. On the public address the feed’s path carries a remote marker, /e/{token}/r/, and that changes where installers come from:

  • The vendor’s own installer comes from the vendor. For a version whose installer your server holds a copy of, the manifest points at the vendor’s download address instead, pinned to the same SHA-256 your server recorded, so the front door does not carry every installer.
  • Your server’s copy is the fallback. If an endpoint’s download of one version from the vendor fails, the agent reports it at check-in and that version is served from your server for that endpoint. The next version tries the vendor again.
  • What only your server has comes through the front door, such as a derived MSI, which the vendor never served.

Back on the LAN, the marker goes, and installers come from wherever they came from before.

Enroll on the office network first

The public listener redeems only an enrollment token minted as remote-redeemable. Any other token gets the uniform 401 there and stays unspent, and the Community Edition console cannot mint a remote-redeemable token. So install the agent while the endpoint can reach the LAN address, in the office or over a VPN that reaches it. The agent learns the public address from its enrollment answer or its next check-in, and leaves when it needs to.

An agent older than 0.249.2 never switches, and the fleet list marks its endpoint below floor.

Split DNS

If one name reaches your server both ways, resolving to the LAN inside and to the front door outside, the server names that one address public, and the endpoint treats it as public everywhere. In the office too, its feed path then carries the remote marker, and winget downloads vendor installers from the vendor rather than from your server. To keep office downloads on your server, publish the front door under a name of its own.

What the console shows

Since platform 26.11.1900 the endpoint page’s Last sync tile says how the agent’s last check-in reached the server: Reached via LAN or public. The server records that value itself, from the side the check-in arrived on (the office listener or the public agent port), not from the agent’s report or the client IP. The same page lists the server addresses and identity keys the agent refused, such as an address whose server proved a different identity key, and the agent records each refusal on the audit trail.

Since platform 26.11.2000 an endpoint that has not checked in for longer than the tenant’s threshold, 30 days by default, is listed under not seen on /fleet. You can retire it to free its seat, and it comes back by itself if it returns. The fleet list also marks agents too old to switch below floor, and the startup log says whether the public listener is listening.

On a dedicated instance

None of this applies to a dedicated instance: the public listener does not bind there, and its agents keep the instance’s one address. Whether a laptop reaches that address away from the office depends on the instance’s network mode.

Where this stops

  • You run the front door, and a misconfigured one, pointed at the console’s port or challenging agent traffic, either exposes the console or breaks the agents. Check it from outside.
  • A front door that tells an enrolled device from anyone else has not been tested end to end. Since agent 26.11.1700 an agent with a CNG device key holds a client certificate and presents it when a front door asks; older agents and agents on the DPAPI key file have none, so a front door that requires one shuts them out. Since platform 26.11.2000 Settings › Signing keys offers the device CA certificate to download for that front door, and the endpoint page shows each device’s certificate. No revocation list is published, so such a front door admits a certificate until it expires, at most 90 days after issue, even after the endpoint is decommissioned. What stands in front of the agent routes is the platform’s own authentication.
  • Endpoints enroll on the office network or over a VPN first.
  • With an endpoint that cannot reach your server at all, no new desired state reaches it, and its Intune compliance signal reads unknown after 72 hours.