CCyberwiki

Moving an admin panel off the internet

A database tool, a server manager or an app's back office has two safe positions on a network. Either it answers only inside a private network, or every request to it first passes a gate that is separate from the panel and checks who is asking. US federal civilian agencies have been bound to these two choices for the management interfaces of their network devices since June 2023, with 14 days to apply one after a panel is found; the directive marks the separate gate as the preferred option and recommends an isolated management network for the first.1 Its reasoning is that most management interfaces were built for a management network and "not meant to be accessible directly from the public internet".1 Why open panels get attacked is in Exposed administration interface.

Table 1. Ways to reach a panel that is closed to the internet
MethodWho can open a connection to the panelSuits
SSH tunnel (step 3)Anyone who can sign in to the server over SSHOne or two admins who already use SSH
VPN (step 4)Devices holding a VPN keyA team, several panels or servers
Identity proxy (step 5)People who pass the proxy's sign-in policyStaff without SSH or VPN access
Address rule (step 6)Anyone at the listed addressesOffices or servers with fixed addresses

Steps

1. List each panel and the port it listens on

The list covers database tools, container and server managers, job monitors, CMS back offices and any service on a port other than the site's own. A panel that production does not use comes off the server. Port scanning shows how outsiders build the same list.

2. Bind the panel to the loopback address

A service bound to 127.0.0.1, the loopback address address, accepts connections only from the server itself. Docker's documentation calls publishing a container port insecure by default: -p 8080:80 opens the port on every network address of the host, IPv4 and IPv6. Adding the loopback address limits it to the host itself:2

docker run -p 127.0.0.1:8080:80 -p '[::1]:8080:80' nginx

# docker-compose.yml
ports:
  - "127.0.0.1:8080:80"

To make loopback the default for containers on Docker's default bridge network, set "ip": "127.0.0.1" in /etc/docker/daemon.json and restart Docker. In releases older than 28.0.0, machines on the same network switch could still reach ports published to localhost, so the engine has to be 28.0.0 or later.2

3. Reach it through an SSH tunnel

The -L option of SSH listens on a port of the admin's own computer and carries each connection through the encrypted session to a host and port on the server's side. Written with localhost in front, the local port is bound for local use only; with an empty address or * it is open on every network address of the laptop. -N runs no remote command.3

ssh -N -L localhost:8080:127.0.0.1:8080 admin@203.0.113.10
# then open http://127.0.0.1:8080 on your own computer

Anyone who can sign in to the server over SSH can then reach the panel, so the SSH login is the lock to harden (SSH brute-force attack).

4. Or put a VPN in front

A VPN places admin devices inside a private network, and the panel listens only on the VPN address. WireGuard needs a public and a private key on each device, created so that only the owner can read the private key file:4

umask 077
wg genkey | tee privatekey | wg pubkey > publickey

When someone leaves the team, wg set wg0 peer PUBLIC_KEY remove takes their device off the interface.5 Removing access on departure is covered in Account access removal.

5. Or a sign-in proxy with an outbound tunnel

This is the separate gate the directive prefers.1 With Cloudflare, a cloudflared process on the server opens outbound-only connections, so the server needs no public address and its firewall can drop all inbound traffic.6 Order matters. Create the Access application first, under Zero Trust > Access controls > Applications > Create new application > Self-hosted and private, then add the tunnel route; a route with no application in front is open to the whole internet.7

Access applications deny everyone until an Allow policy matches, and Cloudflare checks every request for a valid application token. Turn on Protect with Access in the tunnel settings, or check the token in the app, so a request that reaches the origin by another path is refused.7 Screens as shown in November 2026; the docs now name Cloudflare Mesh as the default connector for private-only access.6

6. Where a panel stays public, limit it by address

A firewall rule on the host keeps every other address away from the port. In ufw the first matching rule wins, so specific rules go before general ones:8

ufw allow proto tcp from 203.0.113.0/24 to any port 8080
ufw deny 8080/tcp

In nginx, allow and deny are read in order until one matches, and the satisfy directive sets how an address rule and a password rule combine, with all as its default.910

location /admin/ {
    satisfy all;
    allow 203.0.113.0/24;
    deny  all;
}

Behind a CDN or another reverse proxy, nginx takes the visitor's address from a header only for requests arriving from addresses listed in set_real_ip_from, the proxies trusted to send a correct one.11 Only the proxy's own ranges belong there, because any address on that list can set the visitor address the allow rules check. Cloud firewalls take the same rules at the provider (Host and cloud firewalls). A port that Docker publishes skips ufw, since Docker diverts that traffic before ufw's rules run (Docker published ports and firewalls).12

7. Keep the panel's own sign-in

Every network, a VPN included, is treated as possibly compromised, with access decided per request.1 A VPN key or an allowed address decides who reaches the panel; the panel's own account, with two-factor and no default password, decides who uses it.

8. Test from outside

From a phone on mobile data, or any network not on the list, request the panel's address and port. A timeout or the proxy's sign-in page is the expected result; the panel's own login page means a path is still open.

Prompt for a coding agent

List every admin interface this project runs: admin routes, database tools, dashboards, job monitors and any container port other than the main site. In Docker Compose and docker run commands, change each admin port mapping to bind to 127.0.0.1. In the nginx or proxy config, restrict admin paths with allow and deny rules for the address ranges I give you, and keep set_real_ip_from limited to the real proxy ranges. Do not remove the app's own login or two-factor. Do not change firewall rules on the server; print the ufw commands instead. List each file and line you changed.

In SecFlash

On the Security page, SF-SEC-310 reports a database tool, server manager or back-office login reachable from the internet, and SF-SEC-302 reports risky open ports. On a connected server, SF-SRV-101 on the Server page names a private service that answers from the internet. On the Cloud page, SF-CLD-102 and SF-CLD-203 report Hetzner and DigitalOcean firewall rules that open such a port to everyone.

See also

References

  1. a b c d CISA (13 June 2023). "BOD 23-02: Mitigating the Risk from Internet-Exposed Management Interfaces". cisa.gov.
  2. a b Docker (read 22 November 2026). "Port publishing and mapping". Docker documentation.
  3. back OpenBSD (read 22 November 2026). ssh(1). OpenBSD manual pages.
  4. back WireGuard (read 22 November 2026). "Quick Start". wireguard.com.
  5. back WireGuard (read 22 November 2026). wg(8). Linux manual pages.
  6. a b Cloudflare (read 22 November 2026). "Cloudflare Tunnel". Cloudflare One docs.
  7. a b Cloudflare (read 22 November 2026). "Publish a self-hosted application to the Internet". Cloudflare One docs.
  8. back Ubuntu (24.04 LTS). ufw(8). Ubuntu manpages.
  9. back "Module ngx_http_access_module". nginx documentation. F5.
  10. back "Module ngx_http_core_module": satisfy (read 22 November 2026). nginx documentation.
  11. back "Module ngx_http_realip_module" (read 22 November 2026). nginx documentation.
  12. back Docker (n.d.). "Packet filtering and firewalls". Docker Docs.