this post was submitted on 22 Nov 2023
3 points (100.0% liked)

Homelab

22 readers
1 users here now

Rules

founded 1 year ago
MODERATORS
 

Started off by

  1. Enabling unattended updates
  2. Enable only ssh login with key
  3. Create user with sudo privileges
  4. Disable root login
  5. Enable ufw with necessary ports
  6. Disable ping
  7. Change ssh default port 21 to something else.

Got the ideas from networkchuck

Did this on the proxmox host as well as all VMs.

Any suggestions?

(page 2) 34 comments
sorted by: hot top controversial new old
[–] daronhudson@alien.top 1 points 1 year ago (1 children)

By not opening anything to the wider internet.

[–] cylemmulo@alien.top 1 points 1 year ago

Yeah I’m confused if this is all on some Ubuntu server open to the internet or what. I just vpn into my home when I’m gone, keep it simple

[–] theniwo@alien.top 1 points 1 year ago (5 children)

Enabling unattended updates -> Hell no. Regular Patchdays
Enable only ssh login with key -> yes
Create user with sudo privileges -> yes
Disable root login -> no
Enable ufw with necessary ports -> Basic iptables, but not on all hosts. But fail2ban
Disable ping -> nope
Change ssh default port 21 to something else. -> nope

load more comments (5 replies)
[–] Snoo68775@alien.top 1 points 1 year ago

Disable ICMP? The network team sends their regards 🐴

[–] electromage@alien.top 1 points 1 year ago

Well your host management interfaces shouldn't be exposed to the internet. Use a VPN if you need to access it remotely.

[–] neonsphinx@alien.top 1 points 1 year ago

I just host a bunch of worthless stuff that no one wants.

[–] tuanbo91@alien.top 1 points 1 year ago

Disable all incoming, use cloudflare tunnel

[–] RedSquirrelFtw@alien.top 1 points 1 year ago

Anything that faces the internet I have on a separate vlan. Each system on that vlan is treated as if it was facing the internet directly, that way if one of them gets compromised the hacker will not get far trying to get into any other machines.

Rest of my network is a little more tame just for ease of access since it's only me on here.

Although at some point I do want to revisit my security protocol even locally, just in case. Hitting some kind of drive by trojan script or something within the browser is always a possibility, it could work in reverse where it connects to an external server and then accesses the rest of the network that way. I'm not aware of such trojans but I'm sure it's possible.

I do block all outbound ports except for base internet ports but a properly written malicious script would probably take that into account and use a common port like 443.

At some point I might setup a honeypot. Just need to name the VM "cryptowallet" or something like that and it would be a very fast target. If access to it is detected it would alert me and shut off the internet.

[–] CombJelliesAreCool@alien.top 1 points 1 year ago

Do not discount physical security, lock the doors to your house and get an enclosed rack that you can lock

Only expose applications to the Internet if you have a good need to. Otherwise, use a VPN to access your home network and get to your applications that way.

If you are exposing them to the internet, take precautions. Use a reverse proxy. Use 2FA if the app supports it. Always use good, long passwords. Login as a limited user whenever possible, and disable admin users for services whenever possible. Consider an alternative solution for authentication, like Authentik. Consider using Fail2ban or Crowdsec to help mitigate the risks of brute force attacks or attacks by known bad actors. Consider the use of Cloudflare tunnels (there are plusses and minuses) to help mitigate the risk of DDOS attacks or to implement other security enhancements that can sit in front of the service.

What might be a good reason for exposing an application to the Internet? Perhaps you want to make it available to multiple people who you don't expect to all install VPN clients. Perhaps you want to use it from devices where you can't install one yourself, like a work desktop. This is why my Nextcloud and Calibre Web installs, plus an instance of Immich I'm test-driving, are reachable online.

But if the application only needs to be accessed by you, with devices you control, use a VPN. There are a number of ways to do this. I run a Wireguard server directly on my router, and it only took a few clicks to enable and configure in tandem with the router company's DDNS service. Tailscale makes VPN setup very easy with minimal setup as well. My NAS administration has no reason to be accessible over the internet. Neither does my Portainer instance. Or any device on my network I might want to SSH into. For all of that, I connect with the VPN first, and then connect to the service.

[–] AdderallBuyersClub2@alien.top 1 points 1 year ago

Rat traps… damn mice.

[–] radiantxero@alien.top 1 points 1 year ago
  1. Snort on perimeter inbound and outbound.
  2. ntopng on perimeter.
  3. Heavy VLAN segmentation. Like with like.
  4. Inter-VLAN ACLs on core switch. This is a stateless firewall. Some VLANs with certain device types have inbound and outbound. Trusted devices only have inbound.
  5. SPAN to Security Onion for all internal traffic.
  6. SNMPv3 monitoring on all devices.
  7. MAC Sticky on all camera ports because the cabling extends outside of the physical structure of the house. I am going to implement Dot1X at some point.
  8. VRFs for sensitive infrastructure to prevent outbound routing completely.
  9. A VRF for devices to be forced through an external VPN (Mullvad). Used for devices that do not support a VPN agent.
  10. No antivirus. All antivirus is a botnet.
  11. All server infrastructure is Devuan using OpenRC instead of systemd.
  12. Gaming PC is Artix.
  13. DNS blackhole.
  14. Public DNS is a Swiss no-logging provider which I use DoT to send my queries to.
  15. LibreWolf or Brave Browser on everything.
  16. Only hole into the network is a 4096 bit encrypted Wireguard instance operating in a container using an uncommon port. I wrote a custom script that can reach into the container and pull from the API in order to show active sessions, GeoIP, browser fingerprints, length of time the socket has been open, etc.
  17. I use geofencing for inbound connections to the Wireguard instance. I only allow my immediate area cellular ISPs IANA address spaces to touch my network. Same goes for the geographic area surrounding my parents house.
  18. Unattended updates using custom scripting for my servers, including rebuilding the Wireguard container every single night, updating the server, and I also fire Nessus at it every night. If in the morning there is a CVE of note on that server, the NAT rule allowing traffic to the VPN is disabled at the perimeter until a sufficient patch is released.
  19. I run STIGs on everything, within reason and where infrastructure allows, in my suite.
  20. LibreSSL over OpenSSL.

on the hardware side of the story.

Dont Forget to update all your firmware's and Bios for possible vital penetrations.

[–] 1leggeddog@alien.top 1 points 1 year ago

It's not visible from the internet at all, that's about it

[–] kY2iB3yH0mN8wI2h@alien.top 1 points 1 year ago

i see a lot of stuff but not a single item about securing your homelab.

[–] tango_suckah@alien.top 1 points 1 year ago

I watch networkchuck on occasion, but some of his ideas are... questionable I think. Not necessarily wrong, but not the "YOU MUST DO THIS" that his titles suggest (I get it, get clicks, no hate).

Of the ideas you mentioned, (2), (3), (4), and (5) are somewhere between "reasonable" and "definitely". The rest are either iffy (unattended updates) or security theater (disable ICMP, change ports).

Something to keep in mind for step (2), securing SSH login with a key: this is only as secure as your key. If your own machine, or any machine or service that stores your key, is compromised then your entire network is compromised. Granted, this is kind of obvious, but just making it clear.

As for security theater, specifically step (6). Don't disable ping. It adds nothing to security and makes it harder to troubleshoot. If I am an attacker in a position for ping to get to an internal resource in the first place, then I'm just going to listen for ARP broadcasts (on same subnet) or let an internal router do it for me ("request timed out" == host is there but not responding).

[–] gwicksted@alien.top 1 points 1 year ago

I have a camera outside, I’m a pretty big guy, and my rack was built inside my office so it can’t be moved quickly.

Oh, you mean digital security? Lol I have a lot of subnets and don’t forward in much traffic. The WiFi password I give out gets you on my kids network. Plus I run DPI and IDS. I use cloudflare DNS (sometimes operating an internal pihole too). And I don’t browse social media on PCs only on mobile. The only holes punched from WiFi to internal are for printing. And even the wired clients are segregated from my work network.

from the internet side, I lock down ssh or administrative stuff to local network, and specific IPs, like work. inside my network, everything has a password to access, no defaults. vlans for specific use servers, etc.

[–] limecardy@alien.top 1 points 1 year ago

SSH shouldn’t be internet accessible Changing an SSH port won’t stop someone more than 15 seconds. Disabling ping is security through obscurity at best.

[–] murdaBot@alien.top 1 points 1 year ago

Don't expose unnecessary things to the internet, keep any client PCs patched, use some sort of malware protection ... and that's all you need to do.

All these VLANs are such are just overkill unless you're actively exposing things to the internet. They wind up breaking really useful stuff, especially stuff that relies on multicast.

Besides, that Chinese IoT device can't get hacked if it's not open to the 'net in the first place.

[–] Digital_Warrior@alien.top 1 points 1 year ago

Lock and key

[–] gscjj@alien.top 1 points 1 year ago

I use practical security measures that match my level of exposure and don't severely limit my convienience.

If your lab isn't exposed directly to the internet, at the very least update your servers from time to time, use a string root (admin users as well) password. That's more than enough.

If your lab is exposed, the same applies but update more often. Use SSH keys.

Don't go overboard - the majority of security incidents are from lack of basic security

load more comments
view more: ‹ prev next ›