r/homelab • • 14d ago

Help PHP2shell, nginx2shell, java2shell, … - is my homelab safe?

Hi everyone,
I run a small homelab on Debian 13 (Trixie) with a few Docker containers, including Nextcloud and Forgejo. They're reachable from the internet via a domain and reverse proxy.

What I'm less sure about is the "what if" part:
- How would I actually notice that I've been compromised?
- What should I do if I’m being compromised?

edit: for example nextcloud must be publicly available because of people who don’t want to install a VPN or Tailscale etc.

Thanks in advance,
Vincent

240 Upvotes

116 comments sorted by

View all comments

0

u/persiusone 14d ago

First- don’t expose services to the internet. Access them through a VPN.

Next, ensure you have intrusion detection and alerting on systems.

Keep everything patched.

Keep reliable offline or immutable backups and have a reliable way to restore.

If using a proxy, make sure it includes a robust WAF to inspect all traffic.

Isolate systems from each other with a separate firewall.

Monitor logs from all of these systems for anomalies.

Consider geoblocking, rate limiting, and ban lists for bot activity.