Agent Wranglers

INF-31Required

Close admin ports to the internet

Never open SSH, RDP, database or admin ports to the internet. Reach machines through an identity-aware tunnel or a private network that needs single sign-on.

How to do it

Use a tool that checks who you are before it opens a path. Examples are AWS Systems Manager Session Manager and Google Cloud IAP. A VPN such as Tailscale or WireGuard behind single sign-on also works. Log each session. On one rented server without such a tool, allow SSH only from fixed admin addresses, as in the host firewall rule. Admin pages inside the app need the same care, as Close debug and admin doors says.

Examples

Shell example

# From a machine outside your network
nmap -Pn -p 1-65535 --open shop.example.com

How to check

A port scan from outside of every public address finds only 80 and 443 open, plus 25 on mail servers.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/networking-and-dns/no-public-admin-ports">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.