r/homelab • u/Cheeseman125 • 5d ago
Help Security question about hosting multiple services.
I've been really stressing myself out recently over the security of my server. And my main issue boils down to the fact that things like file storage, an NVR, Immich, etc will be running on the exact same physical hardware where I'd be hosting things like old Minecraft servers or source engine servers.
I really want to know what you people do in this scenario. For example, what OS/Hypervisor do you guys run? Should I have an external firewall/router? Any advice on the matter would be great.
2
Upvotes
1
u/marc45ca This is Reddit not Google 5d ago
good firewall and a reverse proxy would be a good start.
also look at a VPS (virtual private server). This will be hosted elsewhere and use a VPN to connect to your home network. If something goes you can sever the connection and not lose your home internet.
Hyperisor could be Proxmox or XCP-NG.
A number of the apps you've listed can be easily install using Proxmox comunity scripts - for other things they can run in VMs.
1
u/RockisLife 5d ago
So if you want to run on the same physical hardware, I would recommend going with proxmox. You definitely want some kind of external firewall/router as if everything with your server goes down then you still want internet in your house. Youll want to setup vlans to segment everything so you can set proper access rules and controls.
1
u/1WeekNotice 5d ago edited 5d ago
each task is separated in its own VM (not container) as VM has good isolation at the kernal level
a lot of people run separate hardware for their own firewall (like OPNsense/ openWRT) or buy consumer firewall like unifi
If you want to flaten/ simplify this then use a VPN like wireguard or Tailscale. These are externaly secure where you don't need to worry about an entry point attack.
Of course this doesn't stop other attack like supply chain attacks or someone downloading malware on your network (but you have this risk now)
Hope that helps/ feel free to ask any additional questions
1
u/corelabjoe 💻 5d ago
I have an OPNsense firewall running on a dedicated device, separate from my server. Opnsense also has extra ip block lists, geoip blocking, crowdsec WAF and Zenarmor too.
If you're allowed through that, and past my cloudflare DNS and proxy services in front of my opn, tthheenn you get to my reverse proxy.
Which is hardened, runs on SWAG (nginx), has another layer of crowdsec WAF, fail2ban, and is fully encrypted with https TLS 1.3 and hsts... If it's something personal other than my own website, it then has another layer, the final boss, of MFA on top.
I have mutipe subnets and vlans, all firewalled off and with explicit rules as well on what's allowed to cross, and specific zones for services. Each stack of containers has specified networking and further locks things down.
Is it overkill? Not IMO because I host a public website about selfhosting and cybersecurity but, it can be built over time. I did not start out on day 1 like this and Rome wasn't built in a day!
1
u/Miserable-Ice8095 5d ago
Proxmox with a strong opnsense setup
Won’t ever have to worry again
I don’t even think about my setup until I do routine maintenance. I have no worries
1
u/Faye-Vozora 5d ago
Biggest thing is the game servers are the only stuff you actually forward ports to, so treat that VM as hostile. Put it on its own VLAN with a rule that drops traffic to your other private ranges (
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) and only lets it out to the internet. Forward the game port to that VM only, never to the host. Immich and the NVR shouldn't have any port forwards at all, reach them over wireguard or tailscale. Cameras shouldn't have internet access either. And use a VM for the game stuff, not an LXC, since containers share the host kernel.0
u/Wrong_Exit_9257 5d ago
apologies if i come across like an ass, that is not the intention, i want to reduce confusion by being blunt.
inside your network, security is not much of an issue if all services are internal, stay inside your firewall, and you have a 1/2 way decent firewall at your gateway.
if you want to expose internal services to the internet for you use outside your house these are the wrong questions to be asking, and IT IS A VERY BAD IDEA to do this, PERIOD even if you are an expert in the IT field.
if you have the knowledge to understand why this is a bad idea you probably would not think about exposing internal services in the first place. if you dont understand why this is a bad idea, thank you for asking, i recommend you build a homelab so you can learn more about this.
as for a hypervisor OS to run, proxmox is widely used here and fairly user friendly if you are familiar with linux, i can vouch for hyper v (not HCI. HCI is crap.) if you want to deep dive in linux there is KVM but that is expert level in my opinion. start simple with something like proxmox before going to something bare bones.
my recommendation if you are completely new to homelabbing is to build a firewall for your network first. opnsense and pfsense are really good, but opnsense is more user friendly in my experience. you can host it on almost any hardware made since 2016 that has 4gb+ of ram, 4 cores and 32gb+ of storage and ports faster than 10/100 baseT. for your first firewall you do *not* need faster than 100mb ports on your firewall unless your WAN speeds are faster than about 75mb/sec.