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

Homelab

938 readers
2 users here now

Rules

founded 2 years 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) 42 comments
sorted by: hot top controversial new old
[–] radiantxero@alien.top 1 points 2 years 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.
[–] Accomplished-Lack721@alien.top 1 points 2 years ago

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.

[–] electromage@alien.top 1 points 2 years ago

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

[–] CombJelliesAreCool@alien.top 1 points 2 years ago

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

[–] reviewmynotes@alien.top 1 points 2 years ago

You have a good list to start with. Consider adding sshguard or fail2ban in the short term and crowdsec in the long term. Also use lynis on Unix systems and PingCastle on AD systems and see what suggestions those make. Just a few suggestions off the top of my head.

[–] AdderallBuyersClub2@alien.top 1 points 2 years ago

Change all root usernames and passwords to “toor”

Who is going to guess that? Not me.

[–] WildestPotato@alien.top 1 points 2 years ago

Why has no one mentioned CIS hardening.

[–] Emotional_Orange8378@alien.top 1 points 2 years ago

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.

[–] LAKnerd@alien.top 1 points 2 years ago

Air gapped, no Internet access. I don't use Internet services for any of my stuff though so I can get away without direct Internet access

[–] massimog1@alien.top 1 points 2 years ago

Originally I'd change the SSH port, obviously only allow pubkey based auth.

Now however, I do everything over wireguard. Every device has Wireguard Access and depending on that different rules what they can access.

[–] PolicyArtistic8545@alien.top 1 points 2 years ago

Automatic updates and strong passwords. I know that automatic update can break a system but I’ve never had it break anything super critical in my home before that can’t be fixed with 10 minutes of effort. I can think of three things that have broken and required fixing in the last 5 years of auto updating software. I’d much rather have a broke piece of software than a security breach. To those that manually update, how fast after the patch notice are you patching? One day, two days, one week, monthly? What if you are sick or on vacation? I can guarantee mine updates within 24 hours every time.

[–] _DuranDuran_@alien.top 1 points 2 years ago

My homelab is in my garage - the storage array is the only thing I care about not losing so using ZFS encryption and Clevis + tang so it needs to be on the home network and able to contact the server to get the decryption keys.

[–] avdept@alien.top 1 points 2 years ago

If your homelab local only - well all of these are unnecessary if you're the only one who uses it. If you want to expose homelab to internet - you can pretty much use VPN to connect to your homelab without needing to expose whole homelab. Just a port to connect to VPN.

Do not over complicate things

[–] Much_Maintenance_850@alien.top 1 points 2 years ago

on the hardware side of the story.

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

[–] tuanbo91@alien.top 1 points 2 years ago

Disable all incoming, use cloudflare tunnel

[–] null_rm-rf@alien.top 1 points 2 years ago

Not forwarding ports. I use Tailscale Funnel.

[–] 1leggeddog@alien.top 1 points 2 years ago

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

[–] darthrater78@alien.top 1 points 2 years ago

By only having it on when I need it.

People that have theirs on 24/7....why? I used Home Assistant to automate mine so I can bring it up remotely if needed.

[–] tango_suckah@alien.top 1 points 2 years 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).

[–] Digital_Warrior@alien.top 1 points 2 years ago

Lock and key

[–] kY2iB3yH0mN8wI2h@alien.top 1 points 2 years ago

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

[–] sysadminafterdark@alien.top 1 points 2 years ago

Take a look at CIS benchmarks and DoD STIGs. Many companies are starting to harden their infrastructure using these standards, depending on the requirements of the environment. Once you get the hang of it, then automate deployment. DO NOT blow in ALL of the rules at once. You WILL break shit. Every environment has security exceptions. If you’re running Active Directory, run Ping Castle and remediate any issues. Audit often, make sure everything is being monitored.

[–] gwicksted@alien.top 1 points 2 years 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.

[–] u35828@alien.top 0 points 2 years ago

Deny outside access to the core management interfaces. Ne'er-do-wells from the .cn domain trying to hack my router can fuck right off.

load more comments
view more: ‹ prev next ›