Zero-Trust Infrastructure: Surviving the Breach You Haven't Detected Yet
Letβs be honest with ourselves for a moment. The "castle and moat" security strategy is dead. It died the moment your entire engineering team started accessing production databases from their living room Wi-Fi in March. If you are still relying solely on a perimeter firewall to protect your soft, gooey internal network, you aren't just negligent; you're already compromised.
The reality of September 2020 is harsh. The Schrems II ruling in July killed the Privacy Shield, effectively making data transfers to US-owned clouds a legal minefield. Meanwhile, ransomware gangs are getting smarter, moving laterally through networks because admins assume that "inside" equals "safe."
Zero Trust isn't a product you buy from a vendor with a slick slide deck. It's a paranoid architectural mindset: Never trust, always verify. Every packet, every user, every server.
Here is how we build a Zero-Trust environment on Linux, using tools available right now in 2020, focusing on the three pillars: Network Identity, Application Verification, and Data Sovereignty.
1. The Network Layer: Encrypted Mesh with WireGuard
For years, we suffered through OpenVPN. It's slow, it runs in userspace, and the configuration files are longer than a Tolstoy novel. With the release of Linux Kernel 5.6 earlier this year, WireGuard is finally in the mainstream kernel. It is leaner, faster, and perfect for creating a mesh network where every server talks to every other server over an encrypted tunnel, regardless of physical location.
In a Zero-Trust model, we don't use private LANs (VLANs) as security boundaries. We treat the private network as hostile. We encrypt the traffic between our database and our web server, even if they are in the same rack.
Here is a battle-tested wg0.conf configuration for a database node. We drop the MTU slightly to account for encapsulation overhead, vital for stability:
[Interface]
Address = 10.100.0.2/24
SaveConfig = true
PostUp = ufw route allow in on wg0 out on eth0
PostDown = ufw route delete allow in on wg0 out on eth0
ListenPort = 51820
PrivateKey =
MTU = 1360
[Peer]
# The Web Server
PublicKey =
AllowedIPs = 10.100.0.3/32
Endpoint = 192.0.2.10:51820
Deploying this requires strict firewalling. We don't want the WireGuard port open to the world, only to known peers if possible. But more importantly, services like MySQL or Redis should only bind to the WireGuard interface IP (10.100.0.2), never to 0.0.0.0.
Pro Tip: On CoolVDS KVM instances, WireGuard performance is near-native because we don't oversubscribe CPU cycles. Unlike container-based VPS (OpenVZ/LXC) where kernel modules can be a nightmare to load, our KVM architecture gives you your own kernel. You can modprobe wireguard without begging support for permission.
2. Application Layer: Mutual TLS (mTLS) with Nginx
Encryption in transit is standard (HTTPS). But typically, only the server proves its identity to the client. In a Zero-Trust environment, the client (e.g., your microservice or admin dashboard) must also prove its identity to the server using a client certificate.
This is Mutual TLS (mTLS). If an attacker manages to spoof an IP or breach the firewall, they still cannot connect to your API without the cryptographic key signed by your internal CA.
First, generate your internal Certificate Authority (CA), then issue a client certificate. Once you have the client.crt and ca.crt, configure Nginx to reject anything that doesn't present a valid certificate.
server {
listen 443 ssl http2;
server_name internal-api.coolvds.com;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
# The Magic of mTLS
ssl_client_certificate /etc/nginx/ssl/internal-ca.crt;
ssl_verify_client on;
location / {
proxy_pass http://localhost:8080;
# Pass the CN of the cert to the app for logic handling
proxy_set_header X-Client-DN $ssl_client_s_dn;
}
}
With ssl_verify_client on;, Nginx terminates the connection during the handshake if the certificate is missing or invalid. The request never even reaches your application code. This effectively mitigates many application-layer DDoS attacks and vulnerability scans.
3. Identity & Access: SSH is a Privilege, Not a Right
The default sshd_config on most distros is too permissive. In 2020, password authentication is unacceptable. SSH keys are the baseline, but we need to go further. We use Certificate-Based SSH Authentication (signing public keys with a CA key) or strict hardware-backed 2FA.
At a minimum, verify your /etc/ssh/sshd_config matches these constraints:
Protocol 2
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
AuthenticationMethods publickey
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 0
AllowUsers deployer_user
Combine this with Fail2Ban. While Fail2Ban is old tech, it is reliable. Configure it to ban repeat offenders permanently. If you see 10 failed auth attempts from an IP, that IP is dead to you.
4. Data Sovereignty: The Legal Zero-Trust
Technologists often forget that security includes legal risk. The Schrems II ruling from the CJEU (Court of Justice of the European Union) has made it clear: US surveillance laws (FISA 702) are incompatible with GDPR. If you host sensitive data on a US-owned hyperscaler (AWS, Azure, GCP), you are technically in violation of GDPR regarding data transfers, as they are subject to the US CLOUD Act.
Zero Trust applies to your vendor, too. Can you trust a vendor compelled by foreign law to hand over your data?
This is where CoolVDS fits the architecture. We are a Norwegian entity. Our servers are in Oslo. We are not subject to the US CLOUD Act. Your data stays under Norwegian and EEA jurisdiction. For a truly hardened stack, you must control the jurisdiction of the bits on the disk.
5. The Immutable Infrastructure Approach
Finally, avoid configuration drift. In a Zero-Trust setup, if a server behaves oddly, we don't patch it; we kill it and replace it. Use tools like Ansible to ensure every server is configured identically.
Here is a snippet of an Ansible playbook to ensure our strict firewall rules are always active:
- name: Configure UFW for Zero Trust
hosts: all
become: yes
tasks:
- name: Deny all incoming by default
ufw:
policy: deny
direction: incoming
- name: Deny all outgoing by default (Whitelist only!)
ufw:
policy: deny
direction: outgoing
- name: Allow WireGuard Traffic
ufw:
rule: allow
port: '51820'
proto: udp
- name: Allow outgoing DNS
ufw:
rule: allow
port: '53'
proto: udp
direction: outgoing
Blocking outgoing traffic is painful but necessary. If an attacker plants a reverse shell on your server, it won't be able to call home if port 4444 isn't whitelisted.
Summary
Zero Trust is not about buying a gateway appliance. It is about granular control. It is about using WireGuard to encrypt internal traffic, Nginx mTLS to verify applications, and strict SSH configs to verify admins. And crucially, it is about knowing exactly where your data physically sits.
Latency matters in these encrypted meshes. Routing traffic through a central VPN hub adds delays. A mesh network on high-performance infrastructure minimizes this overhead. With CoolVDS, you get the raw NVMe I/O and low-latency network peering in Oslo required to run encryption-heavy stacks without the lag.
Ready to lock down your infrastructure? Don't leave your data exposed in a public cloud. Deploy a secure, sovereign KVM instance on CoolVDS today and start building your fortress.