Documentation

Server 3.x

Server Hardening#

While the deploy scripts result in a server that works well and is relatively secure, there are a number of things we can still do. We don’t automate this, because it is not necessary in all cases, and some issues depend on how you deploy the VPN server.

This list is by no means complete, but it is a good start. If you have any suggestions for improving this document, please let us know.

Cloud Metadata#

Some cloud providers run a web server on http://169.254.169.254/ that exposes some information about the virtual machine. For example on a Hetzner VM you can query it like this:

$ curl http://169.254.169.254/hetzner/v1/metadata/hostname
argon

On some cloud providers this MAY expose secrets, even though it really should not, but who knows.

In order to prevent VPN client access to this endpoint, you can update the firewall by adding a rule to the forward chain, e.g.:

chain forward {
        # ...

        # drop traffic to cloud "metadata" service (some cloud providers)
        ip daddr 169.254.169.254/32 drop

        # ...
}

Apache Information Exposure#

By default Apache and PHP expose more information than needed, e.g.:

$ curl -I https://vpn.example.org/.well-known/vpn-user-portal
HTTP/1.1 200 OK
Date: Thu, 19 Nov 2026 11:18:28 GMT
Server: Apache/2.4.71 (Debian)
Cache-Control: no-store
Strict-Transport-Security: max-age=15768000
Vary: Content-Type
Content-Type: application/json

The Server field could probably be trimmed a bit. The option for Apache to control this is called ServerTokens.

On Debian you can modify the option in /etc/apache2/conf-available/security.conf and set ServerTokens to Prod. Do not forget to restart Apache.

On Fedora or Enterprise Linux you can create a file with the name /etc/httpd/conf.d/hardening.conf with the content ServerTokens Prod and restart the web server.

PHP Information Exposure#

On Fedora and Enterprise Linux, but not Debian, the PHP version is also exposed by default:

$ curl -I https://vpn.example.org/.well-known/vpn-user-portal
HTTP/1.1 200 OK
Date: Thu, 19 Nov 2026 11:27:34 GMT
Server: Apache/2.4.71 (Fedora Linux) OpenSSL/4.0.3
X-Powered-By: PHP/8.5.12
Cache-Control: no-store
Strict-Transport-Security: max-age=15768000
Content-Type: application/json

You can modify /etc/php.ini and set expose_php to Off. Do not forget to restart the php-fpm service.