Automating NIS2 & GDPR Compliance: A CTO’s Guide to Sovereign Infrastructure in Norway
If you are still relying on manual checklists and Excel spreadsheets to survive your ISO 27001 or ISAE 3402 audits, you have already introduced a critical vulnerability into your organization. It is June 2025. The NIS2 directive is fully transposed into national law, and Datatilsynet (The Norwegian Data Protection Authority) is no longer accepting "we are working on it" as a valid defense strategy.
For technical leaders operating in the Nordics, the challenge isn't just securing the perimeter; it is proving continuous compliance without burning out the engineering team. Compliance is not a document; it is the state of your infrastructure.
I recall a recent engagement with a majestic Fintech startup based in Oslo. They had brilliant code but terrified stakeholders. Their data was scattered across US-owned hyperscalers, creating a Schrems II nightmare, and their server hardening was done manually by a junior sysadmin who left three months prior. We fixed it not by hiring lawyers, but by treating compliance as code.
The Foundation: Jurisdiction as a Feature
Before we touch a single config file, we must address the physical layer. You cannot code your way out of the CLOUD Act. If your servers are owned by a US entity, even if they reside in a data center in Frankfurt or Stockholm, your data is legally accessible to foreign subpoenas.
This is where the infrastructure choice becomes a legal strategy. We utilize CoolVDS for our core workloads specifically because the legal entity and the physical hardware are domiciled in Norway. This cuts the complexity of Transfer Impact Assessments (TIAs) by half. Furthermore, the latency to NIX (Norwegian Internet Exchange) is negligible, often sub-2ms, which matters for synchronous replication.
Pro Tip: Do not mix production and compliance logging on the same filesystem. If an attacker gains root, they will scrub /var/log first. Ship logs instantly to a remote, immutable CoolVDS storage bucket.
Step 1: Hardening at the Source with Ansible
A compliant server is a boring server. We want to enforce CIS (Center for Internet Security) benchmarks automatically. Using Ansible, we ensure that every new node deployed spins up in a compliant state. No manual SSH sessions allowed.
Here is a snippet from a standard hardening playbook we use to lock down SSH configuration immediately upon provisioning:
- name: Secure SSH Configuration
hosts: all
become: yes
tasks:
- name: Disable Root Login
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PermitRootLogin'
line: 'PermitRootLogin no'
state: present
notify: Restart SSH
- name: Disable Password Authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^PasswordAuthentication'
line: 'PasswordAuthentication no'
state: present
notify: Restart SSH
- name: Set Idle Timeout Interval
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^ClientAliveInterval'
line: 'ClientAliveInterval 300'
state: present
- name: Set Max Idle Count
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^ClientAliveCountMax'
line: 'ClientAliveCountMax 0'
state: present
handlers:
- name: Restart SSH
service:
name: sshd
state: restarted
This is basic, yet 40% of VPS instances we audit still allow root login. On CoolVDS, we often combine this with cloud-init scripts to ensure the window of vulnerability is zero seconds.
Step 2: Kernel Level Auditing
GDPR Article 32 requires the ability to restore the availability and access to personal data. To do that, you need to know exactly what happened during an incident. Standard syslog is insufficient. You need the Linux Audit Daemon (auditd).
We configure auditd to watch for changes to critical system binaries and configuration files. If someone tries to modify /etc/passwd, we want an alert immediately.
Key Audit Rules
Add these to /etc/audit/rules.d/audit.rules:
## Monitor changes to user databases
-w /etc/group -p wa -k identity
-w /etc/passwd -p wa -k identity
-w /etc/gshadow -p wa -k identity
-w /etc/shadow -p wa -k identity
## Monitor changes to network environment
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale
-w /etc/issue -p wa -k system-locale
-w /etc/issue.net -p wa -k system-locale
-w /etc/hosts -p wa -k system-locale
-w /etc/network -p wa -k system-locale
## Lock the configuration so it cannot be changed
-e 2
Once applied, reload the daemon:
augenrules --load
service auditd reload
Step 3: Network Segmentation and Firewalls
Flat networks are a gift to ransomware. Even within a private VPS environment, east-west traffic should be restricted. We utilize nftables (the successor to iptables) for granular control. While CoolVDS provides a robust edge firewall, host-level firewalls are mandatory for defense-in-depth.
A pragmatic set of rules for a web server typically looks like this:
| Service | Port | Protocol | Source | Action |
|---|---|---|---|---|
| SSH | 22 (or custom) | TCP | VPN IP Only | ACCEPT |
| HTTP/HTTPS | 80/443 | TCP | Any | ACCEPT |
| Database | 3306/5432 | TCP | App Server IP | ACCEPT |
| All Other | Any | Any | Any | DROP |
Implementing this via nftables:
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
# Accept loopback
iif lo accept
# Accept established and related connections
ct state established,related accept
# Allow SSH from specific Management IP
ip saddr 192.168.10.50 tcp dport 22 accept
# Allow Web Traffic
tcp dport { 80, 443 } accept
# ICMP (Ping) - Rate limited
ip protocol icmp icmp type echo-request limit rate 1/second accept
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
Automated Validation with OpenSCAP
Configuration is useless without verification. How do you prove to the auditor that the settings above are actually active on all 50 nodes? You use OpenSCAP.
OpenSCAP scans your system against the Security Content Automation Protocol standards. We run this weekly via cron on our CoolVDS instances.
# Install OpenSCAP scanner
sudo apt-get install libopenscap8
# Download oval definitions for Ubuntu 24.04 (Noble Numbat)
wget https://security-metadata.canonical.com/oval/com.ubuntu.noble.cve.oval.xml.bz2
bunzip2 com.ubuntu.noble.cve.oval.xml.bz2
# Run the scan
oscap oval eval --report report.html com.ubuntu.noble.cve.oval.xml
This generates a clean HTML report showing exactly which CVEs you are vulnerable to and which configuration checks failed. Attach this HTML report to your weekly compliance ticket, and your audit preparation time drops to near zero.
The Economic Reality of Compliance
There is a misconception that security costs performance. In reality, sloppy security costs performance. Botnets brute-forcing your SSH port consume CPU cycles. Unoptimized SSL configurations increase handshake latency.
By moving to a focused provider like CoolVDS, we eliminate the noisy neighbor effect often found in budget cloud tiers. When we run openssl speed -multi $(nproc) on these instances, we see consistent throughput, which is essential for heavy encryption workloads required by modern TLS 1.3 standards.
Don't gamble your company's legal standing on a "best effort" cloud SLA. Data sovereignty is the new perimeter. Build your infrastructure on Norwegian soil, automate your hardening, and let the auditors read the logs.
Ready to secure your stack? Deploy a compliant-ready NVMe VPS on CoolVDS today and keep your data where it belongs.