Console Login

Zero Trust in the Wake of Heartbleed: Hardening Your Norwegian VPS Infrastructure

The Perimeter is a Myth: Zero Trust after CVE-2014-0160

If the events of April 7th—the disclosure of the Heartbleed bug (CVE-2014-0160)—have taught us anything, it is that the traditional "hard shell, soft center" security model is fundamentally broken. For years, systems administrators have relied on a strong perimeter firewall, assuming that once traffic is inside the data center, it is safe. We trusted our libraries. We trusted our internal networks. We trusted SSL.

That trust was misplaced. When a simple missing bounds check in OpenSSL allows an attacker to read 64KB chunks of memory from your server—potentially scraping private keys and session cookies—it becomes clear that we need a new paradigm. Enter the Zero Trust model.

Coined by John Kindervag at Forrester, the concept is simple: Never Trust, Always Verify. In the context of hosting infrastructure in Norway, this means treating every single interface, even the loopback, as a potential vector. Here is how we architect a Zero Trust environment using standard Linux tools available today (2014) on the CoolVDS platform.

1. The Foundation: KVM over OpenVZ

Before we touch a single config file, we must address the virtualization layer. In the budget hosting market, OpenVZ (container-based virtualization) is popular because it allows providers to over-sell resources. However, OpenVZ shares the host kernel. If a vulnerability exists in the host kernel, or if a "noisy neighbor" exploits a kernel panic, your instance goes down with them.

In a Zero Trust architecture, isolation is paramount. This is why CoolVDS standardized on KVM (Kernel-based Virtual Machine). With KVM, your VPS has its own kernel, completely isolated from other tenants. You cannot trust your neighbors.

Pro Tip: Verify your virtualization type. Run virt-what or check your CPU flags. If you don't see hardware virtualization extensions, you are likely in a container. Move to KVM immediately for serious workloads.

2. Network Segmentation with Iptables

Many developers configure iptables to allow everything on eth1 (private network) because "it's internal." Zero Trust dictates that the internal network is just as dangerous as the public internet. If one server is breached, it shouldn't be able to pivot to your database server freely.

We need a "Default Drop" policy. Here is a battle-tested iptables configuration for a web server that refuses to talk to anyone unless explicitly allowed. This script is designed for CentOS 6 but applies to Debian 7 as well.

# Flush existing rules
iptables -F

# Set default policies to DROP. 
# If we forget a rule, the packet dies. Safety first.
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Allow loopback (essential for local services like php-fpm connecting to mysql on localhost)
iptables -A INPUT -i lo -j ACCEPT

# Allow established connections (so the server can reply to requests)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow SSH (Limit this to your specific office IP if possible!)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

# Allow Web Traffic
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT

# Save rules
service iptables save
service iptables restart

Notice that we do not open port 3306 (MySQL) to the public interface. If you need to connect to the database from your workstation, use an SSH Tunnel. Do not expose your database to the internet, not even with a password.

3. Authentication: Death to Passwords

Brute force attacks are constant. If you are still using password-based authentication for SSH, you are failing the verification step of Zero Trust. We must enforce SSH keys and, for critical entry points, Two-Factor Authentication (2FA).

Step A: Hardening SSHD

Edit /etc/ssh/sshd_config:

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AllowUsers deploy_user

Step B: Implementing 2FA with Google Authenticator

Google released a PAM module that integrates with the Google Authenticator mobile app. This adds a "something you have" layer to your server access.

# On CentOS/RHEL (requires EPEL repository)
yum install google-authenticator

# Run the setup
google-authenticator

Once generated, add the following to /etc/pam.d/sshd:

auth required pam_google_authenticator.so

Now, even if an attacker steals your private SSH key (perhaps via a Heartbleed-vulnerable client), they cannot login without the rotating token on your phone.

4. Database: Local Binding

For a typical LAMP stack hosted on a single CoolVDS instance, your database should not be listening on a network socket at all if it can be avoided. If it must, bind it strictly to localhost.

Check your my.cnf (usually in /etc/mysql/ or /etc/):

[mysqld]
# BIND TO LOCALHOST ONLY
bind-address = 127.0.0.1

# Disabling symbolic links is recommended to prevent assorted security risks
symbolic-links=0

If you have a multi-server setup (Web + DB separated), use the private network interface provided by CoolVDS, but ensure iptables on the DB server only accepts packets on port 3306 from the specific IP address of the Web server. Trust nothing else.

5. Data Sovereignty and Physical Security

Zero Trust extends to the physical location of your data. Following the revelations from Edward Snowden last year, reliance on US-based Safe Harbor frameworks is becoming legally risky for Norwegian businesses handling sensitive customer data. The safest approach is ensuring your data resides within Norwegian borders, subject to the Personopplysningsloven (Personal Data Act).

CoolVDS infrastructure is located in Oslo data centers. This offers two advantages:

  1. Legal Compliance: Your data remains under Norwegian jurisdiction, satisfying Datatilsynet requirements.
  2. Performance: Latency to the NIX (Norwegian Internet Exchange) is typically under 2ms. When you terminate SSL/TLS (which is computationally expensive), you don't want network latency adding to the handshake time.

Conclusion: Update Your OpenSSL Now

Before you implement these architectural changes, you have an immediate task. If you haven't done so in the last 72 hours, check your OpenSSL version immediately.

rpm -q openssl
# or
dpkg -l openssl

If you are not on the patched version (e.g., openssl-1.0.1e-16.el6_5.7 for CentOS 6), update and reboot. Security is not a product; it is a process. By choosing a provider that offers raw KVM isolation like CoolVDS, and configuring your OS with a Zero Trust mindset, you reduce your attack surface drastically.

Don't leave your infrastructure to chance. Deploy a hardened KVM instance on CoolVDS today and keep your data within Norway's borders.