Frequently Asked Question

Limited Access Services
Last Updated 3 hours ago

Limiting public access to a service means reducing who can reach it, what they can reach, and how much an attacker can learn or do if they find it. No single control is sufficient, so the options below are best used in layers. They are ordered roughly from strongest to weakest for a typical business service.

Quick comparison

Option Strength User friction Best for
Managed VPN (GENAccess) Very high Low (always-on client) Staff access to internal apps, admin panels, RDP/SSH, NAS, ERP
Client certificates (mTLS) at nginx Very high Medium (certificate install) Web apps for known devices and users
IP / netblock allowlisting High (if source IPs are stable) Low Offices, partners, SaaS integrations
Basic auth at nginx Low to medium Low Quick protection for staging or low-risk sites, as an extra layer
Geo-blocking Low to medium Low Noise reduction, not a security boundary
Rotating hostnames Low High Temporary or obscure services only
Hiding the service (non-standard ports, port knocking) Low Medium Reducing automated scanning only

1. Managed VPN (GENAccess)

The service is not exposed to the public internet at all. Users connect to a WireGuard-based VPN and reach the service over a private address.

  • Per-user and per-group access policies restrict each person to only the systems they need.
  • Access can be revoked instantly by disabling the user or device.
  • Traffic can egress via a fixed office IP, so third-party SaaS services can be allowlisted to that single address.
  • Services such as RDP, SSH, SMB, databases and admin interfaces should never be published directly to the internet. A VPN is the recommended method.

Considerations:

  • Each user needs the client installed and enrolled.
  • Public-facing services (for example a customer portal) cannot sit behind a VPN, so use one of the other methods for those.

2. nginx reverse proxy with client certificates (mutual TLS)

nginx refuses the TLS connection unless the client presents a certificate signed by your private certificate authority (CA). Unauthenticated scanners and bots never reach the application.

Example configuration:

server {
    listen 443 ssl;
    server_name app.example.co.uk;

    ssl_certificate         /etc/ssl/certs/app.example.co.uk.crt;
    ssl_certificate_key     /etc/ssl/private/app.example.co.uk.key;

    ssl_client_certificate  /etc/nginx/client-ca/ca.crt;
    ssl_verify_client       on;
    ssl_verify_depth        2;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header X-Client-DN $ssl_client_s_dn;
        proxy_set_header X-Forwarded-Proto https;
    }
}

Create a private CA and issue a client certificate (example using OpenSSL):

openssl genrsa -out ca.key 4096
openssl req -x509 -new -key ca.key -sha256 -days 1825 -out ca.crt -subj "/CN=Example Private CA"

openssl genrsa -out user.key 2048
openssl req -new -key user.key -out user.csr -subj "/CN=fred.bloggs"
openssl x509 -req -in user.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out user.crt -days 365 -sha256
openssl pkcs12 -export -out user.p12 -inkey user.key -in user.crt

The .p12 file is then imported into the user's browser or device certificate store.

Considerations:

  • Keep the CA private key offline and protected.
  • Use short certificate lifetimes (6 to 12 months) and keep a revocation list (ssl_crl) so lost devices can be blocked.
  • Native mobile apps and some API clients do not support client certificates, so check compatibility first.
  • Certificate distribution needs a process. Importing certificates by hand does not scale beyond a small number of users.

3. nginx basic authentication

A username and password prompt in front of the site. It is simple, but weak when used alone because credentials can be brute-forced and are often reused.

sudo apt install -y apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd fred.bloggs
location / {
    auth_basic           "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    proxy_pass           http://127.0.0.1:8080;
}

Considerations:

  • Always use HTTPS, as basic auth sends credentials in an easily decoded form.
  • Use long, unique passwords and add rate limiting (limit_req) or Fail2ban to deter brute-force attempts.
  • Basic auth can conflict with an application's own login, because both use the Authorization header.
  • It works well as a second layer in front of a staging site or a vulnerable legacy application.

4. IP, netblock and geo restrictions

IP and netblock allowlisting

Only permit known addresses, such as your office, a partner, or the GENAccess fixed egress IP.

location / {
    allow 203.0.113.10;
    allow 198.51.100.0/24;
    deny  all;
    proxy_pass http://127.0.0.1:8080;
}

Equivalent firewall rule using UFW:

sudo ufw allow from 203.0.113.10 to any port 443 proto tcp

Considerations:

  • Allowlisting is very effective where source addresses are static. Combine it with the GENAccess fixed egress IP so remote staff also arrive from a known address.
  • Home broadband and mobile addresses change, so allowlisting them leads to constant maintenance and lockouts.
  • Enforce rules at the network firewall as well as on the web server where possible.

Blocklisting

Blocking known-bad addresses or netblocks (for example persistent abusers) is useful for reducing noise, but it is reactive. Attackers rotate addresses easily, so never rely on blocklists as the only control. Tools such as Fail2ban or CrowdSec automate this using behaviour and shared threat intelligence.

Geo-blocking

Allow only requests from the UK (or other countries you trade with), using a GeoIP database such as MaxMind GeoLite2 with the nginx ngx<em>http</em>geoip2_module, or country rules on your firewall.

Considerations:

  • It removes a large volume of automated attacks from regions you do not serve.
  • It is easily bypassed using VPNs or compromised UK hosts, and legitimate users travelling abroad will be blocked.
  • Treat it as noise reduction, not as a security boundary.

5. Rotating hostnames

The service is published under an obscure DNS name (for example k7q2-portal.example.co.uk) which is changed daily or weekly, and the new name is distributed to authorised users.

Considerations:

  • This is security by obscurity. The name is not a secret once it is bookmarked, shared, or logged.
  • Public TLS certificates are published in Certificate Transparency logs, so the hostname is discoverable within minutes of issue. Wildcard certificates (*.example.co.uk) avoid listing individual names.
  • Scanners that connect by IP address, or read the SNI/default virtual host, may still find the service. Configure the default server to drop unrecognised hostnames:
server {
    listen 443 ssl default_server;
    ssl_reject_handshake on;
}
  • Operational overhead is high, and users forget or mistype the new name.
  • It is only suitable for short-lived or low-risk situations, such as a temporary file exchange, and always alongside real authentication.

6. Other effective options

  • Zero-trust or identity-aware proxy: place the application behind an identity provider (Microsoft Entra ID, Google Workspace, Okta) using tools such as oauth2-proxy, Authelia, Cloudflare Access or Tailscale/NetBird policies. This provides single sign-on, MFA and conditional access without a full VPN.
  • Multi-factor authentication (MFA): enable it on every exposed login. It is one of the most effective single controls against credential theft.
  • Web Application Firewall (WAF): ModSecurity with the OWASP Core Rule Set, or a cloud WAF, blocks common attacks such as SQL injection and cross-site scripting. It does not restrict who can connect.
  • Rate limiting and Fail2ban: slows brute-force and credential-stuffing attempts.
  • Port knocking or single packet authorisation (for example fwknop): the port stays closed until a specific sequence is received. It is useful for SSH, but is awkward for general users.
  • Non-standard ports: moving SSH or an admin interface from its default port reduces log noise but does not stop a determined scanner.
  • SSH bastion or jump host: a single hardened entry point for administrative access, ideally reachable only via the VPN.
  • Internal-only services: where no external access is needed, use private addressing or internal-only DNS names, and do not publish the service at all.
  • Time-limited access: open firewall rules or enable accounts only for the period required, such as a support window, and remove them afterwards.
  • Monitoring and alerting: log all access, alert on failed logins and unusual source locations, and patch exposed software promptly.

Recommended approach

  1. Staff-only systems (admin panels, file servers, RDP, SSH, databases, NAS): do not publish them. Place them behind GENAccess.
  2. Web applications for a known set of users: use GENAccess, or an identity-aware proxy with MFA. Use client certificates where devices are managed and compatibility allows.
  3. Third-party or partner access: allowlist their fixed IP addresses, and add basic auth or client certificates as a second factor.
  4. Genuinely public services: use a WAF, rate limiting, patching and monitoring. Geo-blocking can reduce noise.
  5. Temporary services: restrict by IP allowlist, require authentication, and remove access once finished. Use rotating hostnames only as an extra layer, never on their own.

Combine at least two independent layers for anything sensitive, for example VPN plus MFA, or IP allowlist plus client certificate. To discuss which approach suits a particular service, or to have GENAccess policies configured, submit the details through the helpdesk using the Access Profile Definition form.


Powered by GEN UK CLEAN GREEN ENERGY

Loading ...