How to secure self-hosted services exposed to the internet¶
Once a service is reachable from the internet, it is scanned within minutes: bots try /.env,
/wp-login.php, /.git/config, known exploits for popular apps and default passwords. This
checklist applies whatever tools you use; the last section shows how Corvus covers each point.
1. Expose only what has to be public¶
The safest service is one the internet can't reach.
- Only for you and your family? Put it behind a VPN (WireGuard, Tailscale, Headscale) instead of opening it to the world. No WAF beats not being reachable.
- Has to be public (a blog, a shop, sharing links, an app for many users)? Open only ports 80 and 443, to a reverse proxy. Never forward database, SSH or admin ports directly.
- No public IP (CGNAT, mobile connection)? Use a tunnel (Cloudflare Tunnel, Pangolin, or a small VPS with WireGuard) that ends at your reverse proxy.
2. One reverse proxy in front of everything, with HTTPS¶
A reverse proxy answers on 80/443 and forwards each domain to the right app, so your apps never face the internet directly and you have one place to apply security.
- HTTPS everywhere with automatically renewed certificates (Let's Encrypt); redirect HTTP to HTTPS and turn on HSTS once everything works.
- Keep the apps themselves off public ports: publish them only on the Docker network the proxy uses,
or on
127.0.0.1.
3. Block known attacks before they reach the app¶
Most attacks against self-hosted apps are automated: the same exploit paths and payloads sent to every IP address. A web application firewall (WAF) in the proxy stops them before they hit an app that may not be patched yet.
- Block well-known exploit paths and payloads (SQL injection, path traversal, remote code execution,
leaked files like
.envand.git). - When a new vulnerability is published for an app you run, add a virtual patch (a rule that blocks the exploit) until you can update.
4. Ban IPs that keep attacking¶
One blocked request is noise; an IP that sends hundreds is an attacker or a scanner. Ban it for a while, and longer if it comes back.
- Classic setup: fail2ban or CrowdSec reading the proxy's access log.
- Exempt your own networks and monitoring so you don't lock yourself out.
- Be careful with shared IPs (mobile carriers, offices): ban by time, not forever.
5. Limit the rate of requests, especially logins¶
Rate limits slow down password guessing and scraping. Apply a stricter limit to login and API paths, and put a browser challenge in front of login pages if bots keep hammering them.
6. Keep admin interfaces private¶
The admin panels of your proxy, NAS, router and apps should not be on the public internet.
- Allow them only from your LAN or VPN, use strong passwords and two-step verification.
- Docker trap: ufw and firewalld do not filter ports published by Docker (
ports:in compose). A portufw statusshows as closed can still be open. Publish admin ports on127.0.0.1or a private address, or filter in theDOCKER-USERchain.
7. Update, back up, watch¶
- Update the apps and the proxy regularly; subscribe to their release notifications.
- Back up data and the proxy configuration, and test a restore once.
- Look at your traffic now and then: which hosts are attacked, which IPs are banned, which errors your apps return. Get an alert when something unusual happens.
How Corvus covers this¶
Corvus is a reverse proxy with these protections built in, managed in a web console:
| Checklist item | In Corvus |
|---|---|
| Reverse proxy and HTTPS | Proxy hosts, Let's Encrypt with renewal, forced HTTPS and HSTS |
| Block known attacks | Exploit blocking on by default, request body inspection, virtual-patch templates |
| Ban repeat attackers | Automatic bans with escalating duration and exempt networks, no log parsing |
| Rate limits and bots | Per-host rate limits, browser challenge and "under attack" mode |
| Rules and blocklists | Security rules on IP, country, path, header, User-Agent; blocklists from a URL |
| Apps only some people should reach | A login page in front of the host: one PIN, or users with two-step verification |
| Private console | Separate port, allowed networks, MFA, SSO |
| Watch | Live traffic, request logs, alerts, backups |
It still can't replace the first item: if only you use a service, a VPN is the better answer.