this post was submitted on 07 Sep 2024
80 points (80.3% liked)

Selfhosted

40296 readers
344 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

This is a decent writeup on applying "Zero Tust" principles to a home lab using mostly open source tools. I'm not the author, but thought it was worth sharing.

all 33 comments
sorted by: hot top controversial new old
[–] PlutoniumAcid@lemmy.world 87 points 2 months ago (4 children)

Zero trust, but you have to use Amazon AWS, Cloudflare, and make your own Telegram bot? And have the domain itself managed by Cloudflare.

Sounds like a lot of trust right there... Would love to be proven wrong.

[–] mosiacmango@lemm.ee 64 points 2 months ago* (last edited 2 months ago) (1 children)

ZeroTrust is a specific type of network security where every network device has its access to other devices validated and controlled, not a statement on the trustworthiness of vendors.

Instead of every device on a LAN seeing every other device, or even every device on a VLAN seeing other devices on a VLAN, each device can only connect with the other devices it needs to work, and those connections need to be encrypted. These connectioms are all monitored, logged and alerted on to make sure the system is working as intended.

You do need to trust or validate the tooling that does the above, regardless of what you're using.

[–] PlutoniumAcid@lemmy.world 3 points 2 months ago (1 children)

That sounds awfully complicated for home use.

[–] mosiacmango@lemm.ee 2 points 2 months ago* (last edited 2 months ago)

Yes and no. The auditing is likely the harder part. You can use something like tailscale or nebula vpn to get the always on vpn/ACLs. With a dozen or two devices, it should be doable at a home scale.

If you want clientless zerotrust then you're talking heavier duty things like Palo alto gear and the like.

[–] min@lemmy.sdf.org 8 points 2 months ago (1 children)

I've been researching zero-trust for my homelab recently and I'm considering OpenZiti instead of Cloudflare since I think it can all be self-hosted. The BrowZer from OpenZiti is especially interesting to me. The fact that I'm behind CGNAT is a hurdle though.

[–] timbuck2themoon@sh.itjust.works 2 points 2 months ago

I haven't looked terribly far into it but zrok (SP?) is based on openziti

[–] Dnb@lemmy.dbzer0.com 3 points 2 months ago

You can trust zero of it. Is that not the same?

[–] sugar_in_your_tea@sh.itjust.works 2 points 2 months ago* (last edited 2 months ago)

Yeah, I practice some ZeroTrust principles w/o using any of the above. I use Docker networks to associate services and their data and restrict them from accessing services/data they don't need. I use HAProxy at the edge to route requests to specific nodes in my network, and all of that operates over my own WireGuard VPN. I'm working on creating VLANs for my network to further segment things, so I can dictate which devices can access which resources. For continuous monitoring and alerting, any separate device connected to my VPN would work (haven't yet configured that); I personally don't bother because my SO/kids will tell me if something they use goes down, and knowing a few minutes earlier wouldn't matter.

You really don't need AWS, Cloudflare, or Telegram for any of this. That said, it is interesting to read through when crafting your own solution, if only to check which parts you have and what parts you may have forgotten.

[–] powerofm@lemmy.ca 39 points 2 months ago (1 children)

The document is filled with so much meaningless fluff that it's annoying to read and was probably written by chatgpt and the cover image is AI generated: I don't think there's anything useful here.

[–] avidamoeba@lemmy.ca 10 points 2 months ago

It looks like something for a LinkedIn post.

[–] ancoraunamoka@lemmy.dbzer0.com 20 points 2 months ago (1 children)

this is a very bad article. It talks about "zero trust" but then suggests you to use corporate software, the cloud, sketchy russian apps to monitor your traffic at home. Also, I am not spending 2 hours a day going through my logs, nor I want a VM/container with 8GB of ram wasting 40% of my GPU on grafana.

[–] krnl386@lemmy.ca 5 points 2 months ago

The author has a Master’s in informatics. That’s pretty much like an MBA. I wouldn’t expect more than buzzword-bingo from someone like that.

[–] schizo@forum.uncomfortable.business 9 points 2 months ago (1 children)

Amused that the 'This is private! You no hack!' banner nonsense isn't a dead thing yet.

Life protip: the bots scanning your shit will absolutely not care, and shockingly, criminals will also absolutely not care.

[–] melmi@lemmy.blahaj.zone 4 points 2 months ago (1 children)

When done correctly, the banner is actually a consent banner. It's a legal thing, not necessarily trying to discourage criminals. It's informing users that all use will be monitored and it implies their consent to the technology policies of the organization. It's more for regular users than criminals.

When it's just "unauthorized access is prohibited", though, especially on a single-user server? Not really any point. But since this article was based on compliance guidelines that aren't all relevant to the homelab, I can see how it got warped into the empty "you no hack" banner.

[–] Quik@infosec.pub 8 points 2 months ago (2 children)

I, too, don’t love the use of AWS/Cloudflare, while I get that you can simply replace AWS S3 with something else for backups, this server setup is innately based on using Cloudflare.

[–] mhzawadi@lemmy.horwood.cloud 12 points 2 months ago (3 children)

Maybe I should do a write up on my setup, as I don't use Cloudflare or AWS. I do use backblaze and OVH

[–] zer0squar3d@lemmy.dbzer0.com 3 points 2 months ago (2 children)
[–] mhzawadi@lemmy.horwood.cloud 1 points 2 months ago

have made a start in documenting what I run, not sure who much of how it runs you want

[–] mhzawadi@lemmy.horwood.cloud 1 points 2 months ago* (last edited 2 months ago)

Will see what I can do, will probably be on https://homelab.horwood.biz/

[–] sugar_in_your_tea@sh.itjust.works 1 points 2 months ago (2 children)

I'd appreciate it as well.

I have a somewhat sophisticated setup as well that doesn't use Cloudflare (aside from domain and DNS hosting) or AWS (I use a simple Hetzner VPS). I'm considering using Backblaze for backups, and everything else is self-hosted.

One of my main goals is that every responsibility should be modular and have a compatible drop-in replacement. I'm very interested to read what others with a similar perspective have done.

[–] mhzawadi@lemmy.horwood.cloud 2 points 2 months ago* (last edited 2 months ago)

Will see what I can do, will probably be on https://homelab.horwood.biz/

[–] mhzawadi@lemmy.horwood.cloud 2 points 2 months ago

have made a start in documenting what I run, not sure who much of how it runs you want

[–] 01189998819991197253@infosec.pub 1 points 2 months ago

that sounds like a value added write up.

[–] fruitycoder@sh.itjust.works 2 points 2 months ago (1 children)

What is a good alt for cloudflare here tbh?

I've done wire guard, and tor service to obfuscate the network, and crowdsec for a good external firewall, and linkerd gateway to actual services (and keycloak for sso).

Besides adding gotelaport for more fine grained access, idk what else you could do, but even then idk if its still competitive as someone else's network taking your ddos loads lol

[–] anzo@programming.dev 2 points 2 months ago (1 children)

A cheap VPS with headscale. Or just ZeroTier.com free plan.

[–] fruitycoder@sh.itjust.works 1 points 2 months ago

ZeroTier looks super cool!

[–] cron@feddit.org 6 points 2 months ago

Based on the complexitiy of this setup, you need to be quite enthusiastic about your homelab.

[–] Mikelius@lemmy.ml 6 points 2 months ago

I'd say anyone wanting to go this deep into a home monitoring setup will likely go with what works best for them instead of reading and following the entirety of this guide... I'm one of those people...

Wrote my own log parsing software to put into a database, display and alert through grafana, which is alerting through a homemade webhook that sends a notification to ntfy based on severity... And I also use uptime Kuma like mentioned, but my notifications channel is ntfy. No cloudflare for my internal services, only wireguard to connect home and use everything. And definitely no telegram.

Plenty of other stuff setup, but my security alerts and monitoring rely heavily on the syslog/grafana server which helps me monitor everything.

I don't meet all of the items here (my homelab setup is still a WIP), but here's basically what I have:

  1. Cloudflare manages my domain and DNS, but nothing else; I only use them because they're cheaper than my last registrar (Namecheap)
  2. VPS at Hetzner acts as my edge - HAProxy forwards packets based on SNI over my WireGuard VPN to the relevant device on my network
  3. I use Caddy on each device to handle TLS, and all services are inside docker with zero directly exposed ports
  4. each service only has access to the files and other containers it needs to accomplish the task
  5. my router is configured w/ static DNS, so all requests to services go to my domain name over TLS, but they don't hit the WAN if I'm on my LAN

I don't have continuous monitoring and alerting, mostly because the only people using my network are me, my SO, and my kids. I am planning on adding some alerting though, and I especially need to configure SMART reporting (had it configured at one time). So when I do that, I'll add some dashboards for my various other services as well.

Some things I plan to add:

  • backup and restore - I plan to use Backblaze, my main hurdle is that I don't want to backup my large media files (movies and whatnot), and I haven't put in the work to configure a service to handle backups; this is a top priority for me
  • VLANs to separate devices - I want one network w/o internet access for my IP cameras, one for devices that need access to specific external sites (e.g. my smart TV, or a separate media device once I switch to a dumb TV), one for privileged services (e.g. my NAS, which will talk to multiple VLANs), and one for guests
  • continuous monitoring and alerting - each device would report to a service on my VPS (or maybe a separate VPS)
  • home automation system - my focus has been on replacing external services, and I don't use an automation system yet, so I haven't gotten to this; but I'm planning on using HomeAssistant as I roll out my other home monitoring stuff

So I'm probably halfway to what the OP has laid out. I don't do this type of thing at work, and I don't share anything outside my network, so I'm in no hurry. However, I do need to handle backups and SMART monitoring on my NAS ASAP, since those are the last glaring gaps in my setup.

[–] Decronym@lemmy.decronym.xyz 3 points 2 months ago* (last edited 2 months ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
CGNAT Carrier-Grade NAT
DNS Domain Name Service/System
IP Internet Protocol
NAS Network-Attached Storage
NAT Network Address Translation
SSL Secure Sockets Layer, for transparent encryption
TLS Transport Layer Security, supersedes SSL
VPN Virtual Private Network
VPS Virtual Private Server (opposed to shared hosting)

[Thread #957 for this sub, first seen 8th Sep 2024, 14:05] [FAQ] [Full list] [Contact] [Source code]

[–] 31337@sh.itjust.works 3 points 2 months ago

This is more complicated than some corporate infrastructures I've worked on, lol.

[–] anzo@programming.dev 1 points 2 months ago

Nice write-up. I'd take this as a blueprint. Anyone can swap 3rd-party services to their like (e.g. headscale, xmpp bot on that vps, backblaze s3, etc.) and extend upon (e.g. oidc providers, mailboxes, arr suite, etc.)