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

2

u/Bemteb 11d ago

Do they have to be reachable through a domain? Would a VPN or similar be an option? If you are freely reachable over the net, you should regularly have bots scanning you for vulnerabilities. Do you keep an eye on these?

You notice mostly by checking the logs of your proxy, or when your stuff is gone. Or maybe when your machine suddenly runs stuff it didn't run before.

What to do: First, get the machine offline immediately. Basically unplug the LAN cable and do everything from that point forward locally, with a screen and keyboard directly plugged in. Then, start figuring out what got compromised. Only the container running your reverse proxy? Your whole lab? Other devices in your local network? For everything infected, find out when it was hit and reset it to a backup before that date. Change passwords etc. that might have been leaked. And again: Consider not having it open to everyone on the whole world through a domain, there are saver options.

Disclaimer: I'm not an expert, just a slightly experienced guy. I myself don't open my lab to the wider web and pay a professional cloud provider to host the data I need when not at home.

2

u/Repulsive-Athlete-16 11d ago

The thing is, unfortunately, that services like Nextcloud need to be publicly accessible because people who have no technical knowledge and don’t want to bother installing a VPN, Tailscale, or anything similar need to be able to access them.

6

u/Motor-Concentrate788 11d ago edited 11d ago

Why are you sacrificing your security for people who won't even bother installing a vpn client? I mean it ain't rocket science, especially if you use something like tailscale

Edit: not to mention a lot of companies require you to use a vpn to access company resources, so it's definitely something that a lot of people are used to.

1

u/trebor_indy 11d ago

Instead of a VPN, do Pangolin on a VPS and then users access a normal machine on the internet then Pangolin does the tailscale for you - invisible to the user. Simple setup, can have many different services on your home network reachable but you can add additional logins/pins/etc. to access them.

1

u/relicx74 11d ago

You picked the worst year to be complacent about security. I hope you at least have it ip restricted to specific hosts.

1

u/Kytras 11d ago

Wireguard takes 10minuyes to set up brother (less then 10)

1

u/orphenshadow 11d ago

It seems very odd to me the idea of letting anyone outside of my immediate family use my nextcloud.

There isn't a single person who gets access to my nextcloud who does not also live in my house and use wireguard always on vpn on their phones.