VPN & Private Access: WireGuard, Split-Horizon DNS & Zero Trust
Why network reachability is not authorization—how to combine WireGuard or IPsec VPNs, split-horizon DNS, bastions, and per-app OIDC without creating a flat internal trust zone.
TL;DR
Network reachability is not authorization. Use a VPN (WireGuard or IKEv2) to shrink who can attempt a connection, then enforce OIDC + group claims at the internal gateway and short-lived SSH certs on bastions. Always configure split-horizon DNS and keep an out-of-band admin path so a bad VPN change never locks you out.
Why it exists
A classic flat-network VPN lets any connected laptop reach every internal dashboard, database, and Kubernetes API. Zero-trust private access treats the VPN as network hygiene only: per-device keys tied to your IdP lifecycle, split-tunnel routes, and per-app authentication.
Mental model
- Access layers:
- Internal web apps: VPN (split tunnel) → Internal Ingress/Gateway + OIDC group check →
NetworkPolicy. - Host/break-glass admin: Hardware-backed SSH key or short-lived Vault SSH certificate →
ProxyJumpbastion with MFA and session recording. - Kubernetes API: Private API endpoint reachable over VPN +
kubectlOIDC login (never a static admin token in~/.kube/config).
- Internal web apps: VPN (split tunnel) → Internal Ingress/Gateway + OIDC group check →
- WireGuard
AllowedIPs: On the server,AllowedIPs = 10.90.4.17/32restricts which IP that peer may spoof. On the client,AllowedIPs = 10.30.0.0/16enables split tunneling so personal internet traffic stays off the corporate concentrator (use0.0.0.0/0only when policy mandates full-tunnel DLP inspection). - Split-horizon DNS: Push internal resolvers over the tunnel and route only your internal domain suffix (e.g.
~internal.example) so internal names never leak into public DNS or Certificate Transparency logs.
Do it
Inspect WireGuard handshakes, split-DNS resolution, and MTU on Linux:
# Check active WireGuard peers and last handshake age (not run)
wg show wg0 latest-handshakes
# Verify split-horizon DNS uses the internal resolver (not run)
resolvectl status
dig api.internal.example @10.30.0.10
# Test Path MTU if small requests succeed but large payloads hang (not run)
ping -M do -s 1392 10.30.10.20Connect to private hosts cleanly via ProxyJump without agent forwarding:
# ~/.ssh/config (not run)
Host bastion
HostName bastion.mgmt.example
User ops
IdentityFile ~/.ssh/id_ed25519_sk
Host 10.30.*
ProxyJump bastion
StrictHostKeyChecking yesGotchas
- PMTU / MTU black holes: Tunnel headers reduce effective MTU; if small health checks work but TLS handshakes or large responses hang, set WireGuard
MTU = 1420(or1280) and clamp TCP MSS. - Overlapping RFC1918 CIDRs: Home routers (
192.168.1.0/24) colliding with office/VPC subnets silently break routing—plan non-overlapping internal CIDRs (10.x.0.0/16) early. - Public wildcards for internal names: Issuing a public Let's Encrypt cert for
*.internal.examplepublishes your internal hostnames to public Certificate Transparency logs; use an internal CA (Vault PKI) instead. - No out-of-band rollback: Never manage the VPN concentrator only through the VPN tunnel itself.
Production checklist
- Every private app enforces OIDC + group entitlement at the gateway (reachability alone is never enough).
- One VPN key/certificate per device, tied to IdP offboarding (short TTL).
- Split-horizon DNS resolves internal zones internally without publishing them to public DNS.
- Bastion uses
ProxyJump(no SSH agent forwarding), MFA, and session recording. - Automated check verifies internal LoadBalancers retain RFC1918 private IPs after chart upgrades.
Check yourself
Check Yourself
1. A WireGuard client connects and completes the handshake, small `curl` requests work, but large API responses hang indefinitely. What is the most likely cause?
2. Why should you use `ProxyJump bastion` instead of `ssh -A` (SSH agent forwarding) when hopping through a bastion?
Sources
Related Notes
Vault Secrets: Dynamic Credentials & Leases
How HashiCorp Vault replaces static passwords with short-lived, leased credentials, PKI certificates, and Transit encryption—plus seal/unseal and Raft backup rules.
Prometheus & Grafana Cheatsheet
Essential PromQL queries, metric types (Counter, Gauge, Histogram), cardinality traps, relabeling order, and SLO burn-rate alerting.