The Castle Is Burning: Why Perimeter Security Failed Us
If you are still relying on a single OpenVPN gateway to secure your entire backend infrastructure in late 2018, you are not an administrator; you are a gambler. The \"Castle and Moat\" security model—where everything outside is bad and everything inside is trusted—is demonstrably dead. The Equifax breach last year taught us that once an attacker breaches the perimeter (via a simple Apache Struts vulnerability), they have free rein to move laterally across your unencrypted internal network.
Furthermore, with the General Data Protection Regulation (GDPR) now fully enforceable as of May, the Norwegian Data Protection Authority (Datatilsynet) is not interested in your excuses about \"hard borders.\" They care about privacy by design. If a compromised web worker can dump your entire database because your internal network has no segmentation, you are non-compliant.
At CoolVDS, we see this pattern daily: brilliant developers deploying high-performance applications on our NVMe-backed KVM instances, only to bridge them all together on a single, trusting private LAN. Today, we are going to tear down that model and build a Zero-Trust Architecture using tools available right now in October 2018.
The Core Principle: Never Trust, Always Verify
Zero Trust dictates that we treat our private internal network with the same hostility as the public internet. Every packet, every request, and every SSH connection must be authenticated and encrypted, regardless of origin. Latency used to be the counter-argument here, but with the AES-NI instruction sets standard on CoolVDS processors, the encryption overhead is negligible.
1. Kill Your authorized_keys Files
Managing static SSH keys across fifty servers is a nightmare. When a developer leaves, do you rotate keys on every host? Probably not. That is a security hole. The solution is an SSH Certificate Authority (CA).
Instead of trusting individual public keys, your servers trust a single CA key. You sign user keys with an expiration date. If a key is stolen, it expires automatically. If a user leaves, you stop signing their requests.
Step 1: Generate the CA Keys (on your secure local machine, not the server):
# Generate the CA key pair
ssh-keygen -C "CA-COOLVDS-INTERNAL" -f ca_key
# This will output ca_key (private) and ca_key.pub (public)Step 2: Configure the Server to Trust the CA:
Upload ca_key.pub to your CoolVDS instance (e.g., /etc/ssh/ca_key.pub) and edit /etc/ssh/sshd_config:
# /etc/ssh/sshd_config
TrustedUserCAKeys /etc/ssh/ca_key.pub
Step 3: Sign a User's Key:
When a developer needs access, they send you their public key. You sign it with a validity period (e.g., 8 hours):
ssh-keygen -s ca_key -I "john_doe" -n root,deploy -V +8h id_rsa.pub
This generates id_rsa-cert.pub. The user can now log in without their public key ever being in the server's authorized_keys file.
2. Mutual TLS (mTLS) for Internal Services
Your database, your Redis cache, and your internal APIs should not be listening on plain HTTP, even on a private IP. You need encryption in transit. More importantly, you need Mutual TLS, where the server validates the client's certificate.
We highly recommend using Nginx as a reverse proxy sidecar for this. If you are feeling adventurous, OpenSSL 1.1.1 was released last month (September 2018) with support for TLS 1.3. Compiling Nginx 1.14 with OpenSSL 1.1.1 yields significant performance gains in handshake times—crucial for internal microservices.
Here is a robust Nginx configuration snippet for enforcing client certificate verification:
server {
listen 443 ssl http2;
server_name internal-api.coolvds.local;
# TLS 1.3 is the future - use it if you compiled with OpenSSL 1.1.1
ssl_protocols TLSv1.2 TLSv1.3;
# The CA that signed your internal service certificates
ssl_client_certificate /etc/nginx/certs/internal-ca.crt;
# Verify the client allows us to trust the connection
ssl_verify_client on;
location / {
proxy_pass http://localhost:8080;
# Pass the client's identity to the application
proxy_set_header X-Client-DN $ssl_client_s_dn;
}
}Pro Tip: On CoolVDS, our high I/O NVMe storage ensures that the logging overhead from verbose SSL handshakes doesn't create a bottleneck, even under heavy load.
3. Micro-Segmentation with iptables
Firewalls are not just for the edge. Every single server should have a \"default drop\" policy for incoming traffic. If you are using Docker, be careful, as Docker manipulates iptables rules and can accidentally expose ports. We prefer using raw iptables or ufw for precise control on our KVM nodes.
Here is a restrictive policy that only allows SSH and whitelisted internal traffic:
# Flush existing rules
iptables -F
# Set default chain policies to DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Allow loopback
iptables -A INPUT -i lo -j ACCEPT
# Allow established connections (so you don't lock yourself out)
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# Allow SSH (Limit this to your management IP if possible)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Allow specific internal IP (e.g., your App Server talking to DB)
iptables -A INPUT -p tcp -s 10.0.0.5 --dport 5432 -j ACCEPT
# Log dropped packets (useful for debugging Zero Trust issues)
iptables -A INPUT -j LOG --log-prefix "IPTables-Dropped: "Why Infrastructure Matters
Implementing Zero Trust adds computational overhead. Every connection requires a handshake; every packet requires inspection. This is where cheap, oversold VPS providers fail. If your CPU is fighting for cycles because of \"noisy neighbors,\" your handshake latency will spike, causing timeouts in your microservices.
CoolVDS is built on KVM (Kernel-based Virtual Machine) technology. Unlike container-based virtualization (like OpenVZ), KVM provides true hardware isolation. When you run encryption-heavy workloads like TLS 1.3 handshakes, you get the dedicated CPU cycles you paid for.
Furthermore, for Norwegian businesses, data sovereignty is non-negotiable. Storing encryption keys and certificates on servers physically located in Oslo ensures you remain within the jurisdiction of Norwegian law and outside the direct reach of foreign intelligence data sweeps, aligning perfectly with GDPR requirements.
Conclusion
The era of the trusted LAN is over. By implementing SSH CAs, mTLS, and strict firewalls, you insulate your infrastructure from lateral movement attacks. Yes, it requires more configuration than a simple VPN, but the security payoff is absolute.
Don't let legacy architecture be your downfall. Spin up a CoolVDS instance today to test your new Zero-Trust configuration on hardware that can handle the load.