Skip to content

Lesson 9 of 9 · 28m

Operating Remote Access as Production Infrastructure

Measure tunnel health, plan capacity and failover, respond to key compromise, and practice the operational disciplines that keep remote access trustworthy.

Remote access is production infrastructure even when it is "just a VPN." If it fails, every incident becomes harder because the responders cannot reach the systems they are supposed to repair. If it is compromised, the attacker inherits administrative reach. Operate it with the same seriousness as your identity provider, DNS, and deployment pipeline.

Define service-level expectations

Write down what healthy means:

availability/capacity   handshake success, reachability, peers, throughput, CPU, packet rate
enrollment/revocation   time from approval to working access, and disablement to enforced denial
recovery objective      how quickly gateways can be rebuilt

A gateway can be "up" while DNS, routing, or policy backend failure makes it useless. Synthetic checks should exercise real representative paths: connect, resolve an internal name, reach an application, and perform an authenticated action where safe.

Observe what WireGuard deliberately does not log

Export metrics from the host and network layers:

sudo wg show wg0 dump
sudo wg show wg0 transfer
sudo wg show wg0 latest-handshakes

Track interface bytes, packets, drops, handshake age per peer, UDP input errors, CPU, conntrack usage, and route health. Because WireGuard intentionally avoids noisy logs, inventory correlation matters: map public keys to device IDs outside the daemon.

Capacity planning includes packets per second

VPN appliances often die on packet rate before bandwidth. Small-packet voice traffic, scan traffic, or backup replication can expose weak CPU, interrupt affinity, or cloud network limits. Benchmark with realistic traffic:

iperf3 -c 10.44.0.1 -u -b 500M -l 1400 -t 30

Do not treat one synthetic maximum as production capacity. Measure encrypted CPU cost, MTU-sensitive fragmentation behavior, and concurrent peer churn. Keep headroom for incident conditions when everyone connects at once.

Failure design is part of access design

Multiple gateways should fail over cleanly. DNS-based endpoint selection, health-checked anycast, multiple endpoint configs, or control-plane-driven endpoint updates all have tradeoffs. Test what clients actually do when a gateway disappears. Also test the bad day when the access control plane is down but existing tunnels still work — that may be acceptable for transport, but not for enrollment or revocation.

Key compromise response must be rehearsed

The response sequence is simple in theory:

1. Identify affected device/user/public keys; remove peers from gateways and enforcement points.
2. Rotate gateway keys if host compromise is plausible; invalidate application sessions and SSH certificates.
3. Review handshake, flow, authentication, and administrative logs; reissue only after trust is restored.

Change management deserves extra care

Rehearse compromise response: at 03:00, nobody should be discovering which repository owns gateway peer rendering. A bad routing change can lock out every administrator. Use staged rollout, canary devices, automatic rollback, and a break-glass path independent of the system being changed. Document the exact blast radius of each gateway and control-plane component.

Field notes

  • Monitor time synchronization; broken clocks complicate identity systems, certificates, and incident correlation.
  • Keep out-of-band access for the gateways themselves, but protect it as highly privileged infrastructure.
  • Flow logs are often the only evidence of what a connected device touched. Retention decisions are security decisions.
  • Do not confuse silence with health. WireGuard is quiet by design; build external proof that access works.

Was this lesson helpful?

Sign in to rate