The Perimeter is Dead: Implementing a 'Zero Trust' Architecture on Linux in 2014
Let’s be honest with ourselves. The traditional "castle and moat" security strategy is absolutely failing us. If the massive Target breach late last year or the catastrophic Heartbleed vulnerability from just two months ago taught us anything, it’s that relying solely on a perimeter firewall is professional suicide. Once an attacker is inside your network, the "soft chewy center" allows them to move laterally with zero resistance.
At CoolVDS, we are seeing a shift among elite systems architects in Norway toward a concept Forrester Research calls "Zero Trust." The philosophy is simple but brutal: Never trust, always verify. It doesn't matter if the packet is coming from the open internet or your database server's private IP in Oslo—every single connection must be authenticated, encrypted, and scrutinized.
I’m going to walk you through how to build a fortress-like environment on Ubuntu 14.04 LTS (Trusty Tahr). We aren't just going to install a firewall; we are going to assume the network is hostile.
Phase 1: Killing the Password
If you are still allowing password authentication on SSH, you are wrong. Brute force botnets are scanning our IP ranges continuously. The first step in Zero Trust is strict Identity Assurance.
On your CoolVDS instance, we need to enforce SSH keys and, for critical entry points, Two-Factor Authentication using libpam-google-authenticator.
# /etc/ssh/sshd_config
# Disallow root login directly
PermitRootLogin no
# Kill passwords completely
PasswordAuthentication no
ChallengeResponseAuthentication yes
UsePAM yes
# Limit to specific users
AllowUsers deployer sysadmin
By forcing key-based auth, you eliminate the threat of dictionary attacks. But we go further. By integrating PAM with Google Authenticator, even a stolen laptop with a private key isn't enough to compromise your infrastructure.
Phase 2: Micro-Segmentation with IPTables
In a traditional setup, you might have a web server and a database server connected via a private LAN. Usually, admins set the database to ALLOW ALL from the LAN subnet. This is a mistake.
If your web server gets popped (shellshock, SQL injection, bad plugin), the attacker has full reign over your database network port. We need micro-segmentation. Each server is its own perimeter.
Here is a battle-tested iptables configuration for a Database node that only accepts traffic from a specific Web node IP on the MySQL port, and drops everything else. We are not using a GUI firewall wrapper here; we are writing raw rules to ensure we know exactly what the kernel is doing.
# Flush existing rules
iptables -F
# Default Policy: DROP everything.
# If you don't explicitly allow it, it dies.
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
# SSH (Only from your Admin IP Office/VPN)
iptables -A INPUT -p tcp -s 85.x.x.x --dport 22 -j ACCEPT
# MySQL: Only from the Web Server Private IP (10.10.x.x)
# This is the essence of Zero Trust: Explicit Allow.
iptables -A INPUT -p tcp -s 10.10.0.5 --dport 3306 -j ACCEPT
# Log dropped packets (crucial for debugging)
iptables -A INPUT -j LOG --log-prefix "IPTables-Dropped: "
This level of granularity is standard on CoolVDS KVM instances. Unlike OpenVZ containers found at budget hosts, our KVM virtualization provides a true kernel-level isolation, ensuring your iptables rules are yours alone and not interfered with by the host node.
Phase 3: Encryption Inside the Wire
Many sysadmins terminate SSL at the load balancer (Nginx/HAProxy) and send unencrypted HTTP/TCP traffic to the backend. In a Zero Trust model, we assume the internal network might be tapped. You must encrypt traffic between your servers.
With the recent OpenSSL scares, ensure you are running the latest patched version available in the Ubuntu repos:
apt-get update && apt-get install openssl libssl1.0.0
Securing MySQL Replication/Connection
Don't just connect to port 3306 in cleartext. Generate a local Certificate Authority (CA) and force SSL for database replication.
# In my.cnf under [mysqld]
ssl-ca=/etc/mysql/certs/ca-cert.pem
ssl-cert=/etc/mysql/certs/server-cert.pem
ssl-key=/etc/mysql/certs/server-key.pem
# Enforce it per user
GRANT ALL PRIVILEGES ON app_db.* TO 'app_user'@'10.10.0.5' REQUIRE SSL;
This adds overhead. Encryption takes CPU cycles. This is why hardware matters. At CoolVDS, we don't overprovision our CPUs. The encryption overhead for internal SSL is negligible when you have dedicated cores, but it can cripple a shared hosting environment.
The Norwegian Context: Data Sovereignty
Why go through this trouble? Apart from security, we have to consider compliance. While we await stricter EU regulations (the proposed Data Protection Regulation is currently being debated in Brussels), the Norwegian Personopplysningsloven and Datatilsynet guidelines are strict.
Pro Tip: Keeping your data physically in Oslo isn't just about latency to NIX (which, by the way, is <2ms from our datacenter). It's about legal jurisdiction. By encrypting data at rest and in transit, and hosting on CoolVDS servers under Norwegian jurisdiction, you provide the strongest defense against foreign surveillance or data leaks.
Performance Trade-offs
Implementing Zero Trust—encryption everywhere, strict firewalling, 2FA—does introduce friction. It complicates your deployment scripts (Chef/Puppet) and adds handshake latency.
| Metric | Standard Setup | Zero Trust Setup |
|---|---|---|
| Deployment Time | Fast | Moderate (needs cert mgmt) |
| Internal Latency | <0.1ms | ~0.3ms (SSL handshake) |
| Security Posture | Perimeter Only | Defense in Depth |
For high-performance applications, that extra 0.2ms latency can be annoying. However, CoolVDS mitigates this with high-frequency RAM and pure SSD storage, which compensates for the processing overhead. We believe it's a price worth paying to avoid being the next headline.
Final Thoughts
The days of trusting your LAN are over. Treat your internal network like the public internet. Segment your database, encrypt your internal traffic, and enforce strict identity management.
If you are ready to build an infrastructure that actually withstands modern attacks, stop playing with shared hosting toys. Spin up a CoolVDS KVM instance today. We provide the raw power; you bring the paranoia.