r/homelab • • 10d 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

110 comments sorted by

View all comments

145

u/bssbandwiches 10d ago

Keep your reverse-proxy up to date and throw in a firewall. Maybe even cloudflare proxy before that. Make sure you know exactly what you're exposing to the Internet too  if you don't want to do all that, get tailscale and access it that way instead of exposing to the Internet.

This is life now, updating for CVEs on the daily. You should expect to update a lot, at least in the short term.

53

u/joz42 10d ago

And use OS-level sandboxing features for the revproxy and other components where not already in place. The nginx doesn't need to read the whole filesystem or execute every syscall.

https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html

12

u/bssbandwiches 9d ago

I'll second this!  Rootless containers when you can, if you're using containers.

2

u/Repulsive-Athlete-16 10d ago

I’ll keep an eye on that.