What are the most paranoid network/OS security measures you've implemented in your homelab?
As the title says, I want to know the most paranoid security measures you've implemented in your homelab. I can think of SDN solutions with firewalls covering every interface, ACLs, locked-down/hardened OSes etc but not much beyond that. I'm wondering how deep this paranoia can go (and maybe even go down my own route too!).
Thanks!
Nice try, attacker trying to get me to do their reconnaissance work for them. I'm on to you.
It would be funny if that were the case. I was just hoping to be a little more paranoid from you lot and maybe improve on the things I've thought about
Yeah, just having a little fun in the role of a paranoid admin. My setup isn't worth mentioning since it fits my threat model (i.e. nobody gives a shit about my network, just don't be the low hanging fruit) but I'm interested in other replies. Hope you get some useful responses here.
I'd love to play paranoid admin over my network. Thanks!
No, honestly I'm not an attacker, but your local bank. We just need your help to update our systems. Please provide us the following credentials to continue using our phish- *ugh* services.
Credit card number: _____________
CVV: ___
Expiration date: ______
Spfff me, never Anyway please tell me more about your IP adress and your private keys.
Ok my ip address is 192.168.3.200.
Im gonna hack u now
My private key has a 3 in it
“I’m in”
Hackerman
Hey its me your friend Aaron how are you. Hey i was just wandering, what is your credit card details again? just wandering
Logcheck. It took ages to make sure innocent logs are ignored, but now I get an email as soon as anything non-routine happens on my servers. I get emails with logs from every update, every time I log in, etc. This has given me the most confidence that nothing unexpected is happening on my servers. Of course, one needs to make sure that the firewall is configured well, and that you use ssh keys etc., but logcheck is how I know I'm doing enough.
Very nice idea, and it's quite simple too. Thanks
My most paranoid config is disabling Ipv4
That's it. If someone wants to attack me, they will need to adopt IPv6!
And find your IP in a /56 or /64 range (depending on what your ISP gives you). Good luck.
Never used it "in anger" but:
I have my firewall plugged into a metered outlet (plugged into a UPS). I have it set up to send me alerts if power draw increases beyond a certain threshold. I've tested it and wireguard is measurable (yay) but so are DDOS attacks. If I get that alert, I can choose to turn off that plug and take my whole network offline until I get home and can sort that out.
Gotten a few false positives over the years but mostly that is just texting my partner to ask what they are doing.
Care to share what outlet you had success with? I'm comfortable with Home Assistant and ZigBee/Z-Wave. Something this critical probably shouldn't be wireless, but I digress. I'm also interested in what software you're using for monitoring and alerts (if you're willing to share). Cheers!
I just use a pretty generic z-wave plug and home assistant. In the past I did more complex setups that actually determine what process is spiking and so forth. But eventually realized that "this is doing a lot of compute..." is a catch all for a LOT of potential issues.
And I guess I don't understand what you mean by "shouldn't be wireless". It is inherently going to be wireless because you will be on your phone on the other side of the planet. If you genuinely suspect you will be vulnerable to attacks of this scale then you.... probably have other things to worry about.
But as a safety blanket?
Gotcha. A ZigBee/Z-wave plug was the first thing that came to mind. I'll probably go the same route. I was merely saying that wireless-anything is less dependable than wired. But I don't even know if wired smart plugs exist. I use wireless sensors around my home and I've never had an issue with dependability. I definitely wasn't considering Z-wave as a local attack vector. I was just brainstorming some way to avoid a wireless solution for something where dependability is paramount.
Aren't you just DoSing yourself at that point?
Well damn that's clever. I will have to try that.
Or you could trigger automation that turns it off for hours, then turns it back on. That way you could get around the need to physically turn it on, in case everyone is away.
With my firewall disabled a lot of my internal network (including home assistant) will fall over sooner than later.
But that is also a recipe for mass stress. Because I know "something happened". And now I know "in six hours, I need to check in and make sure that 'something' is still not happening". Which is extra shitty if I got the notification late evening local time.
I have friends/neighbors that I trust to swing by and push a button in the event I need to bring it back up before I get home. But if I have reached the point of "it is possible my wireguard credentials were compromised?" then I really don't need to be able to download the next episode of ATLA NOW.
My security is fairly simplistic but I'm happy with it
software protection
physical protection
things I've thought about:
Could you please elaborate how you do the honeypotting?
I just expanded the existing fail2ban config on the commonly used default ports such as 22, 21 Etc, any requests on those ports get sent into purgatory, so the ip gets blacklisted any connections from it hangs until it times out. It's a super basic setup iptables logs whenever a request is not in the current firewall (last rule in the chain) and then fail2ban reads the log and handles the block. I don't count it as part of the normal setup because they're isolated Because the actual ports the service is on still have the normal rule set but the default port numbers are just an instant if there's activity on it you're gone
What honeypot are you using?
Really all I do is setup fail2ban on my very few external services, and then put all other access behind wireguard.
Logs are clean, I'm happy.
Standard and well-tested setup. Thanks for your reply!
Only remote access by wireguard and ssh on non standard port with key based access.
Fail2ban bans after 1 attempt for a year. Tweaked the logs to ban on more strict patterns
Logs are encrypted and mailed off site daily
System updates over tor connecting to onion repos.
Nginx only has one exposed port 443 that is accessible by wireguard or lan. Certs are signed by letsencrypt. Paths are ip white listed to various lan or wireguard ips.
Only allow one program with sudo access requiring a password. Every other privelaged action requires switching to root user.
I dont allow devices I dont admin on the network so they go on their own subnet. This is guests phones and their windows laptops.
Linux only on the main network.
I also make sure to backup often.
Can you explain why you use onion repos? I've never heard of that, and I've heard of kind of a lot of things.
Onion repositories are package repositories hosted on tor hidden services. The connection goes through six hops and is end to end encrypted. In addition to further legitimizing the tor network with normal everyday usage it has the benefit of hiding what packages have been installed on a system.
Here are some notes about them if you want to read more.
https://blog.torproject.org/debian-and-tor-services-available-onion-services/
https://www.whonix.org/wiki/Onionizing_Repositories
That's pretty neat. I might start doing that, just for kicks.
That is very interesting, thanks!
With Debian it's just the apt-tor package, and the project maintains an official list at.. onion.debian.org iirc?
I don't know if serving onion traffic is more expensive for Debian/mirror maintainers so idk if this is something everybody should use
How does this help, assuming your DNS isn't being spoofed?
Please see my reply below with links.
Thanks, never thought of that before. I'll certainly try it, great way to help the network!
Is that a security benefit?
If big corporations hoovering your data should be on everyone's threat list, then yea, i'd say its a huge benefit.
I guess it cuts the attack surface profile down a bit?
Well I dont trust closed source software and do what I can to avoid it when I can. At least foss can be audited. Also all the linux devices on the main network are devices I admin.
Fail2ban yes; one year, however, is IMO a bit excessive.
Most ISP IP assignments do tend to linger - even with DHCP the same IP will be re-assigned to the same gateway router for quite a number of sequential times - but most IPs do eventually change within a few months. I personally use 3 months as a happy medium for any blacklist I run. Most dynamic IPs don’t last this long, almost all attackers will rotate through IPs pretty quickly anyhow, and if you run a public service (website, etc.), blocking for an entire year may inadvertently catch legitimate visitors.
Plus, you also have to consider the load such a large blocklist will have on your system, if most entries no longer represent legitimate threat actors, you’ll only bog down your system by keeping them in there.
Fail2ban can be configured to allow initial issues to cycle back out quicker, while blocking known repeat offenders for a much longer time period. This is useful in keeping block lists shorter and less resource-intensive to parse.
My block list is very small actually due to the non standard ssh port. Everything else goes through wireguard.
If it was open to the public then yes I'd have to reconsider the ban length.
That makes a lot more sense for your setup, then.
I understand some of these words.
all buzz :P
How do you all that have your services on your LAN accessing it over wireguard when external pass the wife/kids/family test? If I had to have my wife activate a VPN before she could access our nextcloud or bitwarden, she'd just never use it
Is always on not an option?
Always on wireguard kills battery life on mobile for me so I guess that's a no.
that should not be the case because wireguard only 'runs' when it sends or receives packets. try setting the keepalive time a bit higher, 5 minutes maybe.
It also breaks android auto for me.
always on they wouldnt know about it and if the connection failed or the wg service crashed on their phone then the services wouldn't work. It adds a complexity that you don't want when you're trying to pass the wife test. Plus yes battery.
no wireguard should not decrease batterylife (see my other comment) we use wg eith always on without any problems. sometimes it stops on one phone but l9oking for the key icon and clicking the action button in the navigationcontrolmenuthingy is quite easy
Using SPA firewall knocking (fwknop) to open ports to ssh in. I suppose if I was really paranoid, the most secure would be an air gap, but there's only so much convenience I'll give up for security.
I'm going to save your comment because it has opened up a new technique for network security that I had never thought of before. Thanks a bunch
I'm an enterprise guy, so that's the explanation for non home use things.
I bet this can still get exploited, just would take effort hopefully none does for a home network.
I'm still one shitty windows zero day click away from getting my workstation or browser tokens owned though, I can feel it.
As somebody taking like 0% of all that measures and not having any problem, luck was involved for sure, unless they have a good reason to attack you in particular... I feel like you will be fine...
Ha, probably. It's fun to learn stuff though.
Working in this field, almost every company has been beached, IP stolen, etc.
Sometimes your home IP gets hit in an automated scan for a vulnerability and then auto exploited by automation. I'm hoping not to get random chance added to a botnet.
You seem to have a great setup. Since this comment touches on slightly advanced topics, I'll ask this here:
Your measures seem to be focussed more on security than privacy - which is great! It's my fault for not specifying it in the post, but I'd definitely like to know if you have done anything specific to keep your network private as well as secure.
Thanks for your wonderful comment - saved!
I guess the firmware is as good as possible. All network devices are just computers and can be exploited. I use a Cisco router as my actual gateway. Sophos is inline after that.
Privacy. 🤔
Not much. I have certain traffic go through a VPN to the Internet, but that's split tunneled.
I use incognito? That doesn't really do anything, ha.
I'm slowly killing web browser tracking and cookie stuff that group policy allows.
I didn't know MS exchange could be used as a WAF. Will need to read more about that.
Can I host Intune completely on-prem?
What do you mean by "My Sophos is self-contained"?
Does your Cisco router get updates? My problem with these companies is that they build backdoors in their firmware for agencies to use. Are you monitoring the network usage of your Cisco gateway?
Using AD/RADIUS on-prem is an intriguing idea. I didn't consider it because if my AD server goes down I'm essentially locked out of my services. I need to think more on this. Thanks.
Sorry for confusion. I use Sophos utm as a WAF for exchange. Basically reverse proxy that is specifically programmed for exchange attacks. It allows OWA to keep working.
I put the exchange admin URL behind authentication, so you try to go to /ecp, it Sophos intercepts and make you authenticate to Sophos utm first, which is passing to ad with radius.
MS got rid of intune on prem. It's only Azure service now. I think.
My router is my biggest vuln. Oddly the most important. It's an enterprise ISR. It's updated as far as possible. My paranoia ends with the US gov/NSA. I don't care if they want back door oddly. I don't want China using me for attack relay however.
Loads of monitoring. You do a span/mirror port to your IDS like security Onion. Let it analyze all your traffic. Apparently there are some state sponsored exploits that allow them to owe a router at kernel level and hide their activities from you and monitoring, but that's a level I can't deal with.
As far as lock out, you create a break glass on everything. Emergency account with non rememberable ridiculous password, saved in a safe place.
This is such a great and a simple idea. Thanks.
I think I followed your setup at a high level, but because I don't have hands-on experience with AD I didn't quite catch the scope of it. Thanks for letting me know, I'll get some reading done when I get the time!
I have the older Sophos utm, which doesn't use the Sophos cloud central manager.
I think their new firewall utm can work disconnected, but I don't know.
Sophos has a home use license that's free for non business use.
I love companies that do community edition or free home use.
Sophos, Veeam has nfr, Elastiflow has community edition, which is a netflow.
This is the first time I've come across Elastiflow, thanks for mentioning it. Seems like an intriguing service to add.
I was considering using Suricata/installing Security Onion to do IDS from the certificate from a private CA. Sophos firewall seems pretty good too.
Since you're running x86 for your router, do you actively prevent ME from trying to connect to the Internet?
I am aware of the ME, but I can't really do anything about it. Current ARM SBCs are not suitable for a router/firewall (at least in my experience). I'm not that concerned about it though.
OpenWRT isn't half bad for usual "router stuff", but advanced usage is a bit hard to do. Of course, that doesn't eliminate the problem since ARM can have plenty of backdoors too
I know, I tried OpenWRT on a Pi, but the experience wasn't great (at least not as a home router).
Wouldn’t that last bullet mean you’re not updating the windows machines whatsoever? Would this not cause more security issues in the long run, considering “connected tot he internet” isn’t a requirement to spread an infection.
It might sound ridiculous, but I currently also run a WSUS server to get Windows updates. But I will probably replace my entire Windows setup with a better solution. Since I don't run Windows bare-metal anymore, I'm looking forward to using offline Windows VMs on my Proxmox host and just accessing the internet directly from my Linux machine.
I'm not super paranoid about security, but I do try to have a few good practices to make sure that it takes more than a bot scanning for /admin.php to find a way in.
I'm assuming this is in your internal network. The problem with this is that communication from the client to the reverse-proxy (unless you're running a reverse-proxy sandboxed with each application/are directly decrypting traffic at the base of your application) is encrypted, but the traffic from the server to the reverse-proxy is not.
Definitely a consideration. In my case, the vast majority of my services are running in docker on a single host box, including the reverse proxy itself (Traefik). That unencrypted traffic never goes out over a wire, so for now I'm not concerned.
Bonus points for creating lots and lots of networks grouping the databases together with only their respective containers.
ip a
is a huge mess.Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
15 acronyms in this thread; the most compressed thread commented on today has 16 acronyms.
[Thread #493 for this sub, first seen 6th Feb 2024, 16:55] [FAQ] [Full list] [Contact] [Source code]
I've got systems that can detect suspicious activities in the net, which result in a shutdown of the router. And not like "could you please shut down" but a hard power off type of shutdown.
Now that's the kind of paranoid I was hoping to see in here. High five, pal.
Oh, you have a setup that signals to your power source to shut off internet when it detects an anomaly on the internet? That's quite specific, and I'm having trouble trying to understand the use-case here, but it's definitely included in the paranoid-list. Thanks!
After reading this thread I'm apparently not paranoid enough.
Internet facing services are on their own firewalled vlan (dmz), behind a rev proxy, and I have crowdsec running on the proxy and router.
Anything that can get away with putting up on a vps I have (e.g. this Lemmy server). But some things have storage/compute requirements I'm not willing to shell out for.
Notifications on system file access
Notifications on root login/sudo
Declarative OS, tmpfs root, disabled sudo
Bastion server, but right now I don't have a proper router to do it at home
Yubikey, or a separate phone on Graphene OS for otp, keys, etc
Authelia + fascist fail2ban (or some CSF)
Most of these are pretty normal, but usually you don't do them all at once 😄 also, I don't really like hiding my services from the open internet, authelia is fine tuned to let people only access what they are supposed to. And regular users of my server usually don't notice that I even have it
I'd love to hear more about your Authelia setup. I'm using Authentik, but planning to do the same thing. I haven't opened my server up to the Internet yet (just built it on Friday), but what I'd like to do is have a webserver that supplies a login page, and you can't access anything else until you've logged in
I'm a Nixos user, I wouldn't be much help unless you do Nixos. But it's a whole new rabbit hole which would take you months/years to learn and setup 😅
What I can say, you can do "access from home network", "access from VPN network", "1fa/2fa from the internet" OR "access for / and /api, but 1fa/2fa for stuff like /admin, /admin-settings, or just /login or /logged-in"
Fail2ban is fun, also maybe have a look at crowdsec
Ah, yeah, I'm running Proxmox. And I'm definitely seeing I have a lot of research to do before I open up to the internet!
I'm actually not from the "close everything, don't open ports, always sit behind cloudflare" camp
We selfhost so we can use and share our services
There are other things we can practice instead of just isolationism and keeping everything as simple as possible
How do you change anything about the OS/do updates? iirc nixos requires elevated privileges for that?
There are many ways to do many things in nixos
For updates you can do automatic updates
Also, there are many deployment tools, like deploy-rs, morph, colmena, bento. They all have different approaches. Some you use ssh to deploy a remote system. Some just fetch the configuration and autodeploy it.
There are many ways how you can play with this. So you can disable sudo, and deploy with ssh only from some or a specified ip. Or you can keep ssh for root disabled and just deploy home-manager. It's really a lot, you imagination is the only limit
P.s. or you can just generate an image from a trusted machine, and flash it onto the device you want, unlimited number of ways
NAT 🥴
Thanks, I'd like to know more about your public-facing setup using cloudflare
there's not much to know about it, I use Cloudflare simply because its routing is better than direct IP connections for many places on Earth. I can't fully use Cloudflare anyway because I host many non-web services.
You might be interested in setting up network bound encryption via Clevis and Tang. I use a hidden pi zero in my house acting as a Tang server. It's great being able to reboot any of my encrypted servers without having to manually unlock disks.
Do you recommend any resources about this? I'd be interested in learning how to implement this.
I'm using the recently merged Clevis module for NixOS. There was a recent talk at FOSDEM about it.
I know about it, but it kinda defeats the purpose (the purpose being police raid protection)
I use a similar setup, but use a USB for my boot drive that has the lvs partition encryption keyfile. I find it much handier since my computer is not near my server. I can boot and then walk upstairs and it is ready, and remove the USB later.
Then there is no way to brute force the decryption or get a password out of me. Also, when the USB is removed and put in a safe place, there is no way to modify the boot partition or UEFI either.
Then I have a password encryption on my data harddrives that I don't know the password to, but is on my password manager.
The thing about being paranoid about this stuff is that I probably focused on the wrong thing. A smash & grab is completely protected against, but that is like a 0.1% chance anyway and a 0.1% chance on top of that 0.1% chance that it would be targeted enough that they would even try to decrypt it.
Full disk encryption is really only usefully at all for an unpowered system. Network hardening will probably take care of 99.99% of attack attempts where encryption is 0.01%.
Even for a laptop, if it gets stolen in public, it is still running and can have the keys extracted or break into the running system if someone really wants to hack it. They wouldn't even try to reboot and break the disk encryption probably...
Too much info, but I guess I am just rambling about how dumb my approach probably is 😅
Neat post and great comments. Saved. Thanks. :)
My personal setup includes:
I‘m aware that stuff might go horribly wrong but so far it hasnt.
Thanks
I need to start doing backups but storage costs money.
Losing stuff costs a lot more, depending on what it is. Also the stress and health risks accompanied are too much for me.
You can get backups as low as 3$/tb afaik. But I only backup stuff that actually means something to me. Photos and videos, documents and code. No movies which take up a lot of space if you copy them with all the subtitles and languages.
Hey so uhh... I just formated the wrong drive. It's recoverable but requires terabytes of network transfers so I'm thinking you may be right.
I’m somewhat paranoid therefore running several isolated servers. And it’s still not bulletproof and will never be!
Why would you rotate passsord though?
Rather choose something random and strong than changing it every 6th moon.
Rotating passwords only for web services. Vaultwarden does make it easy. Not all services allow 2FA.
Sounds still excessive but that's what the thread is here for.
Would probably understand it more if I knew more aspects.
Cheers to more cybersec :)
Guessing it is more a habit from back in time when ssl certification wasn’t common. Panic of MITM attacks, friends sharing their trusted access to other friends, etc. all contributed to my actual status of paranoia.
Don’t make me reconsider my cybersec approach ;)
You could always add another layer ;D
Would you have to compromise on your security according to your threat model if you ran VMs rather than dedicated devices? I'm no security engineer and I don't know if KVM/QEMU can fit everyones needs, but AWS uses XCP-ng, and unless they're using a custom version of it, all changes are pushed upstream. I'd definitely trust AWS' underlying virtualisation layer for my VMs, but I wonder if I should go with XCP or KVM or bhyve.
This is my personal opinion, but podman's networking seems less difficult to understand than Docker. Docker was a pain the first time I was reading about the networking in it.
Really like your setup. Do you have any plans to make it more private/secure?
I used VMs some time ago but never managed to look deeper into separation of bare metal vs VMs. Hence I can’t assess this reasonably.
Docker got me interested when it started and after discovering its networking capabilities I never looked back.
Basically I’m trying to minimize the possibility that by intercepting one dockerized service the attacker is able to start interacting with all devices. And I have lots of devices because of a fully automated house. ;) My paranoia will ensure the constant growth of privacy and security :)
Following for my own edification!
Hope I get a lot of good answers!
Air gapping? I keep a offline backup just in case.
I used to have all VMs in my QEMU/KVM server on their own /30 routed network to prevent spoofing. It essentially guaranteed that a compromised VM couldn’t give itself the IP of say, my web server and start collecting login creds. Managing the IP space got painful quick.
I have Nginx Proxy Manager set up to let me access services running HTTP on other ports on the machine with a local network only access list just so my traffic even in my own network will use TLS. The likelihood that anyone is sniffing traffic on my own network is extremely small, but I’m paranoid. (Can’t let anyone see that I’m running Ubuntu Server. How embarrassing.)
For about a year I was running a full out of band IPS on my network. My core switch was set up with port mirroring to spit out a copy of all traffic on one port so that my Suricata server could analyze it. Then, this was fed into ElasticSearch and a bunch of big data crap looked for anomalies.
It was cool. Basically useless because all it did was complain about the same IP crawler bots as my nginx logs. But fun to setup and ultimately good for my career lol.
The problem is, you'd expect your switch to mirror all traffic, including what it is generating (switches with web servers, baseband/backdoors like every big manufacturer), but you can never really be sure.
Mine's pretty simple, I have a "don't open ports until ABSOLUTELY NECESSARY" policy, wireguard works well enough for everything else I need to access remotely. I also keep SSH disabled on any machine that has direct access to the internet.
Do you use a KVM to interact with machines that can access the Internet?
No, as it's just my main desktop, my laptop and an isolated PiHole VM
npftables blocks all incoming except a particular set of ips. any connections from those ips hit pubkey authentication.
I've never had a problem
I am clearly not paranoid enough. For a while I was running an open source router inline between the network AP and the fiber to Ethernet box and running nids but the goddamn thing kept crapping out every few days so i took it back out until I can find a more stable solution.
I have plans if I can ever get around to it. I want the smart TV, printer and other shitty things on a separate network from the more trusted devices. I don't know how yet but I would like to set up 802.1X for the trusted stuff.
You could not connect the TV and printer to the network but instead attach them to raspberry Pi or similar devices. This allows you full control and stops them calling home and spying.
Tinyssh in a ssh user, su from there. I see privilege management in openssh as potential vulneranility.
One day I will setup my security onion, but I'm procrastinating