Console Login

Perimeter Security is Dead: Implementing a Zero-Trust Architecture on Linux in 2017

Perimeter Security is Dead: Implementing a Zero-Trust Architecture on Linux in 2017

Stop trusting your local network. The moment you assume that traffic inside your VLAN is safe, you have already been compromised. In the traditional "castle and moat" model, we build massive firewalls at the edge and leave the internal network wide open. It’s a soft, chewy center waiting for an attacker to pivot through.

This architecture is failing. With the General Data Protection Regulation (GDPR) enforcement deadline set for May 2018, European businesses—and specifically those of us handling data here in Norway—are running out of time to fix this. If a breach occurs and you can't prove you did everything possible to secure that data, the Datatilsynet (Norwegian Data Protection Authority) will not be lenient.

Today, we represent the architecture Google calls "BeyondCorp," or what the industry is effectively labeling the Zero-Trust Model. We treat every server as if it is sitting naked on the public internet.

The Core Principle: Identity is the New Perimeter

In a Zero-Trust environment, IP addresses are meaningless labels. Trust is derived solely from identity and device state. Whether a request comes from your Oslo office fiber line or a coffee shop in Trondheim, the access controls must be identical.

This requires a shift in how we deploy Virtual Private Servers. You cannot achieve true Zero-Trust on shared hosting or container-based virtualization (like OpenVZ) where kernel vulnerabilities can bleed across tenants. You need hardware-level isolation. This is why CoolVDS exclusively deploys KVM (Kernel-based Virtual Machine) infrastructure. We give you a dedicated kernel so you can enforce strict packet filtering and SELinux policies that shared kernels simply won't allow.

Phase 1: Hardening the Entry Point (SSH)

The first step is securing administrative access. We are seeing a massive uptick in brute-force attacks targeting port 22 across our European nodes. Passwords are dead. If you are still using password authentication for SSH in 2017, you are negligent.

Here is the baseline configuration we use for all CoolVDS high-security management nodes. We implement two-factor authentication at the SSH level using Google Authenticator and force key-based auth.

1. Install the PAM module

yum install google-authenticator
# Run the initialization
google-authenticator

2. Configure SSHD

Edit /etc/ssh/sshd_config. We are moving the port to reduce log noise, though security through obscurity is not security—it just keeps the logs clean.

Port 4422
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication yes
UsePAM yes
AuthenticationMethods publickey,keyboard-interactive
AllowUsers admin_user

3. PAM Configuration

Edit /etc/pam.d/sshd to link the authentication to the strict config:

#/etc/pam.d/sshd
auth required pam_google_authenticator.so nullok
auth required pam_permit.so
Pro Tip: When testing this, keep your current SSH session open. Open a new terminal window to test the connection. If you lock yourself out, you'll need to use the CoolVDS VNC console to recover, which is embarrassing.

Phase 2: Micro-segmentation with iptables

In a Zero-Trust network, Server A should not be able to talk to Server B unless explicitly necessary. If your web server is compromised, it should not have a direct line to port 22 on your database server.

Many sysadmins rely on cloud security groups. That is lazy. We enforce host-level firewalls using raw iptables because it moves with the server, regardless of the routing layer. We default to DROP.

*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]

# Allow loopback
-A INPUT -i lo -j ACCEPT

# Allow established connections (keep state)
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# Allow SSH (New Port)
-A INPUT -p tcp -m state --state NEW -m tcp --dport 4422 -j ACCEPT

# Micro-segmentation: Allow MySQL ONLY from the specific Web App private IP
# Assuming Web App is 10.10.0.5
-A INPUT -p tcp -s 10.10.0.5 --dport 3306 -j ACCEPT

# Log dropped packets (Crucial for auditing)
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

COMMIT

Applying these rules ensures that even if the VLAN is breached, the attacker finds no open doors. The logging directive is vital for post-incident forensics.

Phase 3: Mutual TLS (mTLS) for Internal Services

If you have an API communicating between your frontend and your backend, HTTP is forbidden. Even standard HTTPS isn't enough because it only validates the server. Zero Trust requires the server to validate the client.

We use Nginx with Client Certificate verification. This effectively moves authentication to the handshake layer. Only a client possessing a valid certificate signed by your internal CA can even connect.

Generating the Internal CA and Keys

# Create CA Key
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

# Create Client Key
openssl genrsa -out client.key 2048
openssl req -new -key client.key -out client.csr

# Sign Client Key
openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out client.crt

Nginx Configuration for mTLS

Inside your nginx.conf block:

server {
    listen 443 ssl;
    server_name api.internal.coolvds.com;

    ssl_certificate /etc/nginx/certs/server.crt;
    ssl_certificate_key /etc/nginx/certs/server.key;

    # Enforce Client Certificates
    ssl_client_certificate /etc/nginx/certs/ca.crt;
    ssl_verify_client on;

    location / {
        proxy_pass http://localhost:8080;
    }
}

With ssl_verify_client on;, any connection attempt without the client.crt is dropped during the handshake. It saves application resources because the request never hits your application logic.

The Hardware Reality

Software controls introduce overhead. Encryption everywhere (SSL/TLS internal traffic) increases CPU load. Strict packet filtering consumes interrupt cycles. If you run this stack on a budget VPS with "noisy neighbors" stealing your CPU cycles, your latency will spike.

This is where infrastructure choice becomes a security decision. CoolVDS nodes utilize enterprise-grade NVMe storage and dedicated CPU threads. When you are decrypting SSL traffic at line rate, you need high I/O performance and consistent clock speeds. We have optimized our network stack for low latency within the Nordic region, peering directly at NIX (Norwegian Internet Exchange) in Oslo. This ensures that the extra security hops don't destroy your user experience.

Conclusion

The days of relying on a perimeter firewall are over. By 2018, GDPR will demand that we prove our security posture is robust by design, not just by accident. Implementing SSH hardening, default-drop firewalls, and mTLS internal communication creates a hostile environment for attackers but a resilient one for your data.

Security is not a product; it is a process. But that process starts with a platform that gives you the control to implement it. Don't gamble with compliance.

Secure your infrastructure today. Deploy a KVM-based, NVMe-powered instance on CoolVDS and start building your Zero-Trust architecture.