The Traditional Paradigm: OpenVPN
Architecture and Topology
# Sample basic server.conf snippet for OpenVPN
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 60
cipher AES-256-GCM
persist-key
persist-tun
status openvpn-status.log
verb 3OpenVPN Pros and Cons
-
Pros:
- Full layer-3 access allows running any TCP/UDP-based protocol (SSH, RDP, custom database clients, monitoring tools).
- Complete self-hosting ensures data sovereignty and control over cryptographic material.
- Mature ecosystem with extensive documentation and client support across all major operating systems.
-
Cons:
- Lateral Movement Risk: Once authenticated, a compromised laptop grants an attacker direct network access to the entire subnet unless heavily restricted by internal iptables or security groups.
- Inbound Attack Surface: The VPN gateway must expose a public UDP or TCP port to the internet, making it vulnerable to zero-day exploits and volumetric DDoS attacks.
- Maintenance Overhead: Managing PKI infrastructure, certificate revocations, client configurations, and OS patches on the VPN gateway consumes valuable engineering cycles.
The Modern Paradigm: Cloudflare Zero Trust
cloudflared) runs on your infrastructure, establishing outbound-only WebSocket or QUIC connections to Cloudflare's edge.
Architecture and Topology
# Sample cloudflared configuration (config.yml)
tunnel: a1b2c3d4-e5f6-7890-abcd-ef0123456789
credentials-file: /etc/cloudflared/a1b2c3d4-e5f6-7890-abcd-ef0123456789.json
ingress:
- hostname: ssh.internal.company.com
service: ssh://localhost:22
- service: http_status:404Cloudflare Zero Trust Pros and Cons
-
Pros:
- Zero Inbound Open Ports: The production server requires no public IP or open listening ports;
cloudflaredinitiates purely outbound connections. - Granular Access Control: Access can be scoped down to individual users connecting to specific hostnames, eliminating lateral movement.
- Integrated Identity and Device Posture: Automatic enforcement of hardware keys, disk encryption checks, and IdP session timeouts.
- Zero Inbound Open Ports: The production server requires no public IP or open listening ports;
-
Cons:
- Vendor Dependency: Relies entirely on Cloudflare's global network and SaaS control plane.
- Protocol Limitations: While TCP routing supports SSH and RDP via WARP client or browser rendering, tunneling raw database connections requires additional proxy configurations or the Cloudflare WARP client.
- Cost at Scale: While free tiers exist, enterprise features and user seats incur licensing costs.
Head-to-Head Comparison
| Feature | OpenVPN | Cloudflare Zero Trust |
|---|---|---|
| Network Layer | Layer 3 (Virtual Tunnel) | Layer 7 Application / L4 TCP Proxy |
| Inbound Firewall | Requires open UDP/TCP port | Completely closed (Outbound only) |
| Authentication | Certificates, Pre-shared keys, LDAP | SAML/OIDC via enterprise IdP |
| Lateral Movement | High risk if compromised | Mitigated by application-level isolation |
| Maintenance | Self-managed PKI and gateways | Managed edge, zero-touch tunnels |
| DDoS Protection | Manual upstream mitigation | Native Anycast edge mitigation |
Practical Implementation: Securing SSH Access
Configuring Cloudflare SSH Proxying
cloudflared on your target production server:
sudo curl -L --output /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64
sudo chmod +x /usr/local/bin/cloudflared
sudo cloudflared service install <YOUR_TUNNEL_TOKEN>~/.ssh/config on the administrator workstation) to route connections through the Cloudflare proxy command:
Host ssh.internal.company.com
ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %hssh [email protected], Cloudflare Access intercepts the connection, opens a browser window for authentication (if a valid JWT is not cached), and securely proxies the SSH stream through the existing outbound tunnel.
